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',
        }
