From 12b632eda7d36d090f35f5869c551b3beba890b8 Mon Sep 17 00:00:00 2001 From: Hans Petter Simonsen Date: Mon, 22 Jul 2024 13:37:50 +0200 Subject: [PATCH] =?UTF-8?q?Pr=C3=B8v=20negert=20filter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/filter/ProxyToOnPremFilter.kt | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/main/kotlin/no/nav/veilarbaktivitet/config/filter/ProxyToOnPremFilter.kt b/src/main/kotlin/no/nav/veilarbaktivitet/config/filter/ProxyToOnPremFilter.kt index 9539871c2..4d319199a 100644 --- a/src/main/kotlin/no/nav/veilarbaktivitet/config/filter/ProxyToOnPremFilter.kt +++ b/src/main/kotlin/no/nav/veilarbaktivitet/config/filter/ProxyToOnPremFilter.kt @@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Value import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty import org.springframework.cloud.gateway.server.mvc.handler.GatewayRouterFunctions.route import org.springframework.cloud.gateway.server.mvc.handler.HandlerFunctions.https +import org.springframework.cloud.gateway.server.mvc.predicate.GatewayRequestPredicates.path import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Profile import org.springframework.http.HttpHeaders @@ -45,23 +46,23 @@ class ProxyToOnPremGateway( fun getRoute(): RouterFunction { val sendToOnPrem = https(URI.create(veilaraktivitetFssUrl)) return route() - .GET("/internal/api/**", sendToOnPrem) - .POST("/internal/api/**", sendToOnPrem) - .PUT("/internal/api/**", sendToOnPrem) - .DELETE("/internal/api/**", sendToOnPrem) - .GET("/api/**", sendToOnPrem) - .POST("/api/**", sendToOnPrem) - .PUT("/api/**", sendToOnPrem) - .DELETE("/api/**", sendToOnPrem) - .POST("/graphql", sendToOnPrem) -// .route( -// path("/veilarbaktivitet/internal/isAlive") -// .or( -// path("/veilarbaktivitet/internal/isReady") -// .or(path("/veilarbaktivitet/internal/selftest")) -// .negate() -// ), sendToOnPrem -// ) +// .GET("/internal/api/**", sendToOnPrem) +// .POST("/internal/api/**", sendToOnPrem) +// .PUT("/internal/api/**", sendToOnPrem) +// .DELETE("/internal/api/**", sendToOnPrem) +// .GET("/api/**", sendToOnPrem) +// .POST("/api/**", sendToOnPrem) +// .PUT("/api/**", sendToOnPrem) +// .DELETE("/api/**", sendToOnPrem) +// .POST("/graphql", sendToOnPrem) + .route( + path("/internal/isAlive") + .or( + path("/internal/isReady") + .or(path("/internal/selftest")) + .negate() + ), sendToOnPrem + ) .before(oboExchange { proxyToOnPremTokenProvider.getProxyToken() }) .onError({ error -> log.error("Proxy error", error)