-
Notifications
You must be signed in to change notification settings - Fork 86
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
VSCode Explorer using mergeArgsForProfile - returns incorrect result when used in conjunction with a zowe.config.user.json file #2316
Comments
Thank you for creating a bug report. |
@davidkjackson54 I assume your I've tried to reproduce both issues with exactly the same config, except I used profile type |
Hi TImothy, I ran through the test again making sure that only the user and password defined in profile in the zowe.config.json have their secure Args stored in the vault.
After mergeArgsForProfile with the empty zowe.config.user.,json file present, I see this:
Then I expand profArgs after the call to mergeArgsForProfile
This does not occur if the empty user config is not present. Are there any additional diagnostics that might help here? |
I have sent you via slack a slimmed down sample program that helps highlight the missingArg issue |
I was able to reproduce the issue with the following files: zowe.config.json
{
"$schema": "./zowe.schema.json",
"profiles": {
"base": {
"type": "base",
"properties": {
"host": "myHost.com",
"rejectUnauthorized": true
},
"secure": [
"user",
"password"
]
},
"zmf_a": {
"type": "zosmf",
"properties": {
"protocol": "http",
"host": "myHost.com",
"port": 8280,
"basePath": "/zmfa",
"rejectUnauthorized": false
},
"secure": [
"user",
"password"
]
}
},
"defaults": {
"zosmf": "zmf_a",
"base": "base"
},
"autoStore": true
} zowe.config.user.json
{
"$schema": "./zowe.schema.json",
"profiles": {},
"defaults": {},
"autoStore": true
} Sample Script
const { ProfileCredentials, ProfileInfo } = require("@zowe/imperative");
(async () => {
// Load connection info from default z/OSMF profile
const requireKeytar = () => require("@zowe/secrets-for-zowe-sdk").keyring;
const profInfo = new ProfileInfo("zowe", {
credMgrOverride: ProfileCredentials.defaultCredMgrWithKeytar(requireKeytar),
});
console.log("returned profInfo ", profInfo);
await profInfo.readProfilesFromDisk();
const zosmfProfNames = profInfo.getAllProfiles("zosmf");
const baseProfNames = profInfo.getAllProfiles("base");
console.log("ZMF profiles ", zosmfProfNames);
console.log("profLoc expands to ", zosmfProfNames[0].profLoc);
console.log("BASE profiles ", baseProfNames);
console.log("profLoc expands to ", baseProfNames[0].profLoc);
for (const element of zosmfProfNames) {
console.log("return from mergeArgsForProfile ", profInfo.mergeArgsForProfile(element, { getSecureVals: true }));
}
})().catch((err) => {
console.error(err);
process.exit(1);
}); |
I have a VSCode Explorer that needs to create a session.
my zowe.config.json contains this
I have user and password both saved in the Credentials vault:
D:\saved source\vault>node vault.js
I initially do this:
Then I retriever my profiles
Then for each profile in the array, I call mergeArgsForProfile
When I inspect profileArgs, it correctly shows knownArgs and no missingArgs
If I now add an empty zowe.config.user.json file:
and test again, I am now seeing profileArgs report user and password as missingArgs.
Either I am misunderstanding how the zowe.config.user.json is used or this is a bug. as both user and password are present in the vault.
As a further test, I then copied the zowe.config.,json into the zowe.config.user.json - so they are now identical and then reran the test again.
Once again, it reports both user and password in missingArgs.
I then changed the defaults in the zowe.config.user.json file to now be:
and reran the test again.
This time, I am seeing no missingArgs but the knownArgs are incorrect and show this:
Notice that now user and password are considered to be knownArgs but the argValues are undefined.
Something isn't quite right here.
The text was updated successfully, but these errors were encountered: