File: security_scheme.py

package info (click to toggle)
flask-openapi3 4.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,224 kB
  • sloc: python: 4,802; makefile: 14; javascript: 5
file content (25 lines) | stat: -rw-r--r-- 688 bytes parent folder | download
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
# -*- coding: utf-8 -*-
# @Author  : llc
# @Time    : 2023/7/4 9:56

from pydantic import BaseModel, Field

from .oauth_flows import OAuthFlows
from .security_scheme_in_type import SecuritySchemeInType


class SecurityScheme(BaseModel):
    """
    https://spec.openapis.org/oas/v3.1.0#security-scheme-object
    """

    type: str
    description: str | None = None
    name: str | None = None
    security_scheme_in: SecuritySchemeInType | None = Field(default=None, alias="in")
    scheme: str | None = None
    bearerFormat: str | None = None
    flows: OAuthFlows | None = None
    openIdConnectUrl: str | None = None

    model_config = {"extra": "allow", "populate_by_name": True}