aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2020-03-24 22:06:43 +0100
committerGitHub <noreply@github.com>2020-03-24 22:06:43 +0100
commitecf3845bbcd225463be9314ad2b9fd3f1feb9b37 (patch)
treeb828cd976e71a0f086f316191830edc690edcb30
parenta73887e903ae0dcf7277dbf97bf678822752b45e (diff)
parentc58525742b95c6c8a71879437ade8550cd046db8 (diff)
Merge pull request #12698 from vespa-engine/revert-12682-jvenstad/support-api-key-variable-everywhere
Revert "Support api key variable for signature based test framework controlle…"
-rw-r--r--hosted-api/src/main/java/ai/vespa/hosted/api/Properties.java2
-rw-r--r--tenant-auth/src/main/java/ai/vespa/hosted/auth/ApiAuthenticator.java10
2 files changed, 5 insertions, 7 deletions
diff --git a/hosted-api/src/main/java/ai/vespa/hosted/api/Properties.java b/hosted-api/src/main/java/ai/vespa/hosted/api/Properties.java
index 22c32cfa9ec..fd640bcc235 100644
--- a/hosted-api/src/main/java/ai/vespa/hosted/api/Properties.java
+++ b/hosted-api/src/main/java/ai/vespa/hosted/api/Properties.java
@@ -52,7 +52,7 @@ public class Properties {
return getNonBlankProperty("apiCertificateFile").map(Paths::get);
}
- /** Returns the actual private key as a string. */
+ /** Returns the actual private key as a string */
public static Optional<String> apiKey() {
return getNonBlankProperty("apiKey");
}
diff --git a/tenant-auth/src/main/java/ai/vespa/hosted/auth/ApiAuthenticator.java b/tenant-auth/src/main/java/ai/vespa/hosted/auth/ApiAuthenticator.java
index 55b3af93050..82d859b08bd 100644
--- a/tenant-auth/src/main/java/ai/vespa/hosted/auth/ApiAuthenticator.java
+++ b/tenant-auth/src/main/java/ai/vespa/hosted/auth/ApiAuthenticator.java
@@ -13,12 +13,10 @@ public class ApiAuthenticator implements ai.vespa.hosted.api.ApiAuthenticator {
.map(certificateFile -> ControllerHttpClient.withKeyAndCertificate(Properties.apiEndpoint(),
Properties.apiKeyFile(),
certificateFile))
- .or(() -> Properties.apiKey().map(apiKey -> ControllerHttpClient.withSignatureKey(Properties.apiEndpoint(),
- apiKey,
- Properties.application())))
- .orElseGet(() -> ControllerHttpClient.withSignatureKey(Properties.apiEndpoint(),
- Properties.apiKeyFile(),
- Properties.application()));
+ .orElseGet(() ->
+ ControllerHttpClient.withSignatureKey(Properties.apiEndpoint(),
+ Properties.apiKeyFile(),
+ Properties.application()));
}
}