diff options
author | Andreas Eriksen <andreer@yahooinc.com> | 2022-06-07 15:37:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-07 15:37:36 +0200 |
commit | 55739697251b3498966be7916e879660eee0c6a3 (patch) | |
tree | c81509bb450fe105a9c4601e1395bd9e4a188f5b /controller-api/src | |
parent | 3c11b757e61d022832de4c48fae6f0a44030f4bd (diff) |
Copy endpoint certs to GCP (#22806)
Co-authored-by: Ola Aunrønning <olaa@yahooinc.com>
Diffstat (limited to 'controller-api/src')
4 files changed, 57 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java index c0adb7389c8..be83fd8de48 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/ServiceRegistry.java @@ -30,6 +30,7 @@ import com.yahoo.vespa.hosted.controller.api.integration.organization.SystemMoni import com.yahoo.vespa.hosted.controller.api.integration.resource.CostReportConsumer; import com.yahoo.vespa.hosted.controller.api.integration.resource.MeteringClient; import com.yahoo.vespa.hosted.controller.api.integration.resource.ResourceDatabaseClient; +import com.yahoo.vespa.hosted.controller.api.integration.secrets.GcpSecretStore; import com.yahoo.vespa.hosted.controller.api.integration.secrets.TenantSecretService; import com.yahoo.vespa.hosted.controller.api.integration.user.RoleMaintainer; import com.yahoo.vespa.hosted.controller.api.integration.vcmr.ChangeRequestClient; @@ -113,4 +114,6 @@ public interface ServiceRegistry { PlanRegistry planRegistry(); RoleMaintainer roleMaintainer(); + + GcpSecretStore gcpSecretStore(); } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/certificates/EndpointCertificateMetadata.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/certificates/EndpointCertificateMetadata.java index 1b36a573bf1..b423fcb83f8 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/certificates/EndpointCertificateMetadata.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/certificates/EndpointCertificateMetadata.java @@ -84,6 +84,34 @@ public class EndpointCertificateMetadata { return lastRefreshed; } + public EndpointCertificateMetadata withKeyName(String keyName) { + return new EndpointCertificateMetadata( + keyName, + this.certName, + this.version, + this.lastRequested, + this.rootRequestId, + this.leafRequestId, + this.requestedDnsSans, + this.issuer, + this.expiry, + this.lastRefreshed); + } + + public EndpointCertificateMetadata withCertName(String certName) { + return new EndpointCertificateMetadata( + this.keyName, + certName, + this.version, + this.lastRequested, + this.rootRequestId, + this.leafRequestId, + this.requestedDnsSans, + this.issuer, + this.expiry, + this.lastRefreshed); + } + public EndpointCertificateMetadata withVersion(int version) { return new EndpointCertificateMetadata( this.keyName, diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/secrets/GcpSecretStore.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/secrets/GcpSecretStore.java new file mode 100644 index 00000000000..312bec1fd98 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/secrets/GcpSecretStore.java @@ -0,0 +1,8 @@ +package com.yahoo.vespa.hosted.controller.api.integration.secrets; + +public interface GcpSecretStore { + + void createSecret(String secretName, String secret); + + String getSecret(String secretName, int version); +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/secrets/NoopGcpSecretStore.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/secrets/NoopGcpSecretStore.java new file mode 100644 index 00000000000..9335a814f6c --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/secrets/NoopGcpSecretStore.java @@ -0,0 +1,18 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.secrets; + +/** + * @author olaa + */ +public class NoopGcpSecretStore implements GcpSecretStore { + + @Override + public void createSecret(String secretName, String secret) { + + } + + @Override + public String getSecret(String secretName, int version) { + return ""; + } +} |