Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CredentialManagerOverride

This class provides access to the known set of credential manager overrides and functions to manipulate which credential manager is in use. Other credential managers can replace the default credential manager. Both CLI plugins and Zowe Explorer extensions can override the default credential manager. However, only one credential manager will be in effect on a given computer. The last component to override the credential manager wins.

Hierarchy

  • CredentialManagerOverride

Index

Properties

Static Readonly CRED_MGR_SETTING_NAME

CRED_MGR_SETTING_NAME: string = "CredentialManager"

Static Readonly DEFAULT_CRED_MGR_NAME

DEFAULT_CRED_MGR_NAME: string = "@zowe/cli"

Static Private Readonly KNOWN_CRED_MGRS

KNOWN_CRED_MGRS: ICredentialManagerNameMap[] = [{"credMgrDisplayName": this.DEFAULT_CRED_MGR_NAME},{"credMgrDisplayName": "Secrets for Kubernetes","credMgrPluginName": "@zowe/secrets-for-kubernetes-for-zowe-cli","credMgrZEName": "Zowe.secrets-for-kubernetes"}]

Methods

Static getCredMgrInfoByDisplayName

Static getCredMgrInfoByPlugin

Static getCredMgrInfoByZEExt

Static getKnownCredMgrs

Static Private getSettingsFileJson

  • getSettingsFileJson(): { fileName: string; json: ISettingsFile }
  • Get the contents of the $ZOWE_CLI_HOME/settings/imperative.json file. The resulting JSON is guaranteed to contain the key 'overrides.CredentialManager'.

    throws

    An ImperativeError if the file does not exist or have the key.

    Returns { fileName: string; json: ISettingsFile }

    A 'settings' object with the properties: fileName and json. The json object contains the contents of the settings file.

Static recordCredMgrInConfig

  • recordCredMgrInConfig(newCredMgrName: string): void
  • Record the specified credential manager in the configuration of overrides. A plugin or ZE extension that provides a credential manager would record its credential manager name upon installation.

    throws

    An ImperativeError upon error.

    Parameters

    • newCredMgrName: string
         The display name of your credential manager.
      

    Returns void

Static recordDefaultCredMgrInConfig

  • recordDefaultCredMgrInConfig(credMgrToReplace: string): void
  • Record the default Zowe CLI credential manager in the configuration of overrides. The specified credential manager will be replaced with the default Zowe CLI credential manager. A plugin or ZE extension that provides a credential manager would replace itself with the default credential manager when it is being uninstalled.

    throws

    An ImperativeError upon error.

    Parameters

    • credMgrToReplace: string
         The display name of your credential manager. This name must also
         be the credential manager currently recorded in the configuration
         of overrides. Otherwise, no replacement will be performed.
         Specifying your own name is intended to prevent a plugin from
         inadvertently replacing another plugin's credential manager.
      

    Returns void

Generated using TypeDoc