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

New Base Profile merging feature will overwrite Alt profiles if they also have token authentication #1055

Closed
JillieBeanSim opened this issue Oct 29, 2020 · 0 comments · Fixed by #1056
Labels
bug Something isn't working

Comments

@JillieBeanSim
Copy link
Contributor

JillieBeanSim commented Oct 29, 2020

Describe the bug

Update tokenType & tokenValue command args to keep the order of precedence consistent between service profile and base profile in Zowe Explorer.

Use Cases:
In Zowe Explorer, service profiles generally take precedence over base profiles, However:

  1. If a user has an alternate profile type which has the capability to authenticate with it's server via JWT token and the user has a base profile that may just store host, username, password but not a token. The token will be overwritten to an undefined value.
  2. This will also occur if the base profile has a token for other profile types that may be behind the API ML but this particular profile type (the alt profile) isn't behind the API ML therefore it will pass the incorrect token.

The lines that are causing this are here in the new `Profiles.ts/ getCombinedProfile():

if (baseProfile) {
     // These fields are specific to base profiles & don't exist on the service profile schema
     cmdArgs.tokenType = baseProfile.profile.tokenType;
     cmdArgs.tokenValue = baseProfile.profile.tokenValue;
 }

So I propose to change the 2 lines to this to keep the order of precedence going between service profile and base profile:

cmdArgs.tokenType = serviceProfile.profile.tokenType ? serviceProfile.profile.tokenType: baseProfile.profile.tokenType;
cmdArgs.tokenValue = serviceProfile.profile.tokenValue ? serviceProfile.profile.tokenValue: baseProfile.profile.tokenValue;

Desktop (please complete the following information):

  • OS: Windows 10
  • Zowe Explorer Version: 1.10
  • (Optional) Zowe CLI Version:
  • (Optional) Are you using Secure Credential Store?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant