Commit b5d65bfc authored by Christian Dupuis's avatar Christian Dupuis

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
parent 9d5c371c
...@@ -43,6 +43,7 @@ import org.crsh.vfs.spi.AbstractFSDriver; ...@@ -43,6 +43,7 @@ import org.crsh.vfs.spi.AbstractFSDriver;
import org.crsh.vfs.spi.FSDriver; import org.crsh.vfs.spi.FSDriver;
import org.springframework.beans.factory.ListableBeanFactory; import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.annotation.Autowired; 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.CrshShellAuthenticationProperties;
import org.springframework.boot.actuate.autoconfigure.ShellProperties.CrshShellProperties; import org.springframework.boot.actuate.autoconfigure.ShellProperties.CrshShellProperties;
import org.springframework.boot.actuate.autoconfigure.ShellProperties.JaasAuthenticationProperties; import org.springframework.boot.actuate.autoconfigure.ShellProperties.JaasAuthenticationProperties;
...@@ -280,6 +281,7 @@ public class CrshAutoConfiguration { ...@@ -280,6 +281,7 @@ public class CrshAutoConfiguration {
private AuthenticationManager authenticationManager; private AuthenticationManager authenticationManager;
@Autowired(required = false) @Autowired(required = false)
@Qualifier("shellAccessDecisionManager")
private AccessDecisionManager accessDecisionManager; private AccessDecisionManager accessDecisionManager;
private String[] roles = new String[] { "ADMIN" }; private String[] roles = new String[] { "ADMIN" };
......
...@@ -372,7 +372,7 @@ public class CrshAutoConfigurationTests { ...@@ -372,7 +372,7 @@ public class CrshAutoConfigurationTests {
} }
@Bean @Bean
public AccessDecisionManager accessDecisionManager() { public AccessDecisionManager shellAccessDecisionManager() {
List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>(); List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
RoleVoter voter = new RoleVoter(); RoleVoter voter = new RoleVoter();
voter.setRolePrefix(""); voter.setRolePrefix("");
...@@ -380,6 +380,7 @@ public class CrshAutoConfigurationTests { ...@@ -380,6 +380,7 @@ public class CrshAutoConfigurationTests {
AccessDecisionManager result = new UnanimousBased(voters); AccessDecisionManager result = new UnanimousBased(voters);
return result; return result;
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment