Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MemoryCredentialStore

Credential store that keeps credentials in memory.

Configuration parameters

  • [credential key 1]:
    • ... credential parameters for key 1
  • [credential key 2]:
    • ... credential parameters for key N
  • ...
see

ICredentialStore

see

CredentialParams

Example

let config = ConfigParams.fromTuples(
    "key1.user", "jdoe",
    "key1.pass", "pass123",
    "key2.user", "bsmith",
    "key2.pass", "mypass"
);

let credentialStore = new MemoryCredentialStore();
credentialStore.readCredentials(config);

credentialStore.lookup("123", "key1", (err, credential) => {
    // Result: user=jdoe;pass=pass123
});

Hierarchy

  • MemoryCredentialStore

Implements

Index

Constructors

constructor

  • Creates a new instance of the credential store.

    Parameters

    • Default value config: ConfigParams = null

      (optional) configuration with credential parameters.

    Returns MemoryCredentialStore

Methods

configure

  • configure(config: ConfigParams): void
  • Configures component by passing configuration parameters.

    Parameters

    • config: ConfigParams

      configuration parameters to be set.

    Returns void

lookup

  • lookup(correlationId: string, key: string, callback: function): void
  • Lookups credential parameters by its key.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • key: string

      a key to uniquely identify the credential parameters.

    • callback: function

      callback function that receives found credential parameters or error.

    Returns void

readCredentials

  • readCredentials(config: ConfigParams): void
  • Reads credentials from configuration parameters. Each section represents an individual CredentialParams

    Parameters

    • config: ConfigParams

      configuration parameters to be read

    Returns void

store

  • store(correlationId: string, key: string, credential: CredentialParams, callback: function): void
  • Stores credential parameters into the store.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • key: string

      a key to uniquely identify the credential parameters.

    • credential: CredentialParams

      a credential parameters to be stored.

    • callback: function

      callback function that receives an error or null for success.

        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns void

Generated using TypeDoc