KletsoSession class final
A device session: the short-lived token that authorises realtime and REST calls.
- Annotations
-
- @immutable
Constructors
- KletsoSession({required String id, required String token, required DateTime expiresAt})
-
Creates a session.
const
- KletsoSession.fromJson(JsonMap json)
-
Reads a session from the bootstrap response.
factory
Properties
- expiresAt → DateTime
-
Expiry, UTC.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
Session id (
ses_…).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- token → String
-
Session token (
kst_…); sent as the first frame / bearer token.final
Methods
-
expiresWithin(
Duration margin, DateTime now) → bool -
Whether expiresAt is within
marginofnow. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → JsonMap - Wire form.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited