summaryrefslogtreecommitdiffstats
path: root/config-model-api
diff options
context:
space:
mode:
authorMorten Tokle <mortent@verizonmedia.com>2019-06-24 08:29:37 +0200
committerMorten Tokle <mortent@verizonmedia.com>2019-06-24 09:11:13 +0200
commitc0f332e83da9c484421445b989672bcd21f69f75 (patch)
treebbefc0ee291bce14f260f79b8add42823bcaaa81 /config-model-api
parent25ae53f995d0110d27afcc430bcf19b1e6ef5755 (diff)
Reapply api changes for tls config
Diffstat (limited to 'config-model-api')
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/ModelContext.java2
-rw-r--r--config-model-api/src/main/java/com/yahoo/config/model/api/TlsSecrets.java30
2 files changed, 32 insertions, 0 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 b5db9f5eddd..9d7ae9759c3 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
@@ -59,6 +59,8 @@ public interface ModelContext {
boolean useAdaptiveDispatch();
// TODO: Remove when 7.61 is the oldest model in use
default boolean enableMetricsProxyContainer() { return false; }
+ // TODO: Remove temporary default implementation
+ default Optional<TlsSecrets> tlsSecrets() { return Optional.empty(); }
}
}
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..3cb4cedcbac
--- /dev/null
+++ b/config-model-api/src/main/java/com/yahoo/config/model/api/TlsSecrets.java
@@ -0,0 +1,30 @@
+// 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 String certificate() {
+ return certificate;
+ }
+
+ public String key() {
+ return key;
+ }
+
+ public boolean isMissing() {
+ return this == MISSING;
+ }
+}