From 2c8b4999dc5b9e3f8fd9413e22a34ced72163f9e Mon Sep 17 00:00:00 2001 From: spataphore1337 Date: Tue, 19 Nov 2024 18:52:34 +0300 Subject: [PATCH 1/2] fix: change oauth type in asyncapi schema --- faststream/security.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faststream/security.py b/faststream/security.py index 4bcd4eba99..352acffb22 100644 --- a/faststream/security.py +++ b/faststream/security.py @@ -167,7 +167,7 @@ def get_requirement(self) -> List["AnyDict"]: def get_schema(self) -> Dict[str, Dict[str, str]]: """Get the security schema for SASL/OAUTHBEARER authentication.""" - return {"oauthbearer": {"type": "oauthBearer"}} + return {"oauthbearer": {"type": "oauth2", "$ref": ""}} class SASLGSSAPI(BaseSecurity): From 706f68120ac061df975bc5b3d53283ebf980ea50 Mon Sep 17 00:00:00 2001 From: spataphore1337 Date: Tue, 19 Nov 2024 19:08:36 +0300 Subject: [PATCH 2/2] fix: change oauth type in test asyncapi --- tests/asyncapi/confluent/test_security.py | 2 +- tests/asyncapi/kafka/test_security.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/asyncapi/confluent/test_security.py b/tests/asyncapi/confluent/test_security.py index 0621cbf756..915621ab84 100644 --- a/tests/asyncapi/confluent/test_security.py +++ b/tests/asyncapi/confluent/test_security.py @@ -192,7 +192,7 @@ async def test_topic(msg: str) -> str: {"oauthbearer": []} ] sasl_oauthbearer_security_schema["components"]["securitySchemes"] = { - "oauthbearer": {"type": "oauthBearer"} + "oauthbearer": {"type": "oauth2", "$ref": ""} } assert schema == sasl_oauthbearer_security_schema diff --git a/tests/asyncapi/kafka/test_security.py b/tests/asyncapi/kafka/test_security.py index 3201bf899c..62e30e9ccf 100644 --- a/tests/asyncapi/kafka/test_security.py +++ b/tests/asyncapi/kafka/test_security.py @@ -192,7 +192,7 @@ async def test_topic(msg: str) -> str: {"oauthbearer": []} ] sasl_oauthbearer_security_schema["components"]["securitySchemes"] = { - "oauthbearer": {"type": "oauthBearer"} + "oauthbearer": {"type": "oauth2", "$ref": ""} } assert schema == sasl_oauthbearer_security_schema