feat(ProfileInfo): JWT token expiration detection #2298
+219
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What It Does
Fernando mentioned that extenders would benefit from having access to the JWT token expiration feature from Zowe Explorer, so I figured it made the most sense to put it the logic for it in
ProfileInfo
. That way, anyone using Imperative to access/manage profiles can leverage this functionality.How to Test
Once merged, this can be tested in action after this PR is updated: zowe/zowe-explorer-vscode#3174
Here's a manual test to show the behavior of the function itself:
npm run build && npm pack
from thepackages/imperative
folderzowe-imperative-8.1.0.tgz
file from this folder and place it into a new folder outside of the repocd
to the empty folder and runzowe config init --no-prompt && npm init -y && npm install zowe-imperative-8.1.0.tgz @zowe/secrets-for-zowe-sdk
(you don't need secrets SDK, but its easier than getting around cred manager setup in ProfileInfo)zowe.config.json
:script.mjs
within this test folder and run it usingnode script.mjs
The script should output
token expired: true
.Review Checklist
I certify that I have:
Additional Comments