set Vault namespace from task in vault_hook JWT login (#19080)

The JWT login codepath for the `vault_hook` was missing the Vault namespace, so
the login request for non-default namespaces would fail.
This commit is contained in:
Tim Gross
2023-11-14 09:54:36 -05:00
committed by GitHub
parent bae82b14b4
commit b5af87ebf3
3 changed files with 27 additions and 12 deletions

View File

@@ -431,8 +431,9 @@ func (h *vaultHook) deriveVaultTokenJWT() (string, error) {
// Derive Vault token with signed identity.
token, err := h.client.DeriveTokenWithJWT(h.ctx, vaultclient.JWTLoginRequest{
JWT: signed.JWT,
Role: role,
JWT: signed.JWT,
Role: role,
Namespace: h.vaultBlock.Namespace,
})
if err != nil {
return "", structs.WrapRecoverable(