-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): Bump org.springframework.boot from 3.3.5 to 3.4.0 (#1268)
* chore(deps): Bump org.springframework.boot from 3.3.5 to 3.4.0 Bumps [org.springframework.boot](https://github.com/spring-projects/spring-boot) from 3.3.5 to 3.4.0. - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](spring-projects/spring-boot@v3.3.5...v3.4.0) --- updated-dependencies: - dependency-name: org.springframework.boot dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * align spring cloud version * simplify test conf * feat: update FirewallConfig wrt Spring Security 6.4.1 * chore: use ConfluentKafkaContainer module as KafkaContainer is deprecated --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Benoit Orihuela <benoit.orihuela@egm.io>
- Loading branch information
1 parent
5dddc8b
commit ed38961
Showing
8 changed files
with
26 additions
and
48 deletions.
There are no files selected for viewing
22 changes: 6 additions & 16 deletions
22
api-gateway/src/main/kotlin/com/egm/stellio/apigateway/config/FirewallConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,18 @@ | ||
package com.egm.stellio.apigateway.config | ||
|
||
import org.springframework.beans.BeansException | ||
import org.springframework.beans.factory.config.BeanPostProcessor | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.security.web.server.WebFilterChainProxy | ||
import org.springframework.security.web.server.firewall.ServerWebExchangeFirewall | ||
import org.springframework.security.web.server.firewall.StrictServerWebExchangeFirewall | ||
|
||
@Configuration | ||
class FirewallConfig { | ||
|
||
@Bean | ||
fun beanPostProcessor(): BeanPostProcessor { | ||
return object : BeanPostProcessor { | ||
@Throws(BeansException::class) | ||
override fun postProcessBeforeInitialization(bean: Any, beanName: String): Any { | ||
if (bean is WebFilterChainProxy) { | ||
val firewall = StrictServerWebExchangeFirewall() | ||
firewall.setAllowUrlEncodedSlash(true) | ||
firewall.setAllowUrlEncodedDoubleSlash(true) | ||
bean.setFirewall(firewall) | ||
} | ||
return bean | ||
} | ||
fun httpFirewall(): ServerWebExchangeFirewall = | ||
StrictServerWebExchangeFirewall().apply { | ||
setAllowUrlEncodedDoubleSlash(true) | ||
setAllowUrlEncodedSlash(true) | ||
setAllowUrlEncodedPercent(true) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 6 additions & 16 deletions
22
shared/src/main/kotlin/com/egm/stellio/shared/config/FirewallConfig.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,18 @@ | ||
package com.egm.stellio.shared.config | ||
|
||
import org.springframework.beans.BeansException | ||
import org.springframework.beans.factory.config.BeanPostProcessor | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.security.web.server.WebFilterChainProxy | ||
import org.springframework.security.web.server.firewall.ServerWebExchangeFirewall | ||
import org.springframework.security.web.server.firewall.StrictServerWebExchangeFirewall | ||
|
||
@Configuration | ||
class FirewallConfig { | ||
|
||
@Bean | ||
fun beanPostProcessor(): BeanPostProcessor { | ||
return object : BeanPostProcessor { | ||
@Throws(BeansException::class) | ||
override fun postProcessBeforeInitialization(bean: Any, beanName: String): Any { | ||
if (bean is WebFilterChainProxy) { | ||
val firewall = StrictServerWebExchangeFirewall() | ||
firewall.setAllowUrlEncodedSlash(true) | ||
firewall.setAllowUrlEncodedDoubleSlash(true) | ||
bean.setFirewall(firewall) | ||
} | ||
return bean | ||
} | ||
fun httpFirewall(): ServerWebExchangeFirewall = | ||
StrictServerWebExchangeFirewall().apply { | ||
setAllowUrlEncodedDoubleSlash(true) | ||
setAllowUrlEncodedSlash(true) | ||
setAllowUrlEncodedPercent(true) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters