Skip to content

Commit

Permalink
Merge pull request #248 from drubin/jsonpath
Browse files Browse the repository at this point in the history
Switch from jsonpath to jsonpath-plus
  • Loading branch information
k8s-ci-robot authored May 24, 2019
2 parents e5ec945 + 0b03c8f commit c0a5ca0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 216 deletions.
226 changes: 15 additions & 211 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"byline": "^5.0.0",
"isomorphic-ws": "^4.0.1",
"js-yaml": "^3.12.0",
"jsonpath": "^1.0.1",
"jsonpath-plus": "^0.19.0",
"request": "^2.88.0",
"shelljs": "^0.8.2",
"tslib": "^1.9.3",
Expand Down
7 changes: 3 additions & 4 deletions src/cloud_auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// workaround for issue https://github.com/dchester/jsonpath/issues/96
import jsonpath = require('jsonpath/jsonpath.min');
import * as jsonpath from 'jsonpath-plus';
import * as shelljs from 'shelljs';

import { Authenticator } from './auth';
Expand Down Expand Up @@ -81,7 +80,7 @@ export class CloudAuth implements Authenticator {
const tokenPathKey = '$' + tokenPathKeyInConfig.slice(1, -1);
const expiryPathKey = '$' + expiryPathKeyInConfig.slice(1, -1);

config['access-token'] = jsonpath.query(resultObj, tokenPathKey);
config.expiry = jsonpath.query(resultObj, expiryPathKey);
config['access-token'] = jsonpath.JSONPath(tokenPathKey, resultObj);
config.expiry = jsonpath.JSONPath(expiryPathKey, resultObj);
}
}

0 comments on commit c0a5ca0

Please sign in to comment.