KeyMatcher class abstract
Resolves a typed API-key prefix (or full raw key) against an
already-fetched key list. Pure — no Dio, no I/O — so logout and
keys revoke can share one normalisation without either owning an HTTP
call.
Normalisation, in order:
- Prepend
appflight_when the typed text doesn't already start with it — so botha3f9x1andappflight_a3f9x1work. - Truncate to 16 characters — the server's stored
prefixis exactlyraw.slice(0, 16), so pasting a full raw key also resolves. - Reject anything that carries no characters beyond
appflight_itself — an empty, whitespace, orappflight_-only typed value would otherwise be a prefix of every key and match all of them. That matters beyondkeys revoke appflight_reading as ambiguous:logout's legacy fallback passes a storedapiKeythrough unmodified when it's under 16 characters, and an empty or corrupted stored key must resolve to "no match", never to an unrelated live key. - Match every key whose
prefixstarts with the normalised text — callers decide what zero, one, or many matches means.
Constructors
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
-
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