ParticipantToken class
ParticipantToken
Constructors
-
ParticipantToken({required String name, String? projectId, String? apiKeyId, Map<
String, dynamic> ? extra, List<ParticipantGrant> ? grants, String? version}) -
ParticipantToken.fromJson(Map<
String, dynamic> json) -
factory
- ParticipantToken.fromJwt(String jwtStr, {String? token, bool verify = true})
-
factory
Properties
- apiKeyId → String?
-
final
-
extra
→ Map<
String, dynamic> ? -
final
-
grants
→ List<
ParticipantGrant> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAgent → bool
-
Backwards compatible agent flag, if you still need it.
no setter
- isUser → bool
-
no setter
- name → String
-
final
- projectId → String?
-
final
- role → String
-
"role" value; defaults to "user".
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- version → String
-
final
Methods
-
addApiGrant(
ApiScope grant) → void -
addRoleGrant(
String role) → void -
addRoomGrant(
String roomName) → void -
getApiGrant(
) → ApiScope? - Returns the ApiScope if present; for versions < 0.6.0, returns a permissive default when absent (mirrors Python fallback).
-
grantScope(
String name) → Object? - Returns the scope (String? or ApiScope) for a given grant name.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toJwt(
{String? token, String? apiKey, DateTime? expiration}) → String -
Encodes as JWT (HS256).
If
tokenis null, tries compile-time env ('MESHAGENT_SECRET').expirationadds 'exp' (seconds since epoch) to the payload. IfapiKeyis provided (or set viaMESHAGENT_API_KEY), it determines the signing secret and ensures the payload contains the API key metadata. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited