Skip to content
This repository has been archived by the owner on Nov 13, 2023. It is now read-only.

Handle new APIML unique cookie identifier #996

Merged
merged 28 commits into from
Jul 26, 2023
Merged

Handle new APIML unique cookie identifier #996

merged 28 commits into from
Jul 26, 2023

Conversation

zFernand0
Copy link
Member

@zFernand0 zFernand0 commented Jun 26, 2023

What It Does

  • resolves Handle new APIML unique cookie identifier functionality #979
  • added a new add ImperativeExpect.toMatchRegExp method
  • prevented multiple logout operations from failing due to not having a token available
  • allowed autoStore for dynamic APIML token types
  • allowed logout operation to remove token type and/or token value when either is not specified in the config file
    • this cannot be done because it conflicts with the ability to logout a token different than the one stored in the vault
  • added utility method: getProfileNameFromPath to help with nested token authentication
  • added support for multiple token authentication processes in a single config secure command
    • added an entry to the console.log to inform which profile credentials are being prompted for
  • prevented auto-init from performing two login operations on a single command

How to Test

I recommend to combine this PR with the CLI counterpart:

Please see the above PR for testing instructions.

Review Checklist
I certify that I have:

Additional Comments

Opened issues as a result of this PR:

@zFernand0 zFernand0 marked this pull request as draft June 26, 2023 19:23
@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

Patch coverage: 93.85% and project coverage change: +0.03% 🎉

Comparison is base (fdffce0) 89.73% compared to head (96a5c6a) 89.76%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     zowe/imperative#996      +/-   ##
==========================================
+ Coverage   89.73%   89.76%   +0.03%     
==========================================
  Files         211      211              
  Lines       11471    11533      +62     
  Branches     2554     2584      +30     
==========================================
+ Hits        10293    10353      +60     
- Misses       1178     1180       +2     
Files Changed Coverage Δ
packages/rest/src/client/AbstractRestClient.ts 86.71% <77.77%> (-0.92%) ⬇️
...imperative/src/config/cmd/secure/secure.handler.ts 91.07% <82.60%> (-4.93%) ⬇️
...ages/rest/src/session/ConnectionPropsForSessCfg.ts 98.78% <87.50%> (-0.58%) ⬇️
packages/config/src/ConfigAutoStore.ts 100.00% <100.00%> (ø)
packages/config/src/ConfigConstants.ts 100.00% <100.00%> (ø)
packages/config/src/ProfileInfo.ts 97.54% <100.00%> (ø)
packages/config/src/api/ConfigLayers.ts 96.00% <100.00%> (ø)
packages/config/src/api/ConfigProfiles.ts 100.00% <100.00%> (ø)
packages/config/src/api/ConfigSecure.ts 100.00% <100.00%> (ø)
packages/expect/src/ImperativeExpect.ts 97.59% <100.00%> (+0.09%) ⬆️
... and 3 more

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

@zFernand0 zFernand0 changed the title Fix 979 Handle new APIML unique cookie identifier Jun 26, 2023
@zFernand0 zFernand0 marked this pull request as ready for review June 30, 2023 11:48
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
… and viceversa

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
…le config-secure call

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
…ady have a token

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
@zFernand0 zFernand0 requested a review from awharn July 5, 2023 13:08
CHANGELOG.md Outdated Show resolved Hide resolved
packages/config/src/api/ConfigProfiles.ts Show resolved Hide resolved
packages/config/src/ConfigAutoStore.ts Outdated Show resolved Hide resolved
@zFernand0 zFernand0 requested a review from t1m0thyj July 5, 2023 18:48
Copy link
Member

@gejohnston gejohnston left a comment

Choose a reason for hiding this comment

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

I made a request related to the text used in our prompts. However, I will accept whatever judgement call you make. Thus, I am approving this PR.

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
packages/config/src/ConfigAutoStore.ts Outdated Show resolved Hide resolved
Comment on lines +199 to +208
// Force the use of token value, in case user and/or password are also provided.
if (params.arguments.tokenValue != null &&
(params.arguments.user != null || params.arguments.password != null)) {
params.arguments.user = undefined;
params.arguments.password = undefined;
}

params.arguments.tokenType = this.mDefaultTokenType;
if (params.arguments.tokenType == null) {
params.arguments.tokenType = this.mDefaultTokenType;
}
Copy link
Member

Choose a reason for hiding this comment

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

Should we handle removing certificates from the session as well? I guess this may not be a concern, if tokens have a higher priority than certificates when both are present 😅

packages/imperative/src/config/cmd/init/init.handler.ts Outdated Show resolved Hide resolved
@zFernand0 zFernand0 marked this pull request as draft July 10, 2023 20:02
@zFernand0
Copy link
Member Author

will test with ZE before moving it to ready for review again 😋

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
…lient

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
@zFernand0 zFernand0 marked this pull request as ready for review July 17, 2023 15:54
@zFernand0 zFernand0 requested a review from t1m0thyj July 17, 2023 15:54
…n as possible

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
…we had the token already

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Copy link
Member

@traeok traeok left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @zFernand0 !

Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com>
@sonarcloud
Copy link

sonarcloud bot commented Jul 25, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

89.0% 89.0% Coverage
0.0% 0.0% Duplication

@zFernand0 zFernand0 merged commit 4f8ca32 into master Jul 26, 2023
20 checks passed
@zFernand0 zFernand0 deleted the fix-979 branch July 26, 2023 09:27
@zFernand0 zFernand0 added the release-minor Indicates a minor feature has been added label Jul 26, 2023
@github-actions
Copy link

Release succeeded for the master branch. 🎉

The following packages have been published:

  • npm: @zowe/imperative@5.16.0

Powered by Octorelease 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-minor Indicates a minor feature has been added released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle new APIML unique cookie identifier functionality
7 participants