Skip to content

Commit

Permalink
fix: add config to disable keystore watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
gaetanmaisse authored and loriepisicchio committed May 25, 2023
1 parent 8418ac3 commit 2e94e9a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected HttpServerOptions getHttpServerOptions() {
.withKeyStoreType(httpServerConfiguration.getKeyStoreType())
.withKeyStoreCertificates(httpServerConfiguration.getKeyStoreCertificates())
.withKubernetesLocations(httpServerConfiguration.getKeystoreKubernetes())
.withWatch(true) // TODO: allow to configure watch (globally, just for keystore, ...) ?
.withWatch(httpServerConfiguration.getKeyStoreWatch())
.withDefaultAlias(httpServerConfiguration.getKeyStoreDefaultAlias())
.build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class HttpServerConfiguration {
private final String tlsProtocols;
private final String keyStorePath;
private final List<String> keyStoreKubernetes;
private final boolean keyStoreWatch;
private final String keyStoreDefaultAlias;
private final String keyStorePassword;
private final String keyStoreType;
Expand Down Expand Up @@ -95,6 +96,7 @@ private HttpServerConfiguration(HttpServerConfigurationBuilder builder) {
this.tlsProtocols = builder.tlsProtocols;
this.keyStorePath = builder.keyStorePath;
this.keyStoreKubernetes = builder.keyStoreKubernetes;
this.keyStoreWatch = builder.keyStoreWatch;
this.keyStoreDefaultAlias = builder.keyStoreDefaultAlias;
this.keyStorePassword = builder.keyStorePassword;
this.keyStoreType = builder.keyStoreType;
Expand Down Expand Up @@ -172,6 +174,10 @@ public List<String> getKeystoreKubernetes() {
return keyStoreKubernetes;
}

public boolean getKeyStoreWatch() {
return keyStoreWatch;
}

public String getKeyStoreDefaultAlias() {
return this.keyStoreDefaultAlias;
}
Expand Down Expand Up @@ -291,6 +297,7 @@ public static class HttpServerConfigurationBuilder {
private String tlsProtocols;
private String keyStorePath;
private List<String> keyStoreKubernetes;
private boolean keyStoreWatch = true;
private String keyStoreDefaultAlias;
private String keyStorePassword;
private String keyStoreType = CERTIFICATE_FORMAT_JKS;
Expand Down Expand Up @@ -403,6 +410,11 @@ public HttpServerConfigurationBuilder withDefaultKeyStoreKubernetes(List<String>
return this;
}

public HttpServerConfigurationBuilder withDefaultKeyStoreWatch(boolean keyStoreWatch) {
this.keyStoreWatch = keyStoreWatch;
return this;
}

public HttpServerConfigurationBuilder withDefaultKeyStorePassword(String keyStorePassword) {
this.keyStorePassword = keyStorePassword;
return this;
Expand Down Expand Up @@ -623,6 +635,7 @@ public HttpServerConfiguration build() {
this.keyStorePath = environment.getProperty(prefix + "ssl.keystore.path", keyStorePath);
this.keyStoreCertificates = getCertificateValues(prefix + "ssl.keystore.certificates");
this.keyStoreKubernetes = getArrayValues(prefix + "ssl.keystore.kubernetes", this.keyStoreKubernetes);
this.keyStoreWatch = environment.getProperty(prefix + "ssl.keystore.watch", Boolean.class, this.keyStoreWatch);
this.keyStoreDefaultAlias = environment.getProperty(prefix + "ssl.keystore.defaultAlias");
this.keyStorePassword = environment.getProperty(prefix + "ssl.keystore.password", keyStorePassword);

Expand Down

0 comments on commit 2e94e9a

Please sign in to comment.