GrantAuthenticator class
Authenticates against the grants the Hub has issued, as opposed to the ones baked into its command line.
The store holds hashes, so this hashes the presented token and looks that up: there is nothing to compare in constant time, because there is no secret on this side to leak. A grant that has been revoked is gone from the store, so the very next request with its token fails — which is the point of being able to revoke one at all.
Compose it with the flag-based TokenAuthenticator (see
CompositeAuthenticator), so a Hub can be bootstrapped from the command line
and then hand out credentials at runtime.
- Implemented types
Constructors
- GrantAuthenticator(GrantRepository repository)
-
Creates an authenticator over
repository.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- repository → GrantRepository
-
Where issued grants live.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
authenticate(
Credential credential, {required Uint8List challenge}) → Future< Principal> -
Authenticates
credential, returning the resolved principal.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited