Skip to content

Commit ebc4739

Browse files
fix: Bug: AsyncAPI documentation fails when Confluent uses oauth bearer authentication (#2775)
Fixes #2774
1 parent fc32dcf commit ebc4739

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

faststream/security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ def get_requirement(self) -> list["dict[str, Any]"]:
165165

166166
def get_schema(self) -> dict[str, dict[str, str]]:
167167
"""Get the security schema for SASL/OAUTHBEARER authentication."""
168-
return {"oauthbearer": {"type": "oauth2", "$ref": ""}}
168+
return {"oauthbearer": {"type": "oauth2"}}
169169

170170

171171
class SASLGSSAPI(BaseSecurity):

tests/asyncapi/confluent/v2_6_0/test_security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class SecurityTestcase(AsyncAPI26Mixin):
113113
}),
114114
"components": IsPartialDict({
115115
"securitySchemes": {
116-
"oauthbearer": {"type": "oauth2", "$ref": ""},
116+
"oauthbearer": {"type": "oauth2"},
117117
},
118118
}),
119119
}),

tests/asyncapi/confluent/v3_0_0/test_security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class SecurityTestcase(AsyncAPI30Mixin):
113113
}),
114114
"components": IsPartialDict({
115115
"securitySchemes": {
116-
"oauthbearer": {"type": "oauth2", "$ref": ""},
116+
"oauthbearer": {"type": "oauth2"},
117117
},
118118
}),
119119
}),

tests/asyncapi/kafka/v2_6_0/test_security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ async def test_topic(msg: str) -> str:
193193
{"oauthbearer": []},
194194
]
195195
sasl_oauthbearer_security_schema["components"]["securitySchemes"] = {
196-
"oauthbearer": {"type": "oauth2", "$ref": ""},
196+
"oauthbearer": {"type": "oauth2"},
197197
}
198198

199199
assert schema == sasl_oauthbearer_security_schema

tests/asyncapi/kafka/v3_0_0/test_security.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ async def test_topic(msg: str) -> str:
216216
{"$ref": "#/components/securitySchemes/oauthbearer"},
217217
]
218218
sasl_oauthbearer_security_schema["components"]["securitySchemes"] = {
219-
"oauthbearer": {"type": "oauth2", "$ref": ""},
219+
"oauthbearer": {"type": "oauth2"},
220220
}
221221

222222
assert schema == sasl_oauthbearer_security_schema

0 commit comments

Comments
 (0)