mirror of
https://github.com/hashicorp/vault-action.git
synced 2025-11-08 07:36:56 +00:00
fix: actually build namespace changes
This commit is contained in:
parent
e394527e23
commit
ab4dc55b2e
1 changed files with 10 additions and 3 deletions
11
dist/index.js
vendored
11
dist/index.js
vendored
|
|
@ -3749,17 +3749,23 @@ const got = __webpack_require__(798);
|
||||||
async function exportSecrets() {
|
async function exportSecrets() {
|
||||||
const vaultUrl = core.getInput('url', { required: true });
|
const vaultUrl = core.getInput('url', { required: true });
|
||||||
const vaultToken = core.getInput('token', { required: true });
|
const vaultToken = core.getInput('token', { required: true });
|
||||||
|
const vaultNamespace = core.getInput('namespace', { required: false });
|
||||||
|
|
||||||
const secretsInput = core.getInput('secrets', { required: true });
|
const secretsInput = core.getInput('secrets', { required: true });
|
||||||
const secrets = parseSecretsInput(secretsInput);
|
const secrets = parseSecretsInput(secretsInput);
|
||||||
|
|
||||||
for (const secret of secrets) {
|
for (const secret of secrets) {
|
||||||
const { secretPath, outputName, secretKey } = secret;
|
const { secretPath, outputName, secretKey } = secret;
|
||||||
const result = await got(`${vaultUrl}/v1/secret/data/${secretPath}`, {
|
const requestOptions = {
|
||||||
headers: {
|
headers: {
|
||||||
'X-Vault-Token': vaultToken
|
'X-Vault-Token': vaultToken
|
||||||
|
}};
|
||||||
|
|
||||||
|
if (vaultNamespace != null){
|
||||||
|
requestOptions.headers["X-Vault-Namespace"] = vaultNamespace
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
const result = await got(`${vaultUrl}/v1/secret/data/${secretPath}`, requestOptions);
|
||||||
|
|
||||||
const parsedResponse = JSON.parse(result.body);
|
const parsedResponse = JSON.parse(result.body);
|
||||||
const vaultKeyData = parsedResponse.data;
|
const vaultKeyData = parsedResponse.data;
|
||||||
|
|
@ -3837,6 +3843,7 @@ module.exports = {
|
||||||
normalizeOutputKey
|
normalizeOutputKey
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 761:
|
/***/ 761:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue