-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds SASLOAuthBearer flow to AIO Kafka's Faststream Security Parsing (#…
…1761) * Added same OAUTHBEARER security parsing as Confluent Kafka to AIO Kafka * Added same OAUTHBEARER security parsing as Confluent Kafka to AIO Kafka * Added SSL Context to Kafka AIO Oauth flow * Added more docs for Kafka OAuth Security Flow. * linting * linting --------- Co-authored-by: Alex Sinnott <[email protected]> Co-authored-by: Pastukhov Nikita <[email protected]>
- Loading branch information
1 parent
80ee72b
commit 9492712
Showing
4 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import ssl | ||
|
||
from faststream.kafka import KafkaBroker | ||
from faststream.security import SASLOAuthBearer | ||
|
||
ssl_context = ssl.create_default_context() | ||
security = SASLOAuthBearer( | ||
use_ssl=True, | ||
ssl_context=ssl_context | ||
) | ||
|
||
broker = KafkaBroker( | ||
"localhost:9092", | ||
security=security, | ||
sasl_oauth_token_provider=... | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters