From 572ed275cb641e31f96b02ac622cb67e9bfb6ef5 Mon Sep 17 00:00:00 2001 From: Alan Crosswell Date: Thu, 8 Oct 2020 13:48:45 -0400 Subject: [PATCH] remove security objects until upstream https://github.com/encode/django-rest-framework/pull/7516 is merged --- rest_framework_json_api/schemas/openapi.py | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/rest_framework_json_api/schemas/openapi.py b/rest_framework_json_api/schemas/openapi.py index 77aae3ab..4d16ceec 100644 --- a/rest_framework_json_api/schemas/openapi.py +++ b/rest_framework_json_api/schemas/openapi.py @@ -293,7 +293,6 @@ def get_schema(self, request=None, public=False): schema = super().get_schema(request, public) components_schemas = {} - security_schemes_schemas = {} # Iterate endpoints generating per method path operations. paths = {} @@ -332,19 +331,6 @@ def get_schema(self, request=None, public=False): components_schemas.update(components) - if hasattr(view.schema, 'get_security_schemes'): # pragma: no cover - security_schemes = view.schema.get_security_schemes(path, method) - else: - security_schemes = {} - for k in security_schemes.keys(): # pragma: no cover - if k not in security_schemes_schemas: - continue - if security_schemes_schemas[k] == security_schemes[k]: - continue - warnings.warn('Securit scheme component "{}" has been overriden with a different ' - 'value.'.format(k)) - security_schemes_schemas.update(security_schemes) # pragma: no cover - if hasattr(view, 'action'): view.action = current_action # Normalise path for any provided mount url. @@ -361,8 +347,6 @@ def get_schema(self, request=None, public=False): schema['paths'] = paths schema['components'] = self.jsonapi_components schema['components']['schemas'].update(components_schemas) - if len(security_schemes_schemas) > 0: # pragma: no cover - schema['components']['securitySchemes'] = security_schemes_schemas return schema @@ -469,10 +453,6 @@ def get_operation(self, path, method, action=None): operation = {} operation['operationId'] = self.get_operation_id(path, method) operation['description'] = self.get_description(path, method) - if hasattr(self, 'get_security_requirements'): # pragma: no cover - security = self.get_security_requirements(path, method) - if security is not None: - operation['security'] = security parameters = [] parameters += self.get_path_parameters(path, method)