1 | /** @module auth */
|
2 | import { CredentialParams } from './CredentialParams';
|
3 | /**
|
4 | * Interface for credential stores which are used to store and lookup credentials
|
5 | * to authenticate against external services.
|
6 | *
|
7 | * @see [[CredentialParams]]
|
8 | * @see [[ConnectionParams]]
|
9 | */
|
10 | export interface ICredentialStore {
|
11 | /**
|
12 | * Stores credential parameters into the store.
|
13 | *
|
14 | * @param correlationId (optional) transaction id to trace execution through call chain.
|
15 | * @param key a key to uniquely identify the credential.
|
16 | * @param credential a credential to be stored.
|
17 | * @param callback callback function that receives an error or null for success.
|
18 | */
|
19 | store(correlationId: string, key: String, credential: CredentialParams, callback: (err: any) => void): void;
|
20 | /**
|
21 | * Lookups credential parameters by its key.
|
22 | *
|
23 | * @param correlationId (optional) transaction id to trace execution through call chain.
|
24 | * @param key a key to uniquely identify the credential.
|
25 | * @param callback callback function that receives found credential or error.
|
26 | */
|
27 | lookup(correlationId: string, key: string, callback: (err: any, result: CredentialParams) => void): void;
|
28 | }
|