5
0
Fork 0
mirror of https://github.com/hashicorp/vault-action.git synced 2025-11-14 18:13:45 +00:00

fix prefixless queries to default to data

This commit is contained in:
Richard Simpson 2020-04-11 23:00:08 -05:00
parent 7b3e2a5aac
commit 272c40f535
5 changed files with 7428 additions and 5712 deletions

35
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,35 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests",
"request": "launch",
"args": [
"--runInBand"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
{
"type": "node",
"name": "vscode-integration-tests",
"request": "launch",
"args": [
"--runInBand",
"--config=${workspaceFolder}/integrationTests/basic/jest.config.js"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
]
}

View file

@ -45,7 +45,7 @@ inputs:
required: false
runs:
using: 'node12'
main: 'dist/index.js'
main: 'dist/entry.js'
branding:
icon: 'unlock'
color: 'gray-dark'

12892
dist/index.js vendored

File diff suppressed because it is too large Load diff

View file

@ -75,7 +75,10 @@ async function exportSecrets() {
const results = await getSecrets(requests, client);
for (const result of results) {
const { value, request } = result;
const { value, request, cachedResponse } = result;
if (cachedResponse) {
core.debug(' using cached response');
}
command.issue('add-mask', value);
if (exportEnv) {
core.exportVariable(request.envVarName, `${value}`);

View file

@ -56,6 +56,10 @@ async function getSecrets(secretRequests, client) {
*/
function selectData(data, selector) {
let result = JSON.stringify(jsonata(selector).evaluate(data));
// Compat for custom engines
if (!result && !selector.includes('.') && selector !== 'data' && 'data' in data) {
result = JSON.stringify(jsonata(`data.${selector}`).evaluate(data));
}
if (result.startsWith(`"`)) {
result = result.substring(1, result.length - 1);
}