Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KeychainAccess

Hierarchy

  • KeychainAccess

Implements

Index

Constructors

constructor

  • Abstract prototype for general cross platform keychain interaction.

    Parameters

    • osImpl: OsImpl

      The platform impl for (linux, darwin, windows).

    • fsIfc: FsIfc

      The file system interface.

    Returns KeychainAccess

Methods

getPassword

  • getPassword(opts: ProgramOpts, fn: function, retryCount?: number): Promise<void>
  • Returns a password using the native program for credential management.

    Parameters

    • opts: ProgramOpts

      Options for the credential lookup.

    • fn: function

      Callback function (err, password).

        • (error: Nullable<Error>, password?: undefined | string): void
        • Parameters

          • error: Nullable<Error>
          • Optional password: undefined | string

          Returns void

    • Default value retryCount: number = 0

      Used internally to track the number of retries for getting a password out of the keychain.

    Returns Promise<void>

setPassword

  • setPassword(opts: ProgramOpts, fn: function): Promise<void>
  • Sets a password using the native program for credential management.

    Parameters

    • opts: ProgramOpts

      Options for the credential lookup.

    • fn: function

      Callback function (err, password).

        • (error: Nullable<Error>, password?: undefined | string): void
        • Parameters

          • error: Nullable<Error>
          • Optional password: undefined | string

          Returns void

    Returns Promise<void>

validateProgram

  • validateProgram(): Promise<void>
  • Validates the os level program is executable.

    Returns Promise<void>