mirror of
https://github.com/hashicorp/vault-action.git
synced 2025-11-10 00:26:55 +00:00
tweak naming
This commit is contained in:
parent
52d9b1dec2
commit
00bca77bab
1 changed files with 5 additions and 4 deletions
|
|
@ -12,15 +12,16 @@ async function exportSecrets() {
|
|||
|
||||
for (const secret of secrets) {
|
||||
const { secretPath, outputName, secretKey } = secret;
|
||||
var headers = {
|
||||
const requestOptions = {
|
||||
headers: {
|
||||
'X-Vault-Token': vaultToken
|
||||
}};
|
||||
|
||||
if (vaultNamespace != null){
|
||||
headers.headers["X-Vault-Namespace"] = vaultNamespace
|
||||
requestOptions.headers["X-Vault-Namespace"] = vaultNamespace
|
||||
}
|
||||
|
||||
const result = await got(`${vaultUrl}/v1/secret/data/${secretPath}`, headers);
|
||||
const result = await got(`${vaultUrl}/v1/secret/data/${secretPath}`, requestOptions);
|
||||
|
||||
const parsedResponse = JSON.parse(result.body);
|
||||
const vaultKeyData = parsedResponse.data;
|
||||
|
|
@ -96,4 +97,4 @@ module.exports = {
|
|||
exportSecrets,
|
||||
parseSecretsInput,
|
||||
normalizeOutputKey
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue