diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2017-12-12 16:18:14 +0100 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2017-12-12 16:18:14 +0100 |
commit | f47e127846d978ee8dc28690da0567451b2236f4 (patch) | |
tree | 13b0be819ea153f7ff904df5ecb78093955cdc40 /controller-api | |
parent | 26b228622a21ab284a2649418a962908551a063f (diff) | |
parent | a114cdfec85f111ea900e21c05089670e4206bb8 (diff) |
Need new classes for hosted compilation
Diffstat (limited to 'controller-api')
4 files changed, 72 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/AthenzIdentityCertificate.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/AthenzIdentityCertificate.java new file mode 100644 index 00000000000..d53817c09e4 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/AthenzIdentityCertificate.java @@ -0,0 +1,27 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.athenz; + +import java.security.PrivateKey; +import java.security.cert.X509Certificate; + +/** + * @author bjorncs + */ +public class AthenzIdentityCertificate { + + private final X509Certificate certificate; + private final PrivateKey privateKey; + + public AthenzIdentityCertificate(X509Certificate certificate, PrivateKey privateKey) { + this.certificate = certificate; + this.privateKey = privateKey; + } + + public X509Certificate getCertificate() { + return certificate; + } + + public PrivateKey getPrivateKey() { + return privateKey; + } +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/AthenzRoleCertificate.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/AthenzRoleCertificate.java new file mode 100644 index 00000000000..80548cccd89 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/AthenzRoleCertificate.java @@ -0,0 +1,27 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.athenz; + +import java.security.PrivateKey; +import java.security.cert.X509Certificate; + +/** + * @author bjorncs + */ +public class AthenzRoleCertificate { + + private final X509Certificate certificate; + private final PrivateKey privateKey; + + public AthenzRoleCertificate(X509Certificate certificate, PrivateKey privateKey) { + this.certificate = certificate; + this.privateKey = privateKey; + } + + public X509Certificate getCertificate() { + return certificate; + } + + public PrivateKey getPrivateKey() { + return privateKey; + } +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/AthenzSslContextProvider.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/AthenzSslContextProvider.java new file mode 100644 index 00000000000..480105a2d86 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/AthenzSslContextProvider.java @@ -0,0 +1,14 @@ +// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.athenz; + +import com.google.inject.Provider; + +import javax.net.ssl.SSLContext; + +/** + * Provides a {@link SSLContext} for use in controller clients communicating with Athenz TLS secured services. + * It is configured with a keystore containing the Athenz service certificate and a trust store with the Athenz CA certificates. + * + * @author bjorncs + */ +public interface AthenzSslContextProvider extends Provider<SSLContext> {} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZtsClient.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZtsClient.java index c7a2adfb17e..f37c1679d1e 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZtsClient.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZtsClient.java @@ -12,4 +12,8 @@ public interface ZtsClient { List<AthenzDomain> getTenantDomainsForUser(AthenzIdentity principal); + AthenzIdentityCertificate getIdentityCertificate(); + + AthenzRoleCertificate getRoleCertificate(AthenzDomain roleDomain, String roleName); + } |