5
0
Fork 0
mirror of https://github.com/hashicorp/vault-action.git synced 2025-11-07 15:16:56 +00:00

fix: actually allow custom methods

This commit is contained in:
Richard Simpson 2020-04-07 12:14:02 -05:00
parent 567ec72c33
commit 83d944ba1a

View file

@ -21,8 +21,9 @@ async function exportSecrets() {
const secretRequests = parseSecretsInput(secretsInput); const secretRequests = parseSecretsInput(secretsInput);
const vaultMethod = (core.getInput('method', { required: false }) || 'token').toLowerCase(); const vaultMethod = (core.getInput('method', { required: false }) || 'token').toLowerCase();
if (!AUTH_METHODS.includes(vaultMethod)) { const authPayload = core.getInput('authPayload', { required: false });
throw Error(`Sorry, the authentication method ${vaultMethod} is not currently supported.`); if (!AUTH_METHODS.includes(vaultMethod) && !authPayload) {
throw Error(`Sorry, the provided authentication method ${vaultMethod} is not currently supported and no custom authPayload was provided.`);
} }
const defaultOptions = { const defaultOptions = {