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

- CRED_MGR_SETTING_NAME
- DEFAULT_CRED_MGR_NAME
- KNOWN_CRED_MGRS

### Methods

- getCredMgrInfoByDisplayName
- getCredMgrInfoByPlugin
- getCredMgrInfoByZEExt
- getCredentialManagerOptions
- getCurrentCredMgr
- getKnownCredMgrs
- getSettingsFileJson
- persistSettings
- recordCredMgrInConfig
- recordDefaultCredMgrInConfig
- syncCachedSettings
- updateCredentialManagerOptions

## Properties

### Static Readonly CRED_MGR_SETTING_NAME

CRED_MGR_SETTING_NAME: string = "CredentialManager"

- Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:34

### Static Readonly DEFAULT_CRED_MGR_NAME

DEFAULT_CRED_MGR_NAME: string = "@zowe/cli"

- Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:35

### 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"},{"credMgrDisplayName": false},]

- Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:37

## Methods

### Static getCredMgrInfoByDisplayName

- getCredMgrInfoByDisplayName(credMgrDisplayName: string | false): ICredentialManagerNameMap | null

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:61

  Get the credential manager information for the specified credential manager display name.

  #### Parameters

  - ##### credMgrDisplayName: string | false

    display name of the credential manager

  #### Returns ICredentialManagerNameMap | null

  An ICredentialManagerNameMap or null if the specified plugin is not a known credential manager.

### Static getCredMgrInfoByPlugin

- getCredMgrInfoByPlugin(pluginName: string): ICredentialManagerNameMap | null

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:74

  Get the credential manager information for the specified plugin.

  #### Parameters

  - ##### pluginName: string

    Name of the plugin package

  #### Returns ICredentialManagerNameMap | null

  An ICredentialManagerNameMap or null if the specified plugin is not a known credential manager.

### Static getCredMgrInfoByZEExt

- getCredMgrInfoByZEExt(ZEExtName: string): ICredentialManagerNameMap | null

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:87

  Get the credential manager information for the specified plugin.

  #### Parameters

  - ##### ZEExtName: string

    Name of the Zowe Explorer extension

  #### Returns ICredentialManagerNameMap | null

  An ICredentialManagerNameMap or null if the specified extension is not a known credential manager.

### Static getCredentialManagerOptions

- getCredentialManagerOptions(): ICredentialManagerOptions

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:236

  Retrieve credential manager options stored in the settings file.

  #### Returns ICredentialManagerOptions

  Credential manager options or an empty object when none are configured.

### Static getCurrentCredMgr

- getCurrentCredMgr(): string | false

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:107

  Get the active credential manager.

  #### Returns string | false

  Information about the current redential managers or false if none is set.

### Static getKnownCredMgrs

- getKnownCredMgrs(): ICredentialManagerNameMap[]

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:97

  Get the known credential managers.

  #### Returns ICredentialManagerNameMap[]

  An array of credential managers.

### Static Private getSettingsFileJson

- getSettingsFileJson(): { fileName: string; json: ISettingsFile }

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:280

  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.

  - ##### fileName: string

  - ##### json: ISettingsFile

### Static Private persistSettings

- persistSettings(settings: { fileName: string; json: ISettingsFile }): void

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:245

  #### Parameters

  - ##### settings: { fileName: string; json: ISettingsFile }

    - ##### fileName: string

    - ##### json: ISettingsFile

  #### Returns void

### Static recordCredMgrInConfig

- recordCredMgrInConfig(newCredMgrName: string | false, options?: ICredentialManagerOptions): void

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:126

  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 | false

           The display name of your credential manager.

  - ##### Optional options: ICredentialManagerOptions

  #### Returns void

### Static recordDefaultCredMgrInConfig

- recordDefaultCredMgrInConfig(credMgrToReplace: string | false): void

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:176

  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 | false

           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

### Static Private syncCachedSettings

- syncCachedSettings(updatedSettings: ISettingsFile): void

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:258

  #### Parameters

  - ##### updatedSettings: ISettingsFile

  #### Returns void

### Static updateCredentialManagerOptions

- updateCredentialManagerOptions(options?: ICredentialManagerOptions): void

- - Defined in @zowe/imperative/src/security/src/CredentialManagerOverride.ts:215

  Update the credential manager options stored in the settings file.

  throws

    An ImperativeError upon error.

  #### Parameters

  - ##### Optional options: ICredentialManagerOptions

    Options to persist for the active credential manager.

  #### Returns void

Generated using TypeDoc