diff options
author | Morten Tokle <morten.tokle@gmail.com> | 2018-02-20 20:35:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-20 20:35:37 +0100 |
commit | 1ec2db1684e5f1ca0e50364c9741fdfa1e135503 (patch) | |
tree | c5df3671c4bfc9649d55411f975e06acca1e8807 /vespa-athenz/src | |
parent | f15c8a6384031adfe0764f20e6448be4eccd517b (diff) |
Revert "Refactor identityprovider. Add SiaIdentityProvider"
Diffstat (limited to 'vespa-athenz/src')
3 files changed, 0 insertions, 65 deletions
diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identity/SiaIdentityProvider.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identity/SiaIdentityProvider.java deleted file mode 100644 index c050ddce2c6..00000000000 --- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identity/SiaIdentityProvider.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.athenz.identity; - -import com.yahoo.athenz.auth.util.Crypto; -import com.yahoo.container.jdisc.athenz.AthenzIdentityProvider; -import com.yahoo.vespa.athenz.api.AthenzDomain; -import com.yahoo.vespa.athenz.api.AthenzIdentityCertificate; -import com.yahoo.vespa.athenz.api.AthenzService; -import com.yahoo.vespa.athenz.tls.AthenzSslContextBuilder; - -import javax.net.ssl.SSLContext; -import java.io.File; -import java.nio.file.Paths; -import java.security.PrivateKey; -import java.security.cert.X509Certificate; - -/** - * @author mortent - */ -public class SiaIdentityProvider implements AthenzIdentityProvider { - - private final AthenzDomain domain; - private final AthenzService service; - private final String path; - - public SiaIdentityProvider(SiaProviderConfig siaProviderConfig) { - this.domain = new AthenzDomain(siaProviderConfig.athenzDomain()); - this.service = new AthenzService(domain, siaProviderConfig.athenzService()); - this.path = siaProviderConfig.keyPathPrefix(); - } - - @Override - public String getDomain() { - return domain.getName(); - } - - @Override - public String getService() { - return service.getName(); - } - - @Override - public SSLContext getIdentitySslContext() { - X509Certificate certificate = Crypto.loadX509Certificate(Paths.get(path, "certs", String.format("%s.%s.cert.pem", getDomain(),getService())).toFile()); - PrivateKey privateKey = Crypto.loadPrivateKey(Paths.get(path, "keys", String.format("%s.%s.key.pem", getDomain(),getService())).toFile()); - - return new AthenzSslContextBuilder() - .withIdentityCertificate(new AthenzIdentityCertificate(certificate, privateKey)) - .build(); - } -} diff --git a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identity/package-info.java b/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identity/package-info.java deleted file mode 100644 index da31e72a1fa..00000000000 --- a/vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identity/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * @author mortent - */ -@ExportPackage -package com.yahoo.vespa.athenz.identity; - -import com.yahoo.osgi.annotation.ExportPackage;
\ No newline at end of file diff --git a/vespa-athenz/src/main/resources/configdefinitions/sia-provider.def b/vespa-athenz/src/main/resources/configdefinitions/sia-provider.def deleted file mode 100644 index f668ef544f7..00000000000 --- a/vespa-athenz/src/main/resources/configdefinitions/sia-provider.def +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -namespace=vespa.athenz.identity - -athenzDomain string -athenzService string -keyPathPrefix string |