TokenStore class

Stores and manages authentication credentials.

Constructors

TokenStore([String? lConfigDir])

Properties

configDir String?
Cache directory.
latefinal
credentials Iterable<Credential>
List of saved authentication tokens.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addCredential(Credential token) → void
Adds token into store and writes into disk.
deleteTokensFile() → void
Deletes pub-tokens.json file from the disk.
ensureDir(String tokensFile) → void
findCredential(Uri hostedUrl) Credential?
Returns Credential for authenticating given hostedUrl or null if no matching credential is found.
hasCredential(Uri url) bool
Returns whether or not store contains a token that could be used for authenticating given url.
missingConfigDir() → Never
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeCredential(Uri hostedUrl) bool
Removes tokens with matching hostedUrl from store. Returns whether or not there's a stored token with matching url.
removeMatchingCredential(Uri hostedUrlSuffix) bool
Removes tokens which start with the same hostedUrlSuffix from store. Returns whether or not there was at least one stored token with matching url.
toString() String
A string representation of this object.
inherited
writeTextFile(String file, String contents, {bool dontLogContents = false, Encoding encoding = utf8}) → void
Creates file and writes contents to it.

Operators

operator ==(Object other) bool
The equality operator.
inherited