I'm trying a simple operation using node-vault but it is not working. Here is my attempt:
Configuration
var options = { apiVersion: 'v2', // default endpoint: 'http://127.0.0.1:8200', // default }; // get new instance of the client var vault = require("node-vault")(options); vault.token = "<<MY TOKEN>>";
Usage
vault.write('secret/data/new', {"data": {"foo": "bar"}}).then( function (value: any) { console.log(value); }) .catch((err: any) => { console.log(err); });
Response
{ statusCode: 404, body: { errors: [] } }
But, if I run vault kv put secret/data/new foo=bar
it does work and value is there.
What is going on?
Thank you all and I wish a happy new year!