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

ProfileInfo API may create extraneous base profile when updating credentials #2275

Open
t1m0thyj opened this issue Sep 26, 2024 · 1 comment
Labels
bug Something isn't working priority-medium Not functioning - next quarter if capacity permits severity-low Bug that makes the usage of the Zowe less convenient but doesn't impact key use cases

Comments

@t1m0thyj
Copy link
Member

Actual Behavior
When ProfileInfo.updateProperty is used to update user & password in a nested profile inside Project Config, an unexpected base profile may be created.

Expected Behavior
The ProfileInfo API should not create a new profile when asked to update properties inside an existing profile.

Steps to Reproduce

  1. Create a Global Config with flat structure that includes base profile (e.g. result of zowe config init)
  2. Create a Project Config with nested zosmf profile (e.g. lpar1.zosmf) and w/o base profile
  3. Use the ProfileInfo API to update user & password in the nested zosmf profile:
    const { ProfileInfo } = require("@zowe/imperative");
    (async () => {
        const profInfo = new ProfileInfo("zowe");
        await profInfo.readProfilesFromDisk();
        const upd = { profileName: "lpar1.zosmf", profileType: "zosmf" };
        await profInfo.updateProperty({ ...upd, property: "user", value: "abc", setSecure: true });
        await profInfo.updateProperty({ ...upd, property: "password", value: "def", setSecure: true });
    })();
  4. Notice that a new base profile gets created in Project Config which contains only a user property:
    "base": {
      "properties": {},
      "secure": [
        "user"
      ]
    }
@t1m0thyj t1m0thyj added bug Something isn't working new The issue wasn't triaged yet labels Sep 26, 2024
Copy link

Thank you for creating a bug report.
We will investigate the bug and evaluate its impact on the product.
If you haven't already, please ensure you have provided steps to reproduce the bug and as much context as possible.

@JTonda JTonda added priority-medium Not functioning - next quarter if capacity permits severity-low Bug that makes the usage of the Zowe less convenient but doesn't impact key use cases and removed new The issue wasn't triaged yet labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-medium Not functioning - next quarter if capacity permits severity-low Bug that makes the usage of the Zowe less convenient but doesn't impact key use cases
Projects
Status: Medium Priority
Development

No branches or pull requests

2 participants