"""OAuth data types."""

from typing import TypedDict

from msgspec import Struct


class OAuthToken(Struct):
    """Contents of an OAuth2 token response."""

    access_token: str
    expires_at: int
    scope: str
    id_token: str | None = None
    refresh_token: str | None = None


class AuthJWT(TypedDict):
    """User and project token."""

    sub: str
    preferred_username: str
    proj_name: str
    proj_exp: int
    proj: str
    proj_role: str
