Skip to content

Commit

Permalink
Default secured filter registration to disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Sep 25, 2024
1 parent 05f1c22 commit fa2e6ff
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ ConfigurableSiteMeshFilter siteMeshFilter() {

@Bean
@ConditionalOnMissingBean(name = "sitemesh3")
public FilterRegistrationBean<ConfigurableSiteMeshFilter> sitemesh3(ConfigurableSiteMeshFilter siteMeshFilter){
public FilterRegistrationBean<ConfigurableSiteMeshFilter> sitemesh3(ConfigurableSiteMeshFilter siteMeshFilter) {
FilterRegistrationBean<ConfigurableSiteMeshFilter> registrationBean
= new FilterRegistrationBean<>();
registrationBean.setFilter(siteMeshFilter);
Expand All @@ -129,15 +129,11 @@ public FilterRegistrationBean<ConfigurableSiteMeshFilter> sitemesh3(Configurable
@Bean
@ConditionalOnMissingBean(name = "sitemesh3Secured")
@ConditionalOnClass(name = "org.springframework.security.config.annotation.web.configuration.EnableWebSecurity")
public FilterRegistrationBean<ConfigurableSiteMeshFilter> sitemesh3Secured(ConfigurableSiteMeshFilter siteMeshFilter){
public FilterRegistrationBean<ConfigurableSiteMeshFilter> sitemesh3Secured() {
FilterRegistrationBean<ConfigurableSiteMeshFilter> registrationBean
= new FilterRegistrationBean<>();
registrationBean.setFilter(makeFilter(attribute, defaultPath, metaTagName, prefix, mappings, exclusions, bundles, includeErrorPages, true));
registrationBean.addUrlPatterns("/*");
if (includeErrorPages) {
registrationBean.setDispatcherTypes(EnumSet.of(DispatcherType.REQUEST, DispatcherType.ERROR));
}
registrationBean.setOrder(org.springframework.boot.autoconfigure.security.SecurityProperties.BASIC_AUTH_ORDER - 9);
registrationBean.setEnabled(false);
return registrationBean;
}
}

0 comments on commit fa2e6ff

Please sign in to comment.