Skip to content

Commit 5c84e17

Browse files
Marius Bogoeviciwilkinsona
authored andcommitted
Activate WebSecurityEnabler only for web applications
Done in order to align with the rest of the configuration. Absent this check, the bean will be installed in non-web applications without the corresponding dependencies, causing the bootstrap to fail. Closes gh-1588
1 parent a8af254 commit 5c84e17

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementSecurityAutoConfiguration.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ private String normalizePath(String errorPath) {
165165
@Configuration
166166
@ConditionalOnExpression("${management.security.enabled:true} && !${security.basic.enabled:true}")
167167
@ConditionalOnMissingBean(WebSecurityConfiguration.class)
168+
@ConditionalOnWebApplication
168169
@EnableWebSecurity
169170
protected static class WebSecurityEnabler extends AuthenticationManagerConfiguration {
170171
}

0 commit comments

Comments
 (0)