Skip to content

Commit edffabe

Browse files
committed
Make sure Spring related security beans for the shell are not installed if not wanted
refs #1121
1 parent f8e847a commit edffabe

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ public PluginLifeCycle shellBootstrap() {
155155
* Class to configure CRaSH to authenticate against Spring Security.
156156
*/
157157
@Configuration
158+
@ConditionalOnExpression("'${shell.auth:spring}' == 'spring'")
158159
@ConditionalOnBean({ AuthenticationManager.class })
159160
@AutoConfigureAfter(CrshAutoConfiguration.class)
160161
public static class AuthenticationManagerAdapterAutoConfiguration {
@@ -168,7 +169,6 @@ public CRaSHPlugin<?> shellAuthenticationManager() {
168169
}
169170

170171
@Bean
171-
@ConditionalOnExpression("'${shell.auth:spring}' == 'spring'")
172172
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class })
173173
public CrshShellAuthenticationProperties springAuthenticationProperties() {
174174
// In case no shell.auth property is provided fall back to Spring Security

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,8 @@ protected void applyToCrshShellConfig(Properties config) {
427427
}
428428

429429
public void setRoles(String[] roles) {
430-
// 'roles' can be empty. This means no special to access right to connect to
430+
// 'roles' can be null. This means no special to access right to connect to
431431
// shell is required.
432-
Assert.notNull(roles, "roles must not be null");
433432
this.roles = roles;
434433
}
435434

0 commit comments

Comments
 (0)