From 726ba08018dad3254e8fcdbaa8fd5fa58e4bb30e Mon Sep 17 00:00:00 2001 From: Jon Marius Venstad Date: Mon, 6 May 2019 15:18:00 +0200 Subject: Allow key/cert identity for submit plugin --- .../src/main/java/ai/vespa/hosted/plugin/SubmitMojo.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'vespa-maven-plugin/src') 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 f3360d975c6..b0bb22fad99 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 @@ -50,6 +50,9 @@ public class SubmitMojo extends AbstractMojo { @Parameter(property = "privateKeyFile", required = true) private String privateKeyFile; + @Parameter(property = "certificateFile") + private String certificateFile; + @Parameter(property = "authorEmail", required = true) private String authorEmail; @@ -66,9 +69,9 @@ public class SubmitMojo extends AbstractMojo { public void execute() { setup(); ApplicationId id = ApplicationId.from(tenant, application, instance); - ControllerHttpClient controller = ControllerHttpClient.withSignatureKey(URI.create(endpointUri), - Paths.get(privateKeyFile), - id); + ControllerHttpClient controller = certificateFile == null + ? ControllerHttpClient.withSignatureKey(URI.create(endpointUri), Paths.get(privateKeyFile), id) + : ControllerHttpClient.withAthenzIdentity(URI.create(endpointUri), Paths.get(privateKeyFile), Paths.get(certificateFile)); Submission submission = new Submission(repository, branch, commit, authorEmail, Paths.get(applicationZip), Paths.get(applicationTestZip)); -- cgit v1.2.3