summaryrefslogtreecommitdiffstats
path: root/container-disc
diff options
context:
space:
mode:
authorMorten Tokle <mortent@oath.com>2017-10-23 13:27:24 +0200
committerMorten Tokle <mortent@oath.com>2017-10-23 13:38:12 +0200
commitd813686631c5543d4bb6a2bc061ad09b0efe5a9e (patch)
treee6a49ca1509fb8d7e12b027245b2b15a14ee6638 /container-disc
parent79c1773d3353863451e0d75243e280c40b6658b0 (diff)
serviceproviderendpoing -> load_balancer_address
Diffstat (limited to 'container-disc')
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/athenz/AthenzIdentityProvider.java2
-rw-r--r--container-disc/src/main/java/com/yahoo/container/jdisc/athenz/ServiceProviderApi.java9
2 files changed, 6 insertions, 5 deletions
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/athenz/AthenzIdentityProvider.java b/container-disc/src/main/java/com/yahoo/container/jdisc/athenz/AthenzIdentityProvider.java
index f67afdfc458..45b08c74688 100644
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/athenz/AthenzIdentityProvider.java
+++ b/container-disc/src/main/java/com/yahoo/container/jdisc/athenz/AthenzIdentityProvider.java
@@ -30,7 +30,7 @@ public final class AthenzIdentityProvider extends AbstractComponent {
@Inject
public AthenzIdentityProvider(IdentityConfig config, ConfigserverConfig configserverConfig) throws IOException {
- this(config, new ServiceProviderApi(configserverConfig.serviceProviderEndpoint()), new AthenzService());
+ this(config, new ServiceProviderApi(configserverConfig.loadBalancerAddress()), new AthenzService());
}
// Test only
diff --git a/container-disc/src/main/java/com/yahoo/container/jdisc/athenz/ServiceProviderApi.java b/container-disc/src/main/java/com/yahoo/container/jdisc/athenz/ServiceProviderApi.java
index 0b417a4d440..c6c56d016d9 100644
--- a/container-disc/src/main/java/com/yahoo/container/jdisc/athenz/ServiceProviderApi.java
+++ b/container-disc/src/main/java/com/yahoo/container/jdisc/athenz/ServiceProviderApi.java
@@ -8,16 +8,17 @@ import org.apache.http.util.EntityUtils;
import org.eclipse.jetty.http.HttpStatus;
import java.io.IOException;
+import java.net.URI;
/**
* @author mortent
*/
public class ServiceProviderApi {
- private final String providerEndpoint;
+ private final URI providerUri;
- public ServiceProviderApi(String providerEndpoint) {
- this.providerEndpoint = providerEndpoint;
+ public ServiceProviderApi(String providerAddress) {
+ providerUri = URI.create(String.format("https://%s:8443/athenz/v1/provider", providerAddress));
}
@@ -31,7 +32,7 @@ public class ServiceProviderApi {
// TODO Use client side auth to establish trusted secure channel
try (CloseableHttpClient httpClient = HttpClientBuilder.create().build()) {
- CloseableHttpResponse idDocResponse = httpClient.execute(RequestBuilder.get().setUri(providerEndpoint + "/identity-document").build());
+ CloseableHttpResponse idDocResponse = httpClient.execute(RequestBuilder.get().setUri(providerUri + "/identity-document").build());
if (HttpStatus.isSuccess(idDocResponse.getStatusLine().getStatusCode())) {
return EntityUtils.toString(idDocResponse.getEntity());
} else {