mirror of
https://github.com/hashicorp/vault-action.git
synced 2025-11-07 15:16:56 +00:00
chore(deps): bump jsonata from 1.8.6 to 2.0.2 (#426)
* chore(deps): bump jsonata from 1.8.6 to 2.0.2 Bumps [jsonata](https://github.com/jsonata-js/jsonata) from 1.8.6 to 2.0.2. - [Release notes](https://github.com/jsonata-js/jsonata/releases) - [Changelog](https://github.com/jsonata-js/jsonata/blob/master/CHANGELOG.md) - [Commits](https://github.com/jsonata-js/jsonata/compare/v1.8.6...v2.0.2) --- updated-dependencies: - dependency-name: jsonata dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * * waiting for result of evaluate to account for jsonata v2 changes --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: maxcoulombe <max.coulombe@hashicorp.com>
This commit is contained in:
parent
76780d43f5
commit
74bc2a617b
3 changed files with 12 additions and 12 deletions
14
package-lock.json
generated
14
package-lock.json
generated
|
|
@ -10,7 +10,7 @@
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"got": "^11.8.5",
|
"got": "^11.8.5",
|
||||||
"jsonata": "^1.8.6",
|
"jsonata": "^2.0.2",
|
||||||
"jsrsasign": "^10.6.1"
|
"jsrsasign": "^10.6.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
@ -3119,9 +3119,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/jsonata": {
|
"node_modules/jsonata": {
|
||||||
"version": "1.8.6",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/jsonata/-/jsonata-1.8.6.tgz",
|
"resolved": "https://registry.npmjs.org/jsonata/-/jsonata-2.0.2.tgz",
|
||||||
"integrity": "sha512-ZH2TPYdNP2JecOl/HvrH47Xc+9imibEMQ4YqKy/F/FrM+2a6vfbGxeCX23dB9Fr6uvGwv+ghf1KxWB3iZk09wA==",
|
"integrity": "sha512-CpwbpFNjuuukU+tIR6Qw+fhwQQ5iZGbB/Md8CVaU7/b/SI1RlQQVgf4rIEjoiG9/jDB7C45nKKwHXWKHQxvb7w==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
|
|
@ -6694,9 +6694,9 @@
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"jsonata": {
|
"jsonata": {
|
||||||
"version": "1.8.6",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/jsonata/-/jsonata-1.8.6.tgz",
|
"resolved": "https://registry.npmjs.org/jsonata/-/jsonata-2.0.2.tgz",
|
||||||
"integrity": "sha512-ZH2TPYdNP2JecOl/HvrH47Xc+9imibEMQ4YqKy/F/FrM+2a6vfbGxeCX23dB9Fr6uvGwv+ghf1KxWB3iZk09wA=="
|
"integrity": "sha512-CpwbpFNjuuukU+tIR6Qw+fhwQQ5iZGbB/Md8CVaU7/b/SI1RlQQVgf4rIEjoiG9/jDB7C45nKKwHXWKHQxvb7w=="
|
||||||
},
|
},
|
||||||
"jsrsasign": {
|
"jsrsasign": {
|
||||||
"version": "10.6.1",
|
"version": "10.6.1",
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
"homepage": "https://github.com/hashicorp/vault-action#readme",
|
"homepage": "https://github.com/hashicorp/vault-action#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"got": "^11.8.5",
|
"got": "^11.8.5",
|
||||||
"jsonata": "^1.8.6",
|
"jsonata": "^2.0.2",
|
||||||
"jsrsasign": "^10.6.1"
|
"jsrsasign": "^10.6.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ async function getSecrets(secretRequests, client) {
|
||||||
selector = "data." + selector
|
selector = "data." + selector
|
||||||
}
|
}
|
||||||
|
|
||||||
const value = selectData(body, selector);
|
const value = await selectData(body, selector);
|
||||||
results.push({
|
results.push({
|
||||||
request: secretRequest,
|
request: secretRequest,
|
||||||
value,
|
value,
|
||||||
|
|
@ -70,12 +70,12 @@ async function getSecrets(secretRequests, client) {
|
||||||
* @param {object} data
|
* @param {object} data
|
||||||
* @param {string} selector
|
* @param {string} selector
|
||||||
*/
|
*/
|
||||||
function selectData(data, selector) {
|
async function selectData(data, selector) {
|
||||||
const ata = jsonata(selector);
|
const ata = jsonata(selector);
|
||||||
let result = JSON.stringify(ata.evaluate(data));
|
let result = JSON.stringify(await ata.evaluate(data));
|
||||||
// Compat for custom engines
|
// Compat for custom engines
|
||||||
if (!result && ((ata.ast().type === "path" && ata.ast()['steps'].length === 1) || ata.ast().type === "string") && selector !== 'data' && 'data' in data) {
|
if (!result && ((ata.ast().type === "path" && ata.ast()['steps'].length === 1) || ata.ast().type === "string") && selector !== 'data' && 'data' in data) {
|
||||||
result = JSON.stringify(jsonata(`data.${selector}`).evaluate(data));
|
result = JSON.stringify(await jsonata(`data.${selector}`).evaluate(data));
|
||||||
} else if (!result) {
|
} else if (!result) {
|
||||||
throw Error(`Unable to retrieve result for ${selector}. No match data was found. Double check your Key or Selector.`);
|
throw Error(`Unable to retrieve result for ${selector}. No match data was found. Double check your Key or Selector.`);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue