Skip to main content

Interface: CredentialDataSource

Prevents multiple instances of Credential from existing for the same Token

Remarks

Default implementation provided

Properties

emitter

readonly emitter: CredentialDataSourceEventEmitter


size

readonly size: number

Returns the number of Credentials recorded in the CredentialDataSource

Methods

hasCredential()

hasCredential(token): boolean

Checks CredentialDataSource for an existing Credential instance which represents the provided Token.

Parameters

token: Token

Returns

boolean


credentialFor()

credentialFor(token): Credential

Checks CredentialDataSource for an existing Credential instance which represents the provided Token. If one does not exist, a new Credential instance is created (and recorded within the CredentialDataSource)

Parameters

token: Token

Returns

Credential


remove()

remove(cred): void

Removes provided Credential instance from the CredentialDataSource

Parameters

cred: Credential

Returns

void

Remarks

NOTE: This does not revoke the represented token. They are only removed from the CredentialDataSource!


clear()

clear(): void

Clears all Credential instances from the CredentialDataSource

Returns

void

Remarks

NOTE: This does not revoke tokens. They are only removed from the CredentialDataSource!