diff options
author | andreer <andreer@verizonmedia.com> | 2020-01-21 13:12:14 +0100 |
---|---|---|
committer | andreer <andreer@verizonmedia.com> | 2020-01-21 13:12:14 +0100 |
commit | 28e687116e5e181d9cfd84a007f057032fa8edb9 (patch) | |
tree | 5a7793d16ecdd147688c3d5cc9d1a14607bc02cd /config-model-api/src | |
parent | ef85cda373ff63f08b8ea8f4a11e1e5c48b42772 (diff) |
re-add tlsSecrets to configmodel for compatability
Diffstat (limited to 'config-model-api/src')
-rw-r--r-- | config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java | 3 | ||||
-rw-r--r-- | config-model-api/src/main/java/com/yahoo/config/model/api/TlsSecrets.java | 35 |
2 files changed, 37 insertions, 1 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java index d45c7ce4137..81ac02a5400 100644 --- a/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java @@ -54,7 +54,8 @@ public interface ModelContext { // TODO: Remove when Vespa 7.112 is the oldest config model in use default boolean useDedicatedNodeForLogserver() { return true; } boolean useAdaptiveDispatch(); - // TODO: Remove temporary default implementation + // TODO: Remove temporary default implementations + default Optional<TlsSecrets> tlsSecrets() { return Optional.empty(); } default Optional<EndpointCertificateSecrets> endpointCertificateSecrets() { return Optional.empty(); } double defaultTermwiseLimit(); boolean useBucketSpaceMetric(); diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/TlsSecrets.java b/config-model-api/src/main/java/com/yahoo/config/model/api/TlsSecrets.java new file mode 100644 index 00000000000..0937b8b77ec --- /dev/null +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/TlsSecrets.java @@ -0,0 +1,35 @@ +// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.config.model.api; + +public class TlsSecrets { + public static final TlsSecrets MISSING = new TlsSecrets(); + + private final String certificate; + private final String key; + + private TlsSecrets() { + this(null, null); + } + + public TlsSecrets(String certificate, String key) { + this.certificate = certificate; + this.key = key; + } + + public TlsSecrets(EndpointCertificateSecrets endpointCertificateSecrets) { + this.certificate = endpointCertificateSecrets.certificate(); + this.key = endpointCertificateSecrets.key(); + } + + public String certificate() { + return certificate; + } + + public String key() { + return key; + } + + public boolean isMissing() { + return this == MISSING; + } +} |