Skip to content
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

DB pool configuration using environment variables #1244

Closed
csc-gip opened this issue Nov 14, 2024 · 0 comments · Fixed by #1295
Closed

DB pool configuration using environment variables #1244

csc-gip opened this issue Nov 14, 2024 · 0 comments · Fixed by #1295
Labels
enhancement New feature or request

Comments

@csc-gip
Copy link
Contributor

csc-gip commented Nov 14, 2024

Add optional string parameters to the DB connection pools to take username, password and connect string from environment variables to simplify container build and runtime configuration.

i.e. if an additional property is set for the pool during configuration use the environment variable instead of the stored value.

  public static final StringParameter<String> USERNAME_ENV= 
      StringParameter.typeString("usernameEnv").
      label("Username environment variable.").
      documentation(Documentation.
                    en("Name of the environment variable containing the db username.").
                    de("Name der Umgebungsvariable, die den DB Nutzernamen enthält.").
                    build()).
      optional().build();

  public static final StringParameter<String> PASSWORD_ENV= 
      StringParameter.typeString("passwordEnv").
      label("Password environment variable.").
      documentation(Documentation.
                    en("Name of the environment variable containing the db password.").
                    de("Name der Umgebungsvariable, die das DB Passwort enthält.").
                    build()).
      optional().build();

  public static final StringParameter<String> CONNECT_ENV= 
      StringParameter.typeString("connectStringEnv").
      label("Connectstring environment variable.").
      documentation(Documentation.
                    en("Name of the environment variable containing the JDBC connect string.").
                    de("Name der Umgebungsvariable, die die JDBC Verbindungsdaten enthält.").
                    build()).
      optional().build();

In order to allow for runtime credential rotation the connection build strategy should reread the properties, when creating a new connection.

@csc-gip csc-gip added the enhancement New feature or request label Nov 14, 2024
@csc-gip csc-gip linked a pull request Dec 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant