summaryrefslogtreecommitdiff
path: root/venv/lib/python3.11/site-packages/litestar/openapi/spec/oauth_flows.py
blob: 920d095780a9e383a8dd4cf09bb68d5d3737a44b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from __future__ import annotations

from dataclasses import dataclass
from typing import TYPE_CHECKING

from litestar.openapi.spec.base import BaseSchemaObject

if TYPE_CHECKING:
    from litestar.openapi.spec.oauth_flow import OAuthFlow

__all__ = ("OAuthFlows",)


@dataclass
class OAuthFlows(BaseSchemaObject):
    """Allows configuration of the supported OAuth Flows."""

    implicit: OAuthFlow | None = None
    """Configuration for the OAuth Implicit flow."""

    password: OAuthFlow | None = None
    """Configuration for the OAuth Resource Owner Password flow."""

    client_credentials: OAuthFlow | None = None
    """Configuration for the OAuth Client Credentials flow. Previously called ``application`` in OpenAPI 2.0."""

    authorization_code: OAuthFlow | None = None
    """Configuration for the OAuth Authorization Code flow. Previously called ``accessCode`` in OpenAPI 2.0."""