aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@oath.com>2018-11-21 12:07:56 +0100
committerBjørn Christian Seime <bjorncs@oath.com>2018-11-27 13:08:17 +0100
commitb0559806b74ba297709e8996c46a4199e75ae210 (patch)
tree875db0fe432253edf945364165564c69af7e892d /controller-server
parent6d4ec80d66386f2c9252feee569cf7e0ac5a34e6 (diff)
Remove Bouncer freshness api from controller
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java12
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/SetBouncerPassthruHeaderFilter.java27
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java3
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/root.json3
4 files changed, 1 insertions, 44 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
index 49da3867f76..26495178c9b 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
@@ -71,7 +71,6 @@ import com.yahoo.vespa.hosted.controller.restapi.MessageResponse;
import com.yahoo.vespa.hosted.controller.restapi.ResourceResponse;
import com.yahoo.vespa.hosted.controller.restapi.SlimeJsonResponse;
import com.yahoo.vespa.hosted.controller.restapi.StringResponse;
-import com.yahoo.vespa.hosted.controller.restapi.filter.SetBouncerPassthruHeaderFilter;
import com.yahoo.vespa.hosted.controller.tenant.AthenzTenant;
import com.yahoo.vespa.hosted.controller.tenant.Tenant;
import com.yahoo.vespa.hosted.controller.tenant.UserTenant;
@@ -169,7 +168,6 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
if (path.matches("/application/v4/tenant-pipeline")) return tenantPipelines();
if (path.matches("/application/v4/athensDomain")) return athenzDomains(request);
if (path.matches("/application/v4/property")) return properties();
- if (path.matches("/application/v4/cookiefreshness")) return cookieFreshness(request);
if (path.matches("/application/v4/tenant/{tenant}")) return tenant(path.get("tenant"), request);
if (path.matches("/application/v4/tenant/{tenant}/application")) return applications(path.get("tenant"), request);
if (path.matches("/application/v4/tenant/{tenant}/application/{application}")) return application(path.get("tenant"), path.get("application"), request);
@@ -244,7 +242,7 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
private HttpResponse root(HttpRequest request) {
return recurseOverTenants(request)
? recursiveRoot(request)
- : new ResourceResponse(request, "user", "tenant", "tenant-pipeline", "athensDomain", "property", "cookiefreshness");
+ : new ResourceResponse(request, "user", "tenant", "tenant-pipeline", "athensDomain", "property");
}
private HttpResponse authenticatedUser(HttpRequest request) {
@@ -316,14 +314,6 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
return new SlimeJsonResponse(slime);
}
- private HttpResponse cookieFreshness(HttpRequest request) {
- Slime slime = new Slime();
- String passThruHeader = request.getHeader(SetBouncerPassthruHeaderFilter.BOUNCER_PASSTHRU_HEADER_FIELD);
- slime.setObject().setBool("shouldRefreshCookie",
- ! SetBouncerPassthruHeaderFilter.BOUNCER_PASSTHRU_COOKIE_OK.equals(passThruHeader));
- return new SlimeJsonResponse(slime);
- }
-
private HttpResponse tenant(String tenantName, HttpRequest request) {
return controller.tenants().tenant(TenantName.from(tenantName))
.map(tenant -> tenant(tenant, request, true))
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/SetBouncerPassthruHeaderFilter.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/SetBouncerPassthruHeaderFilter.java
deleted file mode 100644
index 7ea98528a88..00000000000
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/SetBouncerPassthruHeaderFilter.java
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.hosted.controller.restapi.filter;
-
-import com.yahoo.jdisc.handler.ResponseHandler;
-import com.yahoo.jdisc.http.filter.DiscFilterRequest;
-import com.yahoo.jdisc.http.filter.SecurityRequestFilter;
-import com.yahoo.yolean.chain.After;
-
-/**
- * @author Stian Kristoffersen
- */
-@After("BouncerFilter")
-public class SetBouncerPassthruHeaderFilter implements SecurityRequestFilter {
-
- public static final String BOUNCER_PASSTHRU_ATTRIBUTE = "bouncer.bypassthru";
- public static final String BOUNCER_PASSTHRU_COOKIE_OK = "1";
- public static final String BOUNCER_PASSTHRU_HEADER_FIELD = "com.yahoo.hosted.vespa.bouncer.passthru";
-
- @Override
- public void filter(DiscFilterRequest request, ResponseHandler handler) {
- Object statusProperty = request.getAttribute(BOUNCER_PASSTHRU_ATTRIBUTE);
- String status = Integer.toString((int)statusProperty);
-
- request.addHeader(BOUNCER_PASSTHRU_HEADER_FIELD, status);
- }
-
-}
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java
index 3d0489ab0a1..33ac089439c 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiTest.java
@@ -145,9 +145,6 @@ public class ApplicationApiTest extends ControllerContainerTest {
// GET OpsDB properties
tester.assertResponse(request("/application/v4/property/", GET).userIdentity(USER_ID),
new File("property-list.json"));
- // GET cookie freshness
- tester.assertResponse(request("/application/v4/cookiefreshness/", GET).userIdentity(USER_ID),
- new File("cookiefreshness.json"));
// POST (add) a tenant without property ID
tester.assertResponse(request("/application/v4/tenant/tenant1", POST)
.userIdentity(USER_ID)
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/root.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/root.json
index 6e4e319d3e1..233d35ceb2e 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/root.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/root.json
@@ -14,9 +14,6 @@
},
{
"url":"http://localhost:8080/application/v4/property/"
- },
- {
- "url":"http://localhost:8080/application/v4/cookiefreshness/"
}
]
}