aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorMorten Tokle <morten.tokle@gmail.com>2018-04-25 09:36:28 +0200
committerGitHub <noreply@github.com>2018-04-25 09:36:28 +0200
commitd82730695ca5a0e74e8bc0a8a985bd1da5af3ae5 (patch)
tree7b118ea0d0605df9c02eaaf73f4d4812fc3a7254 /controller-server
parentaf63325a5e8dba303caa87c8fca869a10037fb7f (diff)
parenta4d740f03a9acd8de9b6c4b3acf0c277360f4122 (diff)
Merge pull request #5676 from vespa-engine/mortent/rename-ckms
Rename Ckms -> SecretStore
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java10
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/restapi/impl/StatusPageResource.java14
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/restapi/impl/StatusPageResourceTest.java8
3 files changed, 16 insertions, 16 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java
index 806932385e1..ffa537615b7 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/athenz/impl/AthenzClientFactoryImpl.java
@@ -9,7 +9,7 @@ import com.yahoo.athenz.auth.token.PrincipalToken;
import com.yahoo.athenz.auth.util.Crypto;
import com.yahoo.athenz.zms.ZMSClient;
import com.yahoo.athenz.zts.ZTSClient;
-import com.yahoo.container.jdisc.Ckms;
+import com.yahoo.container.jdisc.secretstore.SecretStore;
import com.yahoo.container.jdisc.athenz.AthenzIdentityProvider;
import com.yahoo.vespa.athenz.api.NToken;
import com.yahoo.vespa.athenz.utils.AthenzIdentities;
@@ -25,14 +25,14 @@ import java.security.PrivateKey;
*/
public class AthenzClientFactoryImpl implements AthenzClientFactory {
- private final Ckms ckms;
+ private final SecretStore secretStore;
private final AthenzConfig config;
private final AthenzPrincipalAuthority athenzPrincipalAuthority;
private final AthenzIdentityProvider identityProvider;
@Inject
- public AthenzClientFactoryImpl(Ckms ckms, AthenzIdentityProvider identityProvider, AthenzConfig config) {
- this.ckms = ckms;
+ public AthenzClientFactoryImpl(SecretStore secretStore, AthenzIdentityProvider identityProvider, AthenzConfig config) {
+ this.secretStore = secretStore;
this.identityProvider = identityProvider;
this.config = config;
this.athenzPrincipalAuthority = new AthenzPrincipalAuthority(config.principalHeaderName());
@@ -72,7 +72,7 @@ public class AthenzClientFactoryImpl implements AthenzClientFactory {
private PrivateKey getServicePrivateKey() {
AthenzConfig.Service service = config.service();
- String privateKey = ckms.getSecret(service.privateKeySecretName(), service.privateKeyVersion()).trim();
+ String privateKey = secretStore.getSecret(service.privateKeySecretName(), service.privateKeyVersion()).trim();
return Crypto.loadPrivateKey(privateKey);
}
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/restapi/impl/StatusPageResource.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/restapi/impl/StatusPageResource.java
index d0154ace4e0..4c479267f2c 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/restapi/impl/StatusPageResource.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/restapi/impl/StatusPageResource.java
@@ -4,7 +4,7 @@ package com.yahoo.vespa.hosted.restapi.impl;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.inject.Inject;
import com.yahoo.container.jaxrs.annotation.Component;
-import com.yahoo.container.jdisc.Ckms;
+import com.yahoo.container.jdisc.secretstore.SecretStore;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@@ -24,20 +24,20 @@ import javax.ws.rs.core.UriBuilder;
public class StatusPageResource implements com.yahoo.vespa.hosted.controller.api.statuspage.StatusPageResource {
private final Client client;
- private final Ckms ckms;
+ private final SecretStore secretStore;
@Inject
- public StatusPageResource(@Component Ckms ckms) {
- this(ckms, ClientBuilder.newClient());
+ public StatusPageResource(@Component SecretStore secretStore) {
+ this(secretStore, ClientBuilder.newClient());
}
- protected StatusPageResource(Ckms ckms, Client client) {
- this.ckms = ckms;
+ protected StatusPageResource(SecretStore secretStore, Client client) {
+ this.secretStore = secretStore;
this.client = client;
}
protected UriBuilder statusPageURL(String page, String since) {
- String[] secrets = ckms.getSecret("vespa_hosted.controller.statuspage_api_key").split(":");
+ String[] secrets = secretStore.getSecret("vespa_hosted.controller.statuspage_api_key").split(":");
UriBuilder uriBuilder = UriBuilder.fromUri("https://" + secrets[0] + ".statuspage.io/api/v2/" + page + ".json?api_key=" + secrets[1]);
if (since != null) {
uriBuilder.queryParam("since", since);
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/restapi/impl/StatusPageResourceTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/restapi/impl/StatusPageResourceTest.java
index b116ba3b5ee..429e1ea2b8d 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/restapi/impl/StatusPageResourceTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/restapi/impl/StatusPageResourceTest.java
@@ -3,7 +3,7 @@ package com.yahoo.vespa.hosted.restapi.impl;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
-import com.yahoo.container.jdisc.Ckms;
+import com.yahoo.container.jdisc.secretstore.SecretStore;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
@@ -30,15 +30,15 @@ public class StatusPageResourceTest {
Client mockClient = Mockito.mock(Client.class);
WebTarget mockTarget = Mockito.mock(WebTarget.class);
Invocation.Builder mockRequest = Mockito.mock(Invocation.Builder.class);
- Ckms ckms = Mockito.mock(Ckms.class);
+ SecretStore secretStore = Mockito.mock(SecretStore.class);
Mockito.when(mockClient.target(Mockito.any(UriBuilder.class))).thenReturn(mockTarget);
Mockito.when(mockTarget.request()).thenReturn(mockRequest);
Mockito.when(mockRequest.get(JsonNode.class)).thenReturn(
new ObjectMapper().readTree("{\"page\":{\"name\":\"Vespa\"}}"));
- Mockito.when(ckms.getSecret(Mockito.any(String.class))).thenReturn("testpage:testkey");
+ Mockito.when(secretStore.getSecret(Mockito.any(String.class))).thenReturn("testpage:testkey");
- statusPage = new StatusPageResource(ckms, mockClient);
+ statusPage = new StatusPageResource(secretStore, mockClient);
}