Skip to content

Commit b5d65bf

Browse files
committed
Delegate shell access decision to bean named "shellAccessDecisionManager"
In order to solve issues with multiple or incompatible AccessDecisionManagers, the CRaSH integration will now only delegate to an explicit shellAccessDecisionManager bean refs #1121
1 parent 9d5c371 commit b5d65bf

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import org.crsh.vfs.spi.FSDriver;
4444
import org.springframework.beans.factory.ListableBeanFactory;
4545
import org.springframework.beans.factory.annotation.Autowired;
46+
import org.springframework.beans.factory.annotation.Qualifier;
4647
import org.springframework.boot.actuate.autoconfigure.ShellProperties.CrshShellAuthenticationProperties;
4748
import org.springframework.boot.actuate.autoconfigure.ShellProperties.CrshShellProperties;
4849
import org.springframework.boot.actuate.autoconfigure.ShellProperties.JaasAuthenticationProperties;
@@ -280,6 +281,7 @@ private static class AuthenticationManagerAdapter extends
280281
private AuthenticationManager authenticationManager;
281282

282283
@Autowired(required = false)
284+
@Qualifier("shellAccessDecisionManager")
283285
private AccessDecisionManager accessDecisionManager;
284286

285287
private String[] roles = new String[] { "ADMIN" };

spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfigurationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,14 +372,15 @@ public Authentication authenticate(Authentication authentication)
372372
}
373373

374374
@Bean
375-
public AccessDecisionManager accessDecisionManager() {
375+
public AccessDecisionManager shellAccessDecisionManager() {
376376
List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
377377
RoleVoter voter = new RoleVoter();
378378
voter.setRolePrefix("");
379379
voters.add(voter);
380380
AccessDecisionManager result = new UnanimousBased(voters);
381381
return result;
382382
}
383+
383384
}
384385

385386
}

0 commit comments

Comments
 (0)