Fix logout to give base profile precedence over parent profile#3076
Conversation
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## next #3076 +/- ##
==========================================
+ Coverage 92.57% 92.59% +0.02%
==========================================
Files 113 113
Lines 11638 11660 +22
Branches 2570 2488 -82
==========================================
+ Hits 10774 10797 +23
+ Misses 862 861 -1
Partials 2 2 ☔ View full report in Codecov by Sentry. |
zFernand0
left a comment
There was a problem hiding this comment.
Changes makes sense to me 😋
I left a comment, however this is all theoretical, so it might be nice to discuss offline (or during standup)
Signed-off-by: Trae Yelovich <trae.yelovich@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
…nto fix/multi-apiml-logout Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Initial concerned was discussed and addressed in 4f24050
…nto fix/multi-apiml-logout Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
…nto fix/multi-apiml-logout Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
…ined in the IProfile Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
|
📅 Suggested merge-by date: 9/30/2024 |
zFernand0
left a comment
There was a problem hiding this comment.
LGTM! 😋
Not sure if I should be approving as this is something that I was very closely watching (and at times "fixing" tests for)
| // Note: It should be expected that nested profiles within this service profile will have their credentials updated. | ||
| const profIndex = cache.allProfiles.findIndex((profile) => profile.name === opts.serviceProfile.name); | ||
| cache.allProfiles[profIndex] = opts.serviceProfile; | ||
| cache.allProfiles[profIndex] = { ...cache.allProfiles[profIndex], profile: opts.serviceProfile.profile }; |
There was a problem hiding this comment.
Thanks for fixing.
This seems to keep the name and type of serviceProfile in the cache, while updating the contents of the profiles (say with tokenType and tokenValue).
| // it("should prefer base profile when it exists and it has tokenValue in secure array", async () => {}); | ||
| // it("should prefer base profile when it exists, it does not have tokenValue in its secure array, and service profile is flat", async () => {}); | ||
| // it("should prefer parent profile when base profile does not exist and service profile is nested", () => {}); | ||
| // it("should cancel the operation if the base profile does not exist and service profile is flat", () => {}); |
There was a problem hiding this comment.
Thanks for adding this set of "e2e" tests 🙏🏽
There was a problem hiding this comment.
Seems like the workaround above was not being used after the merge from next?
either way, thanks for cleaning it up 🙏🏽
| * If there is no API registered for the profile type, this method defaults the login behavior to that of the APIML. | ||
| * @param {BaseProfileAuthOptions} opts Object defining options for base profile authentication | ||
| */ | ||
| public static async ssoLogin(opts: BaseProfileAuthOptions): Promise<boolean> { |
There was a problem hiding this comment.
I completely missed that this would've been a breaking change to extenders.
Great catch! 🙏🏽
Thanks for deprecating the old login/-out function in favor of the new ssoLogin/-out 🥳
traeok
left a comment
There was a problem hiding this comment.
Changes LGTM, thanks @t1m0thyj and @zFernand0 😋
Signed-off-by: Timothy Johnson <timothy.johnson@broadcom.com>
|


Proposed changes
Follow up to #3019 - fixes behavior of logout action when token is defined in both base profile and parent profile.
TODO:
Release Notes
Milestone: V3
Changelog: TBD
Types of changes
Checklist
General
yarn workspace vscode-extension-for-zowe vscode:prepublishpnpm --filter vscode-extension-for-zowe vscode:prepublishCode coverage
Deployment
Further comments