(
headers: Dict[str, str],
query_params: Dict[str, List[str]],
scheme_metadata: SecurityMetadata,
field_name: str,
scheme: Any,
)
| 110 | |
| 111 | |
| 112 | def _parse_security_scheme( |
| 113 | headers: Dict[str, str], |
| 114 | query_params: Dict[str, List[str]], |
| 115 | scheme_metadata: SecurityMetadata, |
| 116 | field_name: str, |
| 117 | scheme: Any, |
| 118 | ): |
| 119 | scheme_type = scheme_metadata.scheme_type |
| 120 | sub_type = scheme_metadata.sub_type |
| 121 | |
| 122 | if isinstance(scheme, BaseModel): |
| 123 | if scheme_type == "http": |
| 124 | if sub_type == "basic": |
| 125 | _parse_basic_auth_scheme(headers, scheme) |
| 126 | return |
| 127 | if sub_type == "custom": |
| 128 | return |
| 129 | |
| 130 | scheme_fields: Dict[str, FieldInfo] = scheme.__class__.model_fields |
| 131 | for name in scheme_fields: |
| 132 | scheme_field = scheme_fields[name] |
| 133 | |
| 134 | metadata = find_field_metadata(scheme_field, SecurityMetadata) |
| 135 | if metadata is None or metadata.field_name is None: |
| 136 | continue |
| 137 | |
| 138 | value = getattr(scheme, name) |
| 139 | |
| 140 | _parse_security_scheme_value( |
| 141 | headers, query_params, scheme_metadata, metadata, name, value |
| 142 | ) |
| 143 | else: |
| 144 | _parse_security_scheme_value( |
| 145 | headers, query_params, scheme_metadata, scheme_metadata, field_name, scheme |
| 146 | ) |
| 147 | |
| 148 | |
| 149 | def _parse_security_scheme_value( |
no test coverage detected