mirror of
https://github.com/hashicorp/vault-action.git
synced 2025-11-15 02:23:46 +00:00
build
This commit is contained in:
parent
10ec29c5fb
commit
da71d5cb54
1 changed files with 18 additions and 12 deletions
6
dist/index.js
vendored
6
dist/index.js
vendored
|
|
@ -1328,6 +1328,8 @@ async function getClientToken(client, method, path, payload) {
|
||||||
|
|
||||||
core.debug(`Retrieving Vault Token from v1/auth/${path}/login endpoint`);
|
core.debug(`Retrieving Vault Token from v1/auth/${path}/login endpoint`);
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
/** @type {import('got').Response<VaultLoginResponse>} */
|
/** @type {import('got').Response<VaultLoginResponse>} */
|
||||||
const response = await client.post(`v1/auth/${path}/login`, options);
|
const response = await client.post(`v1/auth/${path}/login`, options);
|
||||||
if (response && response.body && response.body.auth && response.body.auth.client_token) {
|
if (response && response.body && response.body.auth && response.body.auth.client_token) {
|
||||||
|
|
@ -1342,6 +1344,10 @@ async function getClientToken(client, method, path, payload) {
|
||||||
} else {
|
} else {
|
||||||
throw Error(`Unable to retrieve token from ${method}'s login endpoint.`);
|
throw Error(`Unable to retrieve token from ${method}'s login endpoint.`);
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
core.debug(error.response.body);
|
||||||
|
throw Error(`Unable to retrieve token from ${method}'s login endpoint.`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue