Kurlyk
Loading...
Searching...
No Matches
kurlyk::OAuthToken Struct Reference

Holds the result of an OAuth2 token exchange. More...

#include <OAuthToken.hpp>

Public Member Functions

bool is_expired (int64_t skew_ms=60000) const
 Checks whether the token has expired.

Public Attributes

std::string access_token
 The access token string.
std::string refresh_token
 The refresh token string (may be empty).
std::string token_type
 Token type, typically "Bearer".
std::string scope
 Granted scope (may be empty).
int64_t expires_at_ms = 0
 Absolute expiration time in milliseconds since epoch (0 = unknown).
std::string raw_response
 Raw server response body for debugging.

Detailed Description

Holds the result of an OAuth2 token exchange.

Definition at line 19 of file OAuthToken.hpp.

Member Function Documentation

◆ is_expired()

bool kurlyk::OAuthToken::is_expired ( int64_t skew_ms = 60000) const
inline

Checks whether the token has expired.

Parameters
skew_msSafety margin in milliseconds (default 60s) to account for network latency and clock drift.
Returns
true if the token has a known expiration and it is within the skew margin of expiry.

Definition at line 32 of file OAuthToken.hpp.

Member Data Documentation

◆ access_token

std::string kurlyk::OAuthToken::access_token

The access token string.

Definition at line 20 of file OAuthToken.hpp.

◆ expires_at_ms

int64_t kurlyk::OAuthToken::expires_at_ms = 0

Absolute expiration time in milliseconds since epoch (0 = unknown).

Definition at line 24 of file OAuthToken.hpp.

◆ raw_response

std::string kurlyk::OAuthToken::raw_response

Raw server response body for debugging.

Definition at line 25 of file OAuthToken.hpp.

◆ refresh_token

std::string kurlyk::OAuthToken::refresh_token

The refresh token string (may be empty).

Definition at line 21 of file OAuthToken.hpp.

◆ scope

std::string kurlyk::OAuthToken::scope

Granted scope (may be empty).

Definition at line 23 of file OAuthToken.hpp.

◆ token_type

std::string kurlyk::OAuthToken::token_type

Token type, typically "Bearer".

Definition at line 22 of file OAuthToken.hpp.


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