"""HTTP and OAuth constants.

HTTP status codes, headers, and OAuth field names.
"""

from typing import Final

from .core import SECONDS_PER_HOUR

# =============================================================================
# OAuth Token Settings
# =============================================================================

DEFAULT_OAUTH_TOKEN_EXPIRY_SECONDS: Final[int] = int(SECONDS_PER_HOUR)
"""Default OAuth token expiry time in seconds (1 hour)."""

# =============================================================================
# OAuth Field Names
# =============================================================================

OAUTH_FIELD_ACCESS_TOKEN: Final[str] = "access_token"
"""OAuth access token field name."""

OAUTH_FIELD_REFRESH_TOKEN: Final[str] = "refresh_token"
"""OAuth refresh token field name."""

OAUTH_FIELD_TOKEN_TYPE: Final[str] = "token_type"
"""OAuth token type field name."""

OAUTH_FIELD_SCOPE: Final[str] = "scope"
"""OAuth scope field name."""

OAUTH_FIELD_EXPIRES_IN: Final[str] = "expires_in"
"""OAuth expires_in field name."""

# =============================================================================
# HTTP Headers
# =============================================================================

HTTP_AUTHORIZATION: Final[str] = "Authorization"
"""HTTP Authorization header name."""

HTTP_BEARER_PREFIX: Final[str] = "Bearer "
"""Standard HTTP authorization header prefix."""

# =============================================================================
# HTTP Status Codes
# =============================================================================

HTTP_STATUS_OK: Final[int] = 200
"""HTTP 200 OK status code."""

HTTP_STATUS_NO_CONTENT: Final[int] = 204
"""HTTP 204 No Content status code."""

HTTP_STATUS_BAD_REQUEST: Final[int] = 400
"""HTTP 400 Bad Request status code."""

HTTP_STATUS_UNAUTHORIZED: Final[int] = 401
"""HTTP 401 Unauthorized status code."""

HTTP_STATUS_NOT_FOUND: Final[int] = 404
"""HTTP 404 Not Found status code."""

HTTP_STATUS_INTERNAL_SERVER_ERROR: Final[int] = 500
"""HTTP 500 Internal Server Error status code."""
