aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-athenz
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@oath.com>2018-05-24 13:33:40 +0200
committerBjørn Christian Seime <bjorncs@oath.com>2018-05-24 13:33:40 +0200
commit105ce87a26441535e0862e367e76fbad092c099e (patch)
tree037f2df03645bd2e676d516b644125680e3db3eb /vespa-athenz
parentaaafe2ddda2ed6e094b79556ceb4033e8dd78dfb (diff)
Use SiaUtils in SiaIdentityProvider
Diffstat (limited to 'vespa-athenz')
-rw-r--r--vespa-athenz/src/main/java/com/yahoo/vespa/athenz/identity/SiaIdentityProvider.java17
1 files changed, 6 insertions, 11 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
index fb71ed65da1..ebff56a6f48 100644
--- 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
@@ -7,6 +7,8 @@ import com.yahoo.log.LogLevel;
import com.yahoo.vespa.athenz.api.AthenzService;
import com.yahoo.vespa.athenz.tls.KeyStoreType;
import com.yahoo.vespa.athenz.tls.SslContextBuilder;
+import com.yahoo.vespa.athenz.utils.AthenzIdentities;
+import com.yahoo.vespa.athenz.utils.SiaUtils;
import javax.net.ssl.SSLContext;
import java.io.File;
@@ -42,8 +44,8 @@ public class SiaIdentityProvider extends AbstractComponent implements ServiceIde
@Inject
public SiaIdentityProvider(SiaProviderConfig config) {
this(new AthenzService(config.athenzDomain(), config.athenzService()),
- getPrivateKeyFile(config.keyPathPrefix(), config.athenzDomain(), config.athenzService()),
- getCertificateFile(config.keyPathPrefix(), config.athenzDomain(), config.athenzService()),
+ SiaUtils.getPrivateKeyFile(Paths.get(config.keyPathPrefix()), new AthenzService(config.athenzDomain(), config.athenzService())).toFile(),
+ SiaUtils.getCertificateFile(Paths.get(config.keyPathPrefix()), new AthenzService(config.athenzDomain(), config.athenzService())).toFile(),
new File(config.trustStorePath()),
createScheduler());
}
@@ -52,8 +54,8 @@ public class SiaIdentityProvider extends AbstractComponent implements ServiceIde
Path siaPath,
File trustStoreFile) {
this(service,
- getPrivateKeyFile(siaPath.toString(), service.getDomain().getName(), service.getName()),
- getCertificateFile(siaPath.toString(), service.getDomain().getName(), service.getName()),
+ SiaUtils.getPrivateKeyFile(siaPath, service).toFile(),
+ SiaUtils.getCertificateFile(siaPath, service).toFile(),
trustStoreFile,
createScheduler());
}
@@ -119,13 +121,6 @@ public class SiaIdentityProvider extends AbstractComponent implements ServiceIde
}
}
- private static File getCertificateFile(String rootPath, String domain, String service) {
- return Paths.get(rootPath, "certs", String.format("%s.%s.cert.pem", domain, service)).toFile();
- }
-
- private static File getPrivateKeyFile(String rootPath, String domain, String service) {
- return Paths.get(rootPath, "keys", String.format("%s.%s.key.pem", domain, service)).toFile();
- }
@Override
public void deconstruct() {