| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The kubernetes command paths fall back to {{kubernetesPath}} when no
mount_point is given, but kubernetesPath only lives on the client and
was never added to the mustache render context, so the templates
rendered an empty segment (e.g. kubernetesLogin hit /auth//login
instead of /auth/kubernetes/login).
Inject client.kubernetesPath into the render context; per-call args
still take precedence. Adds unit tests for the default and a custom
kubernetesPath.
Closes nodevault#300
|
Just a gentle check-in on this one. It's a small fix so kubernetesPath gets passed into the mustache path context. Happy to rebase or add a test if that would help it along. Thanks for maintaining node-vault. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Closes #300.
The kubernetes command paths use /auth/{{mount_point}}{{^mount_point}}{{kubernetesPath}}{{/mount_point}}/login, so when no mount_point is passed they fall back to {{kubernetesPath}}. But kubernetesPath only exists on the client object (client.kubernetesPath, defaulted to 'kubernetes' in src/index.js) and was never added to the mustache render context, which only received the call args. So the fallback rendered empty and kubernetesLogin() hit /auth//login instead of /auth/kubernetes/login.
The fix injects client.kubernetesPath into the render context, with call args still taking precedence so a per-call override keeps working. This also covers the other kubernetes role command paths that use the same template.
Added two unit tests (default mount point, and a custom kubernetesPath). Both fail on the old code with /auth//login and pass with the fix. Full unit suite: 99 passing, lint clean.