diff options
author | Bjørn Christian Seime <bjorncs@yahooinc.com> | 2023-06-15 13:10:18 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahooinc.com> | 2023-06-15 13:13:48 +0200 |
commit | f5cf6f814eeeaa7b77a5312ac8c6bf7cdc4fa4c3 (patch) | |
tree | a9c6fe4fd7314b903664eb9bf56227e9622e1bf5 /container-core | |
parent | 147de419d353b7da73795c97e3e95e901b59fad4 (diff) |
Misc improvements
Remove duplicate unit tests. Improve symbol names.
Use `Map` to simplify code and reduce cost.
Introduce constant for the number of bytes in token check hash.
Improve code comments.
Diffstat (limited to 'container-core')
-rw-r--r-- | container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/DataplaneProxyCredentials.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/DataplaneProxyCredentials.java b/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/DataplaneProxyCredentials.java index 204288a52b7..a30252b1626 100644 --- a/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/DataplaneProxyCredentials.java +++ b/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/DataplaneProxyCredentials.java @@ -50,9 +50,7 @@ public class DataplaneProxyCredentials extends AbstractComponent { } } - /* - * Returns true if credentials should be regenerated. - * + /** * @return old certificate if credentials should not be regenerated, empty otherwise. */ private Optional<X509Certificate> regenerateCredentials(Path certificateFile, Path keyFile) { @@ -65,7 +63,7 @@ public class DataplaneProxyCredentials extends AbstractComponent { if (!X509CertificateUtils.privateKeyMatchesPublicKey(privateKey, x509Certificate.getPublicKey())) return Optional.empty(); return Optional.of(x509Certificate); } catch (IOException e) { - // Some exception occured, assume credentials corrupted and requires a new pair. + // Some exception occurred, assume credentials corrupted and requires a new pair. log.log(Level.WARNING, "Failed to load credentials: %s".formatted(e.getMessage())); log.log(Level.FINE, e.toString(), e); return Optional.empty(); |