Skip to content

Commit

Permalink
feat (ingest): kafka-connect: adding Auth to Kafka Connect API (#4298)
Browse files Browse the repository at this point in the history
  • Loading branch information
arunvasudevan authored Mar 4, 2022
1 parent acf6eaa commit 2bf648f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,12 @@ def __init__(self, config: KafkaConnectSourceConfig, ctx: PipelineContext):
)

# Test the connection
if self.config.username is not None and self.config.password is not None:
logger.info(
f"Connecting to {self.config.connect_uri} with Authentication..."
)
self.session.auth = (self.config.username, self.config.password)

test_response = self.session.get(f"{self.config.connect_uri}")
test_response.raise_for_status()
logger.info(f"Connection to {self.config.connect_uri} is ok")
Expand Down

0 comments on commit 2bf648f

Please sign in to comment.