-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathoauth_flows.py
47 lines (33 loc) · 1008 Bytes
/
oauth_flows.py
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from typing import Optional
from pydantic import BaseModel
from openapi_pydantic.compat import PYDANTIC_V2, ConfigDict, Extra
from .oauth_flow import OAuthFlow
class OAuthFlows(BaseModel):
"""
Allows configuration of the supported OAuth Flows.
"""
implicit: Optional[OAuthFlow] = None
"""
Configuration for the OAuth Implicit flow
"""
password: Optional[OAuthFlow] = None
"""
Configuration for the OAuth Resource Owner Password flow
"""
clientCredentials: Optional[OAuthFlow] = None
"""
Configuration for the OAuth Client Credentials flow.
Previously called `application` in OpenAPI 2.0.
"""
authorizationCode: Optional[OAuthFlow] = None
"""
Configuration for the OAuth Authorization Code flow.
Previously called `accessCode` in OpenAPI 2.0.
"""
if PYDANTIC_V2:
model_config = ConfigDict(
extra="allow",
)
else:
class Config:
extra = Extra.allow