aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-maven-plugin
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2019-10-25 13:00:32 +0200
committerJon Marius Venstad <venstad@gmail.com>2019-10-25 13:00:32 +0200
commitef9e8a057e6782a461869f186a98d85fe89563d3 (patch)
treea81d410bc150bd4fe8b22f82eee214ca411d4303 /vespa-maven-plugin
parent052987bb1acf8c78426a7f33e618560bb0269f50 (diff)
Change property names expected by plugins and test framework for auth files
Diffstat (limited to 'vespa-maven-plugin')
-rw-r--r--vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java
index 845d0ba4c1b..55616fc7936 100644
--- a/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java
+++ b/vespa-maven-plugin/src/main/java/ai/vespa/hosted/plugin/AbstractVespaMojo.java
@@ -37,14 +37,14 @@ public abstract class AbstractVespaMojo extends AbstractMojo {
@Parameter(property = "instance")
protected String instance;
- @Parameter(property = "privateKey")
- protected String privateKey;
+ @Parameter(property = "apiKey")
+ protected String apiKey;
- @Parameter(property = "privateKeyFile")
- protected String privateKeyFile;
+ @Parameter(property = "apiKeyFile")
+ protected String apiKeyFile;
- @Parameter(property = "certificateFile")
- protected String certificateFile;
+ @Parameter(property = "apiCertificateFile")
+ protected String apiCertificateFile;
// Fields set up as part of setup().
protected ApplicationId id;
@@ -73,12 +73,12 @@ public abstract class AbstractVespaMojo extends AbstractMojo {
instance = firstNonBlank(instance, project.getProperties().getProperty("instance", Properties.user()));
id = ApplicationId.from(tenant, application, instance);
- if (privateKey != null) {
- controller = ControllerHttpClient.withSignatureKey(URI.create(endpoint), privateKey, id);
- } else if (privateKeyFile != null) {
- controller = certificateFile == null
- ? ControllerHttpClient.withSignatureKey(URI.create(endpoint), Paths.get(privateKeyFile), id)
- : ControllerHttpClient.withKeyAndCertificate(URI.create(endpoint), Paths.get(privateKeyFile), Paths.get(certificateFile));
+ if (apiKey != null) {
+ controller = ControllerHttpClient.withSignatureKey(URI.create(endpoint), apiKey, id);
+ } else if (apiKeyFile != null) {
+ controller = apiCertificateFile == null
+ ? ControllerHttpClient.withSignatureKey(URI.create(endpoint), Paths.get(apiKeyFile), id)
+ : ControllerHttpClient.withKeyAndCertificate(URI.create(endpoint), Paths.get(apiKeyFile), Paths.get(apiCertificateFile));
} else {
throw new IllegalArgumentException("One of the properties 'privateKey' or 'privateKeyFile' is required.");
}