chiefy / vaulted

nodejs based wrapper for HashiCorp's Vault HTTP API
https://chiefy.github.io/vaulted
MIT License
47 stars 6 forks source link

load app-id apis #81

Closed trtin closed 8 years ago

trtin commented 8 years ago

Hi,

I need to a line code to load api-id authentication apis. Could you help to do it? _.extend(this.endpoints, loadAPISpecs(this, config, 'app-id'));

into function:

function API(config) { if (.isUndefined(config) || .isUndefined(config.get)) { throw new Error('API must be configurations object'); } Endpoint = require('./endpoint')(config);

this.endpoints = {}; this.specs = {};

.extend(this.endpoints, loadAPIDefinitions(config)); // default auth backend .extend(this.endpoints, loadAPISpecs(this, config, 'token')); // default secret backend _.extend(this.endpoints, loadAPISpecs(this, config, 'secret'));

_.extend(this.endpoints, loadAPISpecs(this, config, 'app-id')); }

Thanks,

kenjones-cisco commented 8 years ago

The default auth backend and secret backend are loaded this way. To use the auth backend, app-id, you would need to mount it after initializing and unsealing the Vault using the method createAuthMount.

The inputs could be something like this:

myVault.createAuthMount({
        id: 'app-id',
        body: {
          type: 'app-id'
        }
      });

The body is the the key value as it is refers to the app-id backend,

chiefy commented 8 years ago

@tintran253 closing this, let us know if you are still having issues.