morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::session::SessionToken Struct Reference

Verified claims carried by a session token. More...

#include <session_auth.hpp>

Public Attributes

std::string principal
 Authenticated user/principal id.
int64_t issuedAtMs = 0
 Issue time, ms since epoch. If positive, verify rejects a token whose issuedAtMs is more than kClockSkewMs in the future (not-yet-valid). 0 (unset) disables the not-before check.
int64_t expiresAtMs = 0
 Expiry, ms since epoch. Must be strictly positive — a token must carry a real expiry. verify treats expiresAtMs <= 0 (including the default 0) as invalid/expired, so a zero token is never an eternal credential.
std::vector< std::string > roles
 Coarse-grained roles the app can key authorization policy on.

Detailed Description

Verified claims carried by a session token.

Serialised to JSON (Glaze) as the signed payload. Extend with app claims as needed — unknown fields are ignored on read, so adding claims is compatible.

Definition at line 289 of file session_auth.hpp.

Member Data Documentation

◆ principal

std::string morph::session::SessionToken::principal

Authenticated user/principal id.

Definition at line 291 of file session_auth.hpp.

◆ issuedAtMs

int64_t morph::session::SessionToken::issuedAtMs = 0

Issue time, ms since epoch. If positive, verify rejects a token whose issuedAtMs is more than kClockSkewMs in the future (not-yet-valid). 0 (unset) disables the not-before check.

Definition at line 295 of file session_auth.hpp.

◆ expiresAtMs

int64_t morph::session::SessionToken::expiresAtMs = 0

Expiry, ms since epoch. Must be strictly positive — a token must carry a real expiry. verify treats expiresAtMs <= 0 (including the default 0) as invalid/expired, so a zero token is never an eternal credential.

Definition at line 300 of file session_auth.hpp.

◆ roles

std::vector<std::string> morph::session::SessionToken::roles

Coarse-grained roles the app can key authorization policy on.

Definition at line 302 of file session_auth.hpp.


The documentation for this struct was generated from the following file: