diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2019-08-19 11:47:35 +0200 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2019-08-19 11:47:35 +0200 |
commit | 2af85a042b5d7ca94fdc8a0b8a04c258d6b64df2 (patch) | |
tree | e697607d1dd6cdd4de57a8fd1b9de345317a2619 /tenant-cd | |
parent | 0c4ce4cb5bb3573b7b6c21573224b0edd064b177 (diff) |
Rename EndpointAuthenticator -> Authenticator, and doc fixes
Diffstat (limited to 'tenant-cd')
3 files changed, 11 insertions, 15 deletions
diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestRuntime.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestRuntime.java index 4ae1c0b7a5e..e10d627808f 100644 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestRuntime.java +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/TestRuntime.java @@ -1,10 +1,10 @@ package ai.vespa.hosted.cd; -import ai.vespa.hosted.api.ApiAuthenticator; -import ai.vespa.hosted.api.EndpointAuthenticator; +import ai.vespa.hosted.api.Authenticator; import ai.vespa.hosted.api.ControllerHttpClient; import ai.vespa.hosted.api.Properties; import ai.vespa.hosted.api.TestConfig; +import ai.vespa.hosted.auth.CertificateAndKeyAuthenticator; import ai.vespa.hosted.cd.http.HttpDeployment; import com.yahoo.config.provision.ApplicationId; import com.yahoo.config.provision.Environment; @@ -29,7 +29,7 @@ public class TestRuntime { private final Map<String, Deployment> productionDeployments; private final Deployment deploymentToTest; - private TestRuntime(TestConfig config, EndpointAuthenticator authenticator) { + private TestRuntime(TestConfig config, Authenticator authenticator) { this.config = config; this.productionDeployments = config.deployments().entrySet().stream() .filter(zoneDeployment -> zoneDeployment.getKey().environment() == Environment.prod) @@ -41,7 +41,7 @@ public class TestRuntime { } /** - * Returns the config for this test, or null if it has not been provided. + * Returns the config and authenticator to use when running integration tests. * * If the system property {@code "vespa.test.config"} is set (to a file path), a file at that location * is attempted read, and config parsed from it. @@ -55,13 +55,13 @@ public class TestRuntime { String configPath = System.getProperty("vespa.test.config"); TestConfig config = configPath != null ? fromFile(configPath) : fromController(); theRuntime = new TestRuntime(config, - new ai.vespa.hosted.auth.EndpointAuthenticator(config.system())); + new CertificateAndKeyAuthenticator(config.system())); } return theRuntime; } /** Returns a copy of this runtime, with the given endpoint authenticator. */ - public TestRuntime with(EndpointAuthenticator authenticator) { + public TestRuntime with(Authenticator authenticator) { return new TestRuntime(config, authenticator); } diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpDeployment.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpDeployment.java index 22c622effae..04cebcf50b2 100644 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpDeployment.java +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpDeployment.java @@ -1,6 +1,6 @@ package ai.vespa.hosted.cd.http; -import ai.vespa.hosted.api.EndpointAuthenticator; +import ai.vespa.hosted.api.Authenticator; import ai.vespa.hosted.cd.TestDeployment; import ai.vespa.hosted.cd.TestEndpoint; import com.yahoo.config.provision.Environment; @@ -22,7 +22,7 @@ public class HttpDeployment implements TestDeployment { private final Map<String, HttpEndpoint> endpoints; /** Creates a representation of the given deployment endpoints, using the authenticator for data plane access. */ - public HttpDeployment(Map<String, URI> endpoints, ZoneId zone, EndpointAuthenticator authenticator) { + public HttpDeployment(Map<String, URI> endpoints, ZoneId zone, Authenticator authenticator) { this.zone = zone; this.endpoints = endpoints.entrySet().stream() .collect(Collectors.toUnmodifiableMap(entry -> entry.getKey(), diff --git a/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java b/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java index 17703d8fbab..a9d8f2e7cc5 100644 --- a/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java +++ b/tenant-cd/src/main/java/ai/vespa/hosted/cd/http/HttpEndpoint.java @@ -1,9 +1,6 @@ package ai.vespa.hosted.cd.http; -import ai.vespa.hosted.api.EndpointAuthenticator; -import com.yahoo.slime.Inspector; -import com.yahoo.slime.JsonDecoder; -import com.yahoo.slime.Slime; +import ai.vespa.hosted.api.Authenticator; import ai.vespa.hosted.cd.Digest; import ai.vespa.hosted.cd.Feed; import ai.vespa.hosted.cd.Query; @@ -14,7 +11,6 @@ import ai.vespa.hosted.cd.Visit; import ai.vespa.hosted.cd.metric.Metrics; import java.io.IOException; -import java.io.UncheckedIOException; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; @@ -37,9 +33,9 @@ public class HttpEndpoint implements TestEndpoint { private final URI endpoint; private final HttpClient client; - private final EndpointAuthenticator authenticator; + private final Authenticator authenticator; - public HttpEndpoint(URI endpoint, EndpointAuthenticator authenticator) { + public HttpEndpoint(URI endpoint, Authenticator authenticator) { this.endpoint = requireNonNull(endpoint); this.authenticator = requireNonNull(authenticator); this.client = HttpClient.newBuilder() |