Skip to content

feat: set JDBC credentials from environmental variables #1486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pvannierop
Copy link

Problem

At present, database credentials cannot be set via the environment from a container. This method of secret provisioning is widely used on containers running an application. For instance, when database passwords are not yet available when the ConfigMap on Kubernetes that holds the database credentials as database.user and database.password is generated, it is difficult to provide correct database credentials at runtime.

Note: This can be tackled with the valueFromEnv mechanism on Kubernetes.

Solution

This PR adds a small class that acts as JdbcCredentialsProvider that reads JDBC credentials from the CONNECT_JDBC_CONNECTION_USER and CONNECT_JDBC_CONNECTION_PASSWORD environmental variables.

Note: The names were chosen somewhat consistent with official env var nomenclature for connect components described here.

Does this solution apply anywhere else?
  • yes
  • no
If yes, where?

Test Strategy

Since this PR adds very little in terms of application logic, I did not add tests for now. When the feature added here is accepted, I would be more that happy to write some tests.

Testing done:
  • Unit tests
  • Integration tests
  • System tests
  • Manual tests

Release Plan

@pvannierop pvannierop requested a review from a team as a code owner March 16, 2025 06:12
@confluent-cla-assistant
Copy link

confluent-cla-assistant bot commented Mar 16, 2025

🎉 All Contributor License Agreements have been signed. Ready to merge.
✅ pvannierop
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Using the CONNECT_JDBC_CONNECTION_USER and CONNECT_JDBC_CONNECTION_PASSWORD env vars.
@pvannierop pvannierop force-pushed the feature/env-var-credentials-provider branch from d520bdd to 83441f9 Compare March 16, 2025 06:14
@pvannierop
Copy link
Author

I noticed, however, that the expected log messages are not transmitted by this class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant