This repository has been archived by the owner on Jan 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from ucsd-ets/danial/add-sasl-support
Add authentication configurations support
- Loading branch information
Showing
6 changed files
with
233 additions
and
100 deletions.
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,5 @@ | ||
"""Exceptions for the app""" | ||
|
||
|
||
class InvalidConfigurationsError(Exception): | ||
pass |
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,19 @@ | ||
import logging | ||
|
||
from django.conf import settings | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def get_kafka_producer_configurations(): | ||
""" | ||
Return the configurations required to initialize the KafkaProducer object. | ||
""" | ||
try: | ||
configurations = {} | ||
configurations.update(settings.CALIPER_KAFKA_SETTINGS.get('PRODUCER_CONFIG', {})) | ||
configurations.update(settings.CALIPER_KAFKA_AUTH_SETTINGS.get('PRODUCER_CONFIG', {})) | ||
return configurations | ||
|
||
except KeyError as ex: | ||
LOGGER.exception('Invalid or no configurations are provided for KafkaProducer: %s', str(ex)) |
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
Oops, something went wrong.