summaryrefslogtreecommitdiffstats
path: root/tenant-auth/src
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-03-24 10:32:50 +0100
committerJon Marius Venstad <venstad@gmail.com>2020-03-24 10:32:50 +0100
commit84a1c56ecbe8c8bd3705ea747584a98f5fa34147 (patch)
treeb21cea4c3c9b361bceaf9f7023420737696a41cd /tenant-auth/src
parent76a82eeed23094e0f2b70b1325115b8b1e521904 (diff)
Support api key variable for signature based test framework controller client
Diffstat (limited to 'tenant-auth/src')
-rw-r--r--tenant-auth/src/main/java/ai/vespa/hosted/auth/ApiAuthenticator.java10
1 files changed, 6 insertions, 4 deletions
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 82d859b08bd..55b3af93050 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,10 +13,12 @@ public class ApiAuthenticator implements ai.vespa.hosted.api.ApiAuthenticator {
.map(certificateFile -> ControllerHttpClient.withKeyAndCertificate(Properties.apiEndpoint(),
Properties.apiKeyFile(),
certificateFile))
- .orElseGet(() ->
- ControllerHttpClient.withSignatureKey(Properties.apiEndpoint(),
- Properties.apiKeyFile(),
- Properties.application()));
+ .or(() -> Properties.apiKey().map(apiKey -> ControllerHttpClient.withSignatureKey(Properties.apiEndpoint(),
+ apiKey,
+ Properties.application())))
+ .orElseGet(() -> ControllerHttpClient.withSignatureKey(Properties.apiEndpoint(),
+ Properties.apiKeyFile(),
+ Properties.application()));
}
}