Files
dify/api/controllers/openapi/auth/spec.py
T
Xiyuan Chenandautofix-ci[bot] bc0636c4db refactor(openapi): route /openapi/v1 auth by subject (#41420)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-09-18 08:42:53 +00:00

24 lines
796 B
Python

"""`@endpoint` builds one at decoration time and attaches it as `view.__spec__`;
the router reads nothing else off the view. It lives in `auth/` so the
dependency runs `_contract.py` -> `auth/` and never back.
"""
from __future__ import annotations
from dataclasses import dataclass
from controllers.openapi.auth.requirements import Requirement
from enums import DeploymentEdition
@dataclass(frozen=True, slots=True)
class EndpointSpec:
"""`edition` is the endpoint-level gate — a 404 raised before any bearer
is read, because the route is not exposed on this edition at all. It is
not `ExternalSsoPipeline`'s own gate, which 403s a token kind after
authentication.
"""
requirements: tuple[Requirement, ...]
edition: frozenset[DeploymentEdition] | None = None