Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AbstractCredentialManager

The abstract credential manager defines basic methods that must be implemented by any credential manager provided to Imperative. The abstract class is used by various methods for proper typing information.

All credential managers will be instantiated by CredentialManagerFactory.initialize and are expected to extend the AbstractCredentialManager. This is enforced by requiring your class constructor to follow the implementation rules specified by the ICredentialManagerConstructor.

The constructor signature that the ICredentialManagerConstructor specifies will always be identical to the constructor signature of the AbstractCredentialManager superclass.

Imperative will provide your CLI with a default manager, DefaultCredentialManager. If the default provided is not to your liking, you can provide your own manager as a parameter on Imperative.init at startup. This is done by providing it as part of the IImperativeConfig.overrides object.

see

{@link IImperativeOverrides.CredentialManager}

Hierarchy

Index

Constructors

Protected constructor

Properties

Private displayName

displayName: string

The display name of this manager. Used in messaging/logging.

Protected Readonly service

service: string

The service that the Credential Manager is running under. Imperative will set this to the cliName

Accessors

name

  • get name(): string

Methods

delete

  • delete(account: string): Promise<void>

Protected Abstract deleteCredentials

  • deleteCredentials(account: string): Promise<void>

Optional initialize

  • This is an optional method that your Credential Manager may choose to implement. If present, it will be called by the CredentialManagerFactory.initialize function to allow your manager to do more initialization after the class has become instantiated.

    Also, since asynchronous operations are not well handled in the constructor, this allows your Credential Manager to perform any asynchronous operations needed. Your initialize method just has to return the promise and we'll handle the rest.

    Returns Promise<void>

    A promise of the completion of your initialize function.

load

  • load(account: string, optional?: boolean): Promise<string>

Protected Abstract loadCredentials

save

  • save(account: string, secureValue: string): Promise<void>

Protected Abstract saveCredentials

Generated using TypeDoc