diff options
author | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-05-06 16:40:48 +0200 |
---|---|---|
committer | Jon Marius Venstad <jvenstad@yahoo-inc.com> | 2019-05-06 16:40:48 +0200 |
commit | a6bfd3c44e86cc78482d97c5fe3d3697b393f07b (patch) | |
tree | 15106faad283d0ccfaf76411c3e1e09c57bafddf | |
parent | 726ba08018dad3254e8fcdbaa8fd5fa58e4bb30e (diff) |
Remove traces of Athenz
-rw-r--r-- | hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java | 12 | ||||
-rw-r--r-- | vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java | 7 |
2 files changed, 7 insertions, 12 deletions
diff --git a/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java b/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java index 9b4f91d8a41..e76115931a3 100644 --- a/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java +++ b/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java @@ -55,9 +55,9 @@ public abstract class ControllerHttpClient { return new SigningControllerHttpClient(endpoint, privateKeyFile, id); } - /** Creates an HTTP client against the given endpoint, which uses the given private key and certificate of an Athenz identity. */ - public static ControllerHttpClient withAthenzIdentity(URI endpoint, Path privateKeyFile, Path certificateFile) { - return new AthenzControllerHttpClient(endpoint, privateKeyFile, certificateFile); + /** Creates an HTTP client against the given endpoint, which uses the given private key and certificate identity. */ + public static ControllerHttpClient withKeyAndCertificate(URI endpoint, Path privateKeyFile, Path certificateFile) { + return new MutualTlsControllerHttpClient(endpoint, privateKeyFile, certificateFile); } /** Sends submission to the remote controller and returns the version of the accepted package, or throws if this fails. */ @@ -173,10 +173,10 @@ public abstract class ControllerHttpClient { } - /** Client that uses a given Athenz identity to authenticate to the remote controller. */ - private static class AthenzControllerHttpClient extends ControllerHttpClient { + /** Client that uses a given key / certificate identity to authenticate to the remote controller. */ + private static class MutualTlsControllerHttpClient extends ControllerHttpClient { - private AthenzControllerHttpClient(URI endpoint, Path privateKeyFile, Path certificateFile) { + private MutualTlsControllerHttpClient(URI endpoint, Path privateKeyFile, Path certificateFile) { super(endpoint, HttpClient.newBuilder().sslContext(new SslContextBuilder().withKeyStore(privateKeyFile, certificateFile).build())); } diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java index b0bb22fad99..6f39c29963c 100644 --- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java +++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java @@ -9,15 +9,10 @@ import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; import org.apache.maven.project.MavenProject; -import java.io.IOException; -import java.io.UncheckedIOException; import java.net.URI; -import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import static java.nio.charset.StandardCharsets.UTF_8; - /** * Submits a Vespa application package and corresponding test jars to the hosted Vespa API. * @@ -71,7 +66,7 @@ public class SubmitMojo extends AbstractMojo { ApplicationId id = ApplicationId.from(tenant, application, instance); ControllerHttpClient controller = certificateFile == null ? ControllerHttpClient.withSignatureKey(URI.create(endpointUri), Paths.get(privateKeyFile), id) - : ControllerHttpClient.withAthenzIdentity(URI.create(endpointUri), Paths.get(privateKeyFile), Paths.get(certificateFile)); + : ControllerHttpClient.withKeyAndCertificate(URI.create(endpointUri), Paths.get(privateKeyFile), Paths.get(certificateFile)); Submission submission = new Submission(repository, branch, commit, authorEmail, Paths.get(applicationZip), Paths.get(applicationTestZip)); |