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
This commit is contained in:
Christian Dupuis 2014-06-20 13:58:33 +02:00
parent 9d5c371cf1
commit b5d65bfc56
2 changed files with 4 additions and 1 deletions

View File

@ -43,6 +43,7 @@ import org.crsh.vfs.spi.AbstractFSDriver;
import org.crsh.vfs.spi.FSDriver;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.actuate.autoconfigure.ShellProperties.CrshShellAuthenticationProperties;
import org.springframework.boot.actuate.autoconfigure.ShellProperties.CrshShellProperties;
import org.springframework.boot.actuate.autoconfigure.ShellProperties.JaasAuthenticationProperties;
@ -280,6 +281,7 @@ public class CrshAutoConfiguration {
private AuthenticationManager authenticationManager;
@Autowired(required = false)
@Qualifier("shellAccessDecisionManager")
private AccessDecisionManager accessDecisionManager;
private String[] roles = new String[] { "ADMIN" };

View File

@ -372,7 +372,7 @@ public class CrshAutoConfigurationTests {
}
@Bean
public AccessDecisionManager accessDecisionManager() {
public AccessDecisionManager shellAccessDecisionManager() {
List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
RoleVoter voter = new RoleVoter();
voter.setRolePrefix("");
@ -380,6 +380,7 @@ public class CrshAutoConfigurationTests {
AccessDecisionManager result = new UnanimousBased(voters);
return result;
}
}
}