ScriptedAuthService class final
A WincheAuthService driven directly by a test rather than a backend.
Contract suites use it to put an app into a chosen sign-in state without needing a real auth implementation. It is also useful on its own, for a service package's own tests.
- Inheritance
-
- Object
- WincheService
- WincheAuthService
- ScriptedAuthService
Constructors
- ScriptedAuthService(WincheApp app)
-
Registers a scripted auth service with
app.
Properties
- activeIdentity → WincheIdentity?
-
The identity currently signed in, or null.
no setteroverride
- app → WincheApp
-
The app this service is attached to.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Whether dispose has run.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tokenError ↔ Object?
-
Set to make getAuthToken throw, standing in for a transient failure.
getter/setter pair
Methods
-
announce(
WincheIdentity? identity) → void -
Announces
identityas signed in, or null as an authoritative sign-out. -
dispose(
) → Future< void> -
Releases this service and deregisters it from app.
inherited
-
getAuthToken(
{bool forceRefresh = false}) → Future< String?> -
The current token, or null when signed out.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyIdentityChanged(
WincheIdentity? identity) → void -
Announce that activeIdentity changed.
inherited
-
notifyTokenRotated(
) → void -
Announce that the token rotated while the identity stayed the same.
inherited
-
rotate(
) → void - Announces a token rotation without changing the identity.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited