5
0
Fork 0
mirror of https://github.com/hashicorp/vault-action.git synced 2025-11-07 07:06: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:
dependabot[bot] 2023-02-28 08:29:18 -05:00 committed by GitHub
parent 76780d43f5
commit 74bc2a617b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 12 deletions

14
package-lock.json generated
View file

@ -10,7 +10,7 @@
"license": "MIT",
"dependencies": {
"got": "^11.8.5",
"jsonata": "^1.8.6",
"jsonata": "^2.0.2",
"jsrsasign": "^10.6.1"
},
"devDependencies": {
@ -3119,9 +3119,9 @@
}
},
"node_modules/jsonata": {
"version": "1.8.6",
"resolved": "https://registry.npmjs.org/jsonata/-/jsonata-1.8.6.tgz",
"integrity": "sha512-ZH2TPYdNP2JecOl/HvrH47Xc+9imibEMQ4YqKy/F/FrM+2a6vfbGxeCX23dB9Fr6uvGwv+ghf1KxWB3iZk09wA==",
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/jsonata/-/jsonata-2.0.2.tgz",
"integrity": "sha512-CpwbpFNjuuukU+tIR6Qw+fhwQQ5iZGbB/Md8CVaU7/b/SI1RlQQVgf4rIEjoiG9/jDB7C45nKKwHXWKHQxvb7w==",
"engines": {
"node": ">= 8"
}
@ -6694,9 +6694,9 @@
"dev": true
},
"jsonata": {
"version": "1.8.6",
"resolved": "https://registry.npmjs.org/jsonata/-/jsonata-1.8.6.tgz",
"integrity": "sha512-ZH2TPYdNP2JecOl/HvrH47Xc+9imibEMQ4YqKy/F/FrM+2a6vfbGxeCX23dB9Fr6uvGwv+ghf1KxWB3iZk09wA=="
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/jsonata/-/jsonata-2.0.2.tgz",
"integrity": "sha512-CpwbpFNjuuukU+tIR6Qw+fhwQQ5iZGbB/Md8CVaU7/b/SI1RlQQVgf4rIEjoiG9/jDB7C45nKKwHXWKHQxvb7w=="
},
"jsrsasign": {
"version": "10.6.1",

View file

@ -35,7 +35,7 @@
"homepage": "https://github.com/hashicorp/vault-action#readme",
"dependencies": {
"got": "^11.8.5",
"jsonata": "^1.8.6",
"jsonata": "^2.0.2",
"jsrsasign": "^10.6.1"
},
"peerDependencies": {

View file

@ -55,7 +55,7 @@ async function getSecrets(secretRequests, client) {
selector = "data." + selector
}
const value = selectData(body, selector);
const value = await selectData(body, selector);
results.push({
request: secretRequest,
value,
@ -70,12 +70,12 @@ async function getSecrets(secretRequests, client) {
* @param {object} data
* @param {string} selector
*/
function selectData(data, selector) {
async function selectData(data, selector) {
const ata = jsonata(selector);
let result = JSON.stringify(ata.evaluate(data));
let result = JSON.stringify(await ata.evaluate(data));
// Compat for custom engines
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) {
throw Error(`Unable to retrieve result for ${selector}. No match data was found. Double check your Key or Selector.`);
}