summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java12
-rw-r--r--vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java7
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));