Add PaperlessBasicAuthentication schema override

This commit is contained in:
shamoon 2025-01-18 14:07:06 -08:00
parent 4ab8c3d2f2
commit c651097d2f

View File

@ -15,6 +15,17 @@ class AngularApiAuthenticationOverrideScheme(OpenApiAuthenticationExtension):
}
class PaperelessBasicAuthenticationScheme(OpenApiAuthenticationExtension):
target_class = "paperless.auth.PaperlessBasicAuthentication"
name = "PaperelessBasicAuthentication"
def get_security_definition(self, auto_schema):
return {
"type": "http",
"scheme": "basic",
}
def generate_object_with_permissions_schema(serializer_class):
return {
operation: extend_schema(