sbt-idp/cope2n-api/fwd_api/api_specs/auth_extension.py
2023-11-30 18:19:06 +07:00

16 lines
418 B
Python
Executable File

from drf_spectacular.extensions import OpenApiAuthenticationExtension
from fwd_api.filter.AuthFilter import AuthFilter
class SimpleJWTTokenUserScheme(OpenApiAuthenticationExtension):
name = "Authorization"
target_class = AuthFilter
def get_security_definition(self, auto_schema):
return {
'type': 'apiKey',
'in': 'header',
'name': 'Authorization',
}