kyndryl-open-source/hashi-vault-js

Hashicorp cloud defaults to the `admin` namespace, no `X-Vault-Namespace` header sent by library.

0b1kn00b opened this issue · 12 comments

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Install hashi-vault-js npm install hashi-vault-js ...
  2. Initiate object this way (add your code snippet)
  3. Call this library function (add your code snippet)
  4. See error (Provide error message)

Expected behavior
A clear and concise description of what you expected to happen.

Environment:

  • Node.js version:
  • npm version:
  • hashi-vault-js version:
  • Vault Server Version (retrieve with vault status):
  • Vault CLI Version (retrieve with vault version):
  • Client/Server Operating Systems:

Additional context
Add any other context about the problem here.

Thanks @0b1kn00b ! Can you elaborate a little bit on this one? Or point the HashiCorp Vault documentation that you're referring to. Thanks

This seems more an enhancement than an issue.

I don't 100% understand the namespace system but moving from self hosting to hosted, selecting a namespace requires the X-Vault-Namespace header to be set. I didn't see a way of passing axios options through directly, but perhaps that's my shout.

I think you are talking about Vault Enterprise namespaces.
If so, you can pass the namespace information on the path, you don't need necessarily use the X-Vault-Namespace header.

@0b1kn00b could you please confirm this is the case?

I'm closing this as no answer.

There's a bunch of confusion with this moving between self hosted and Vault Enterprise as the actual Hashicorp cli doesn't appear to support namespaced logins right now. Believe me, I've tried.

That is to say, you *have to use the environment variable, which breaks other tooling not aware of it.

Ok @0b1kn00b, since this is not a huge change to the constructor class, I'll this parameter there. Tagged for 0.4.6 version.

Resolved by @articobandurini, I need to test it.

I had to tweak a little bit as you cannot access defaults on an Axios instance. @0b1kn00b it's available on 0.4.6, please test it. Thanks

I did sort of slide off and write an http client of my own in the mean time, sorry. I probably won't be the only one ever moving from self hosted to cloud though.

No problem at all. I'm closing this enhancement.