AuthService class
Password login + server-side revoking logout, against contracts already
live on the backend (/v1/auth/api-keys, /v1/auth/whoami) and the
Identity Toolkit REST API (AuthRestClient). Every Dio is
constructor/call-injected so tests can swap in a fake adapter
(test/helpers/fake_adapter.dart) — this service never terminates the
process; every failure is a thrown AuthCliFault, and the command
decides the exit code and the printed line.
- Available extensions
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
loginWithPassword(
{required Dio apiDio, required AuthRestClient auth, required String email, required String password, required String keyName}) → Future< AuthLoginResult> -
Order matters: verification is checked, then
mustChangePassword, before anything destructive — an unverified or must-change-password account must never lose a working key on its way to being rejected. Rotation follows: the existingcli:<hostname>key is revoked before the new one is minted, because a duplicate active label 400s the create call. -
logout(
{required Dio apiDio, required Credentials creds}) → Future< AuthLogoutResult> -
Available on AuthService, provided by the AuthServiceLogout extension
Revokes the storedkeyId; falls back to a prefix match againstlistKeyswhen the file predates that field. Revoke is not idempotent — a 400 (already revoked, unknown id, someone else's key) from the revoke call itself is read as "already gone", not an error. -
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
Static Properties
- ins → AuthService
-
final