zowe config secure - prune option . Is there an API to accomplish this in VSCode Extensions? #1747
-
Zowe cli provides the ability to prune obsolete properties from the vault Does this capability exist for the VSCode extension user via some api? I haven't found any documentation for this. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Thank you for creating a bug report. |
Beta Was this translation helpful? Give feedback.
-
@davidkjackson54 The "ConfigSecure.rmUnusedProps" API method can be used for this. It is documented in Node.js SDK docs. This API will only update the credentials object in memory, so you may also want to call the "directSave" method afterwards to update the secure credentials stored in the vault. See here for an example of how Zowe CLI does it: https://github.com/zowe/imperative/blob/master/packages/imperative/src/config/cmd/secure/secure.handler.ts#L42-L48 |
Beta Was this translation helpful? Give feedback.
-
Hi @t1m0thyj Is there any possibility that you can make directSave public - it then becomes supported in the future. - rather than an undocumented method.. |
Beta Was this translation helpful? Give feedback.
@davidkjackson54
ImperativeConfig.instance.config
is only defined in the context of Zowe CLI command handlers. In a VS Code extension where you're using the ProfileInfo API, the way to access the config would beprofInfo.getTeamConfig()
(whereprofInfo
is an instance of the ProfileInfo class).The
directSave
API we probably should have made public rather than internal. For now, you could work around this by calling(config.api.secure as any).directSave
.