From 5ba46eeb0e06b6a52aa34ee6add2a5d14c59e5de Mon Sep 17 00:00:00 2001 From: Yifan Zhang Date: Mon, 9 Jan 2023 12:31:53 +0300 Subject: [PATCH] Fix openapi security type for apis (#19) Co-authored-by: Yifan Zhang --- apihub/server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apihub/server.py b/apihub/server.py index becba10..b78204a 100644 --- a/apihub/server.py +++ b/apihub/server.py @@ -274,9 +274,9 @@ def get_paths(redis=get_redis()): paths = {} components_schemas = {} security_schemes = { - "BasicAuth": { + "bearerAuth": { "type": "http", - "scheme": "basic", + "scheme": "bearer", } } definitions = DefinitionManager(redis=redis) @@ -393,7 +393,7 @@ def custom_openapi(app=api): for path in openapi_schema["paths"].values(): for operation in path.values(): if "security" not in operation: - operation["security"] = [{"BasicAuth": []}] + operation["security"] = [{"bearerAuth": []}] paths, components_schemas, security_schemes = get_paths() openapi_schema["paths"].update(paths)