Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for ltpa token #219

Merged
merged 17 commits into from
Feb 26, 2025
Merged

Added support for ltpa token #219

merged 17 commits into from
Feb 26, 2025

Conversation

enamkhan
Copy link
Contributor

@enamkhan enamkhan commented Jan 29, 2025

This pr is a work in progress to add support for a using the ltpa token.

#217

How to Test

Review Checklist
I certify that I have:

Additional Comments

@enamkhan
Copy link
Contributor Author

@davenice I'm just going to refactor now and remove the profile config.

@codecov-commenter
Copy link

codecov-commenter commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 35.74661% with 142 lines in your changes missing coverage. Please review.

Project coverage is 40.69%. Comparing base (aec10bb) to head (b970eff).

Files with missing lines Patch % Lines
packages/vsce/src/trees/CICSTree.ts 22.22% 28 Missing ⚠️
packages/vsce/src/utils/profileManagement.ts 22.22% 21 Missing ⚠️
packages/vsce/src/utils/profileUtils.ts 36.84% 12 Missing ⚠️
packages/vsce/src/utils/resourceUtils.ts 64.28% 10 Missing ⚠️
...ackages/vsce/src/commands/closeLocalFileCommand.ts 0.00% 4 Missing ⚠️
packages/vsce/src/commands/showParameterCommand.ts 0.00% 4 Missing ⚠️
...ommands/disableCommands/disableLocalFileCommand.ts 0.00% 3 Missing ⚠️
.../commands/disableCommands/disableProgramCommand.ts 0.00% 3 Missing ⚠️
...mands/disableCommands/disableTransactionCommand.ts 0.00% 3 Missing ⚠️
.../commands/enableCommands/enableLocalFileCommand.ts 0.00% 3 Missing ⚠️
... and 25 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #219      +/-   ##
==========================================
+ Coverage   40.13%   40.69%   +0.55%     
==========================================
  Files         149      151       +2     
  Lines        5080     5072       -8     
  Branches      893      876      -17     
==========================================
+ Hits         2039     2064      +25     
+ Misses       3041     3008      -33     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@enamkhan enamkhan force-pushed the khane-use-ltpa-token branch from f88f1d5 to fd79504 Compare February 3, 2025 15:24
@enamkhan enamkhan force-pushed the khane-use-ltpa-token branch from 7c4bd64 to 1cd8078 Compare February 4, 2025 13:22
Copy link
Contributor

@AndrewTwydell AndrewTwydell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a lot of the resource trees (CICSProgramTree), we're not using the new getters to get the session - might be nice if possible?

Might be nice to be able to do this.getSession() here like the combination trees.

const programResponse = await getResource(this.parentRegion.parentSession.session, {

@JTonda JTonda requested a review from zFernand0 February 6, 2025 16:05
Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 😋

Haven't had a chance to test this, but the changes make sense to me! 😋

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels like we have to make the same/similar changes across all/most CICSCombinedTrees.
Wondering if there is some consolidation that can be done (in a future PR) to create a BaseCombinedTree class that the others extend 😋

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This refactor is actually in progress in this PR. Because all the resource and combined resource trees are practically identical, we can use common tree classes for them all :D

this.session = new imperative.Session({
type: "basic",
type: SessConstants.AUTH_TYPE_TOKEN,
storeCookie: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I mentioned that perhaps we could move some of the LTPA token support to the CLI.
However, it makes sense the way this is being done here since (as you mentioned on the last standup) this is all handled by Imperative.

Curious if the CICs plug-in could make use the the LTPA token when the CLI is in Daemon mode. 😋
No need to worry about testing this, since people haven't asked for this feature yet 😋

@enamkhan enamkhan force-pushed the khane-use-ltpa-token branch from 50424cb to e132aca Compare February 11, 2025 11:30
@enamkhan enamkhan force-pushed the khane-use-ltpa-token branch 2 times, most recently from 22fb9a1 to a602446 Compare February 14, 2025 13:57
@enamkhan enamkhan force-pushed the khane-use-ltpa-token branch from a5251ac to e4447ab Compare February 14, 2025 15:58
@enamkhan enamkhan marked this pull request as ready for review February 14, 2025 16:16
Signed-off-by: enam-khan <[email protected]>
Signed-off-by: enam-khan <[email protected]>
Copy link
Contributor

@AndrewTwydell AndrewTwydell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few changes, will also test functionality locally

Signed-off-by: enam-khan <[email protected]>
Copy link
Contributor

@AndrewTwydell AndrewTwydell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple things to tweak - and I need a longer, more thorough, look at CICSTree. There's another while loop in there which I'm keen to avoid but not absolutely necessary. Will test locally and we can go over it tomorrow.

Copy link
Contributor

@AndrewTwydell AndrewTwydell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wahoo! LGTM - tested thoroughly locally and seems all good. Nice to be able to use tokens and not rely on basic auth for every request! 👍🏼

@zFernand0 zFernand0 self-requested a review February 25, 2025 16:08
Copy link
Contributor

@davenice davenice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! I know you and Andrew have tested it pretty hard.

Let's pause and check whether @zFernand0 wants to give another review.

(BTW interesting point from @zFernand0 about the CLI in daemon mode. I've not tried that out. It's certainly a potential use case for making use of tokens in the future.)

Copy link
Member

@zFernand0 zFernand0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 😋

This is really cool! 🎉
One step closer to APIML integration 😋

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like the way this was refactored. Very clever! 🧠

@AndrewTwydell AndrewTwydell merged commit 44d8f8b into main Feb 26, 2025
19 checks passed
@AndrewTwydell AndrewTwydell deleted the khane-use-ltpa-token branch February 26, 2025 20:39
@AndrewTwydell AndrewTwydell added the release-minor Indicates a minor feature has been added label Feb 26, 2025
Copy link

Release succeeded for the main branch. 🎉

The following packages have been published:

Powered by Octorelease 🚀

davenice pushed a commit that referenced this pull request Mar 11, 2025
* Added support for the ltpa token

Signed-off-by: enam-khan <[email protected]>

* Removed unused import and variable in test

Signed-off-by: enam-khan <[email protected]>

* Some cleanup

Signed-off-by: enam-khan <[email protected]>

* Updated changelogs

Signed-off-by: enam-khan <[email protected]>

* Update packages/vsce/CHANGELOG.md

Co-authored-by: Andrew <[email protected]>
Signed-off-by: EKhan <[email protected]>

* Update packages/sdk/CHANGELOG.md

Co-authored-by: Andrew <[email protected]>
Signed-off-by: EKhan <[email protected]>

* Update packages/sdk/src/constants/CicsCmci.constants.ts

Co-authored-by: Andrew <[email protected]>
Signed-off-by: EKhan <[email protected]>

* Update packages/vsce/src/commands/disableCommands/disableTransactionCommand.ts

Co-authored-by: Andrew <[email protected]>
Signed-off-by: EKhan <[email protected]>

* Update packages/vsce/src/commands/openLocalFileCommand.ts

Co-authored-by: Andrew <[email protected]>
Signed-off-by: EKhan <[email protected]>

* set tree to unauthorized on error

Signed-off-by: Andrew Twydell <[email protected]>

---------

Signed-off-by: enam-khan <[email protected]>
Signed-off-by: EKhan <[email protected]>
Signed-off-by: Andrew Twydell <[email protected]>
Co-authored-by: Andrew <[email protected]>
Co-authored-by: Andrew Twydell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-minor Indicates a minor feature has been added released
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

5 participants