Skip to content

Commit

Permalink
spring-boot: revert v3.3.5 workarounds (#27961)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Nov 21, 2024
1 parent 790840a commit a3a8525
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ import tech.jhipster.web.filter.CookieCsrfFilter;
<%_ if (!skipClient) { _%>
import <%= packageName %>.web.filter.SpaWebFilter;
<%_ } _%>
<%_ if (applicationTypeGateway) { _%>
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
<%_ } _%>
<%_ if (authenticationUsesCsrf && !applicationTypeMicroservice) { _%>
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
Expand Down Expand Up @@ -117,10 +113,6 @@ import <%= packageName %>.security.oauth2.CustomClaimConverter;
<%_ if(!skipClient) { _%>
import org.springframework.security.web.header.writers.ReferrerPolicyHeaderWriter;
<%_ } _%>
<%_ if (applicationTypeGateway) { _%>
import org.springframework.security.web.server.WebFilterChainProxy;
import org.springframework.security.web.server.firewall.ServerWebExchangeFirewall;
<%_ } _%>
<%_ if (authenticationUsesCsrf && !applicationTypeMicroservice) { _%>
import org.springframework.util.StringUtils;
<%_ } _%>
Expand Down Expand Up @@ -424,20 +416,4 @@ public class SecurityConfiguration {
}
}
<%_ } _%>
<%_ if (applicationTypeGateway) { _%>

// Fix for Spring Boot 3.3.5: https://github.com/spring-cloud/spring-cloud-gateway/issues/3568
@Bean
BeanPostProcessor beanPostProcessor() {
return new BeanPostProcessor() {
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof WebFilterChainProxy springSecurity) {
springSecurity.setFirewall(ServerWebExchangeFirewall.INSECURE_NOOP);
}
return bean;
}
};
}
<%_ } _%>
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ import org.springframework.boot.autoconfigure.security.SecurityProperties;
<%_ if (!skipClient) { _%>
import <%= packageName %>.web.filter.SpaWebFilter;
<%_ } _%>
<%_ if (applicationTypeGateway) { _%>
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
<%_ } _%>
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
<%_ if (authenticationTypeOauth2) { _%>
Expand Down Expand Up @@ -118,10 +114,6 @@ import org.springframework.security.web.server.savedrequest.NoOpServerRequestCac
<%_ } _%>
import org.springframework.security.web.server.util.matcher.NegatedServerWebExchangeMatcher;
import org.springframework.security.web.server.util.matcher.OrServerWebExchangeMatcher;
<%_ if (applicationTypeGateway) { _%>
import org.springframework.security.web.server.WebFilterChainProxy;
import org.springframework.security.web.server.firewall.ServerWebExchangeFirewall;
<%_ } _%>
<%_ if (authenticationUsesCsrf) { _%>
import reactor.core.publisher.Mono;
<%_ } _%>
Expand Down Expand Up @@ -490,20 +482,4 @@ public class SecurityConfiguration {
return Mono.empty();
}
<%_ } _%>
<%_ if (applicationTypeGateway) { _%>

// Fix for Spring Boot 3.3.5: https://github.com/spring-cloud/spring-cloud-gateway/issues/3568
@Bean
BeanPostProcessor beanPostProcessor() {
return new BeanPostProcessor() {
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof WebFilterChainProxy springSecurity) {
springSecurity.setFirewall(ServerWebExchangeFirewall.INSECURE_NOOP);
}
return bean;
}
};
}
<%_ } _%>
}

0 comments on commit a3a8525

Please sign in to comment.