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
tokeninto 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
hostedUrlornullif 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
hostedUrlfrom store. Returns whether or not there's a stored token with matching url. -
removeMatchingCredential(
Uri hostedUrlSuffix) → bool -
Removes tokens which start with the same
hostedUrlSuffixfrom 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
fileand writescontentsto it.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited