File: security_requirement.py

package info (click to toggle)
openapi-pydantic 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 744 kB
  • sloc: python: 4,392; makefile: 4
file content (33 lines) | stat: -rw-r--r-- 1,434 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
26
27
28
29
30
31
32
33
from typing import Dict, List

SecurityRequirement = Dict[str, List[str]]
"""
Lists the required security schemes to execute this operation.
The name used for each property MUST correspond to a security scheme declared in the
[Security Schemes](#componentsSecuritySchemes) under the 
[Components Object](#componentsObject).

Security Requirement Objects that contain multiple schemes require that
all schemes MUST be satisfied for a request to be authorized.
This enables support for scenarios where multiple query parameters or HTTP headers
are required to convey security information.

When a list of Security Requirement Objects is defined on the
[OpenAPI Object](#oasObject) or [Operation Object](#operationObject),
only one of the Security Requirement Objects in the list needs to be satisfied to 
authorize the request.
"""

"""Patterned Fields"""

# {name}: List[str]
"""
Each name MUST correspond to a security scheme which is declared
in the [Security Schemes](#componentsSecuritySchemes) under the 
[Components Object](#componentsObject).
If the security scheme is of type `"oauth2"` or `"openIdConnect"`,
then the value is a list of scope names required for the execution,
and the list MAY be empty if authorization does not require a specified scope.
For other security scheme types, the array MAY contain a list of role names which are 
required for the execution, but are not otherwise defined or exchanged in-band.
"""