ccproxy.auth.managers.token_snapshot¶
ccproxy.auth.managers.token_snapshot
¶
Shared token snapshot model for credential managers.
TokenSnapshot
dataclass
¶
TokenSnapshot(
provider=None,
account_id=None,
access_token=None,
refresh_token=None,
expires_at=None,
scopes=(),
extras=dict(),
)
Immutable view over sensitive token metadata.
Token managers return this lightweight structure to share credential state without exposing implementation details. Secrets should only appear in the access/refresh token fields and remain masked when rendered via the helper methods.
has_access_token
¶
has_refresh_token
¶
access_token_preview
¶
Return a masked preview of the access token.
Source code in ccproxy/auth/managers/token_snapshot.py
refresh_token_preview
¶
Return a masked preview of the refresh token.
Source code in ccproxy/auth/managers/token_snapshot.py
expires_in_seconds
¶
Return seconds until expiration when available.
Source code in ccproxy/auth/managers/token_snapshot.py
with_scopes
¶
Return a copy with the provided scopes tuple.