Interface: CredentialCoordinator
Holds the implementation of most Credential methods. Bridges the CredentialDataSource and TokenStorage layers together
Remarks
Default implementation provided
Properties
emitter
emitter:
CredentialCoordinatorEventEmitter
default
default:
null|Credential
Represents Credential.default, backed by TokenStorage
tokenStorage
tokenStorage:
TokenStorage
size
readonlysize:number
Returns the number of recorded Credential instances in the CredentialDataSource
Methods
store()
store(
token,tags):Credential
Writes the provided Token (and Token.Metadata) to storage and creates a Credential instance to represent the Token via the CredentialDataSource
Parameters
• token: Token
the Token to store
• tags: string[]
an array of developer-provided tags to associate with a Token. Used by Credential.find queries
Returns
with()
with(
id):null|Credential
Retrieves a Credential for the provided id from storage
Parameters
• id: string
Returns
null | Credential
find()
find(
matcher):Credential[]
Uses stored Token.Metadata to match stored Tokens by certain criteria
Parameters
• matcher
Returns
remove()
remove(
cred):void
Removes the provided Credential from storage and CredentialDataSource
Parameters
• cred: Credential
Returns
void
Remarks
NOTE: This does not revoke tokens!
clear()
clear():
void
Clears both TokenStorage and CredentialDataSource
Returns
void
Remarks
NOTE: This does not revoke tokens!
allIDs()
allIDs():
string[]
Returns all Token.id | ids in storage
Returns
string[]