Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.appRoleLogin() requires secret_id, which can be an optional field #88

Closed
ryanlewis opened this issue Aug 8, 2018 · 1 comment
Closed

Comments

@ryanlewis
Copy link
Contributor

According to the Vault docs for logging in with AppRole, it appears that the secret_id is not always required if bind_secret_id=false against the AppRole.

However, we get the following error: Missing required property: secret_id.

Repro code:

const NodeVault = require("node-vault");

const vault = NodeVault({ apiVersion: "v1", endpoint: process.env.VAULT_URL });

vault
  .approleLogin({ role_id: 'ebadc783-4b12-e465-3f84-3490d297c88d', requestOptions: { followAllRedirects: true } })
  .then(result => console.log(result))
  .catch(err => console.error(err));

This produces the following output:

{ Error
    at new ValidationError (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:1461:12)
    at ValidatorContext.createError (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:359:14)
    at ValidatorContext.validateObjectRequiredProperties (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:993:22)
    at ValidatorContext.validateObject (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:960:11)
    at ValidatorContext.validateAll (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:603:11)
    at Object.validate (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:1573:24)
    at validate (/Users/rlew/Desktop/node-vault-repro/node_modules/node-vault/src/index.js:138:23)
    at Object.client.(anonymous function) [as approleLogin] (/Users/rlew/Desktop/node-vault-repro/node_modules/node-vault/src/index.js:172:14)
    at Object.<anonymous> (/Users/rlew/Desktop/node-vault-repro/node-vault-repro.js:6:4)
    at Module._compile (module.js:635:30)
  message: 'Missing required property: secret_id',
  params: { key: 'secret_id' },
  code: 302,
  dataPath: '',
  schemaPath: '/required/1',
  subErrors: null,
  stack: 'Error\n    at new ValidationError (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:1461:12)\n    at ValidatorContext.createError (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:359:14)\n    at ValidatorContext.validateObjectRequiredProperties (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:993:22)\n    at ValidatorContext.validateObject (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:960:11)\n    at ValidatorContext.validateAll (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:603:11)\n    at Object.validate (/Users/rlew/Desktop/node-vault-repro/node_modules/tv4/tv4.js:1573:24)\n    at validate (/Users/rlew/Desktop/node-vault-repro/node_modules/node-vault/src/index.js:138:23)\n    at Object.client.(anonymous function) [as approleLogin] (/Users/rlew/Desktop/node-vault-repro/node_modules/node-vault/src/index.js:172:14)\n    at Object.<anonymous> (/Users/rlew/Desktop/node-vault-repro/node-vault-repro.js:6:4)\n    at Module._compile (module.js:635:30)' }

This means that we are unable to use node-vault with AppRoles that do not require a secret_id using node-vault.

ryanlewis added a commit to ryanlewis/node-vault that referenced this issue Aug 8, 2018
@ryanlewis
Copy link
Contributor Author

PR to change this: #89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant