From c0f332e83da9c484421445b989672bcd21f69f75 Mon Sep 17 00:00:00 2001 From: Morten Tokle Date: Mon, 24 Jun 2019 08:29:37 +0200 Subject: Reapply api changes for tls config --- .../com/yahoo/config/model/api/ModelContext.java | 2 ++ .../com/yahoo/config/model/api/TlsSecrets.java | 30 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 config-model-api/src/main/java/com/yahoo/config/model/api/TlsSecrets.java (limited to 'config-model-api') 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() { 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; + } +} -- cgit v1.2.3