|
ORE Studio 0.0.4
|
Represents the claims extracted from a JWT token. More...
#include <jwt_claims.hpp>

Static Public Member Functions | |
| static jwt_claims | with_ttl (std::chrono::seconds ttl) |
| Create a claims object with issued_at set to now and expires_at set to now + ttl. | |
Public Attributes | |
| std::string | subject |
| Subject claim - typically the account ID. | |
| std::string | issuer |
| Issuer of the token. | |
| std::string | audience |
| Intended audience for the token. | |
| std::chrono::system_clock::time_point | expires_at |
| Time when the token expires. | |
| std::chrono::system_clock::time_point | issued_at |
| Time when the token was issued. | |
| std::vector< std::string > | roles |
| User roles/permissions. | |
| std::optional< std::string > | username |
| Optional username claim. | |
| std::optional< std::string > | |
| Optional email claim. | |
| std::optional< std::string > | session_id |
| Optional session ID for tracking sessions. | |
| std::optional< std::chrono::system_clock::time_point > | session_start_time |
| Optional session start time for efficient database updates. | |
| std::optional< std::string > | tenant_id |
| Optional tenant ID (UUID string). | |
| std::optional< std::string > | party_id |
| Optional party ID (UUID string, nil UUID if no party selected). | |
| std::vector< std::string > | visible_party_ids |
| List of visible party IDs (UUID strings) for the session. | |
Represents the claims extracted from a JWT token.
|
static |
Create a claims object with issued_at set to now and expires_at set to now + ttl.
| ttl | Token lifetime. The caller is responsible for choosing an appropriate duration; this function does not apply any default — it only captures the current clock and computes the expiry. |
| std::optional<std::string> session_id |
Optional session ID for tracking sessions.
When present, identifies the database session record created during login, allowing proper session termination on logout and LRU-caching of session state by services.
| std::optional<std::chrono::system_clock::time_point> session_start_time |
Optional session start time for efficient database updates.
The sessions table uses (id, start_time) as composite primary key for TimescaleDB hypertable partitioning. Including start_time in the token allows efficient UPDATE queries without full table scans.
| std::optional<std::string> tenant_id |
Optional tenant ID (UUID string).
Identifies the tenant context for the authenticated account.
| std::optional<std::string> party_id |
Optional party ID (UUID string, nil UUID if no party selected).
Identifies the active party for the session.
| std::vector<std::string> visible_party_ids |
List of visible party IDs (UUID strings) for the session.
Contains the user's own party and all descendant parties, computed at login time via recursive CTE on the party hierarchy.