diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-06-07 17:27:22 +0200 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-06-07 17:27:22 +0200 |
commit | ce08379e47b9e02836026d111e1a27681b21c715 (patch) | |
tree | 954830fead4acd24854a231b2d6d202676ac72ce /tenant-cd/src/main/java/ai/vespa/hosted/cd/TestConfig.java | |
parent | 65937b2191aad18db17403cdbf0b94db7aac7cc7 (diff) |
Move tenant authentication to new module tenant-auth, to override internally
Diffstat (limited to 'tenant-cd/src/main/java/ai/vespa/hosted/cd/TestConfig.java')
-rw-r--r-- | tenant-cd/src/main/java/ai/vespa/hosted/cd/TestConfig.java | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestConfig.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestConfig.java index ed9aea0e9b0..36c14a38b37 100644 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestConfig.java +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestConfig.java @@ -81,18 +81,6 @@ public class TestConfig { } static TestConfig fromController() { - ApplicationId id = ApplicationId.from(requireNonBlankProperty("tenant"), - requireNonBlankProperty("application"), - getNonBlankProperty("instance").orElse("default")); - - URI endpoint = URI.create(requireNonBlankProperty("endpoint")); - Path privateKeyFile = Paths.get(requireNonBlankProperty("privateKeyFile")); - Optional<Path> certificateFile = getNonBlankProperty("certificateFile").map(Paths::get); - - ControllerHttpClient controller = certificateFile.isPresent() - ? ControllerHttpClient.withKeyAndCertificate(endpoint, privateKeyFile, certificateFile.get()) - : ControllerHttpClient.withSignatureKey(endpoint, privateKeyFile, id); - return null; } @@ -110,12 +98,4 @@ public class TestConfig { return new TestConfig(application, zone, system, endpoints); } - static Optional<String> getNonBlankProperty(String name) { - return Optional.ofNullable(System.getProperty(name)).filter(value -> ! value.isBlank()); - } - - static String requireNonBlankProperty(String name) { - return getNonBlankProperty(name).orElseThrow(() -> new IllegalStateException("Missing required property '" + name + "'")); - } - } |