Skip to content

Commit

Permalink
Refactor: Comment out authentication filter in BrregstubReverseProxyA…
Browse files Browse the repository at this point in the history
…pplicationStarter and update dependencies #deploy-proxy-brregstub-reverse
  • Loading branch information
krharum committed Feb 21, 2025
1 parent 56c8475 commit ff5583c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions proxies/brregstub-reverse-proxy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ sonarqube {
dependencies {
implementation "no.nav.testnav.libs:reactive-security"
implementation "no.nav.testnav.libs:security-core"
implementation "no.nav.testnav.libs:reactive-core"
}
2 changes: 2 additions & 0 deletions proxies/brregstub-reverse-proxy/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ rootProject.name = "brregstub-reverse-proxy"

includeBuild "../../plugins/java"

includeBuild "../../libs/reactive-security"
includeBuild "../../libs/security-core"
includeBuild "../../libs/reactive-core"
includeBuild "../../libs/reactive-proxy"
includeBuild "../../libs/testing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ public static void main(String[] args) {

@Bean
public RouteLocator customRouteLocator(RouteLocatorBuilder builder,
AzureNavTokenService tokenService,
// AzureNavTokenService tokenService,
Consumers consumers) {

var addAuthenticationHeaderFilter = AddAuthenticationRequestGatewayFilterFactory
.bearerAuthenticationHeaderFilter(
() -> tokenService
.exchange(consumers.getBrregstub())
.map(AccessToken::getTokenValue));
// var addAuthenticationHeaderFilter = AddAuthenticationRequestGatewayFilterFactory
// .bearerAuthenticationHeaderFilter(
// () -> tokenService
// .exchange(consumers.getBrregstub())
// .map(AccessToken::getTokenValue));

return builder.routes()
.route(spec -> spec.path("/**")
.filters(filter -> filter.filter(addAuthenticationHeaderFilter))
// .filters(filter -> filter.filter(addAuthenticationHeaderFilter))
.uri(consumers.getBrregstub().getUrl())
)
.build();
Expand Down

0 comments on commit ff5583c

Please sign in to comment.