diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2018-11-21 12:07:56 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2018-11-21 12:07:56 +0100 |
commit | 9cca6a6536def97ac75dcd47edc17077daa85718 (patch) | |
tree | 8913fccdf88270795a2b34bf18012d0c3ab52683 /controller-server | |
parent | 2f403781703fdfef5e2aa5137a40edd1f33e2ccb (diff) |
Remove Bouncer freshness api from controller
Diffstat (limited to 'controller-server')
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 c5db553219e..57f729ced85 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 8b260765423..2856bbe214d 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 @@ -144,9 +144,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/" } ] } |