Commit 2e926601 authored by Christian Dupuis's avatar Christian Dupuis

Polish

parent dba8c010
......@@ -133,7 +133,7 @@ public class CrshAutoConfiguration {
@Bean
@ConditionalOnExpression("'${shell.auth:simple}' == 'spring'")
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class })
public CrshShellAuthenticationProperties SpringAuthenticationProperties() {
public CrshShellAuthenticationProperties springAuthenticationProperties() {
return new SpringAuthenticationProperties();
}
......@@ -370,7 +370,7 @@ public class CrshAutoConfiguration {
}
/**
* {@link FSDriver} to expose Spring {@link Resource}s to CRaSH.
* {@link FSDriver} to wrap Spring's {@link Resource} abstraction to CRaSH.
*/
private static class SimpleFileSystemDriver extends AbstractFSDriver<ResourceHandle> {
......@@ -466,7 +466,7 @@ public class CrshAutoConfiguration {
}
/**
* {@link ResourceHandle} for a file.
* {@link ResourceHandle} for a file backed by a Spring {@link Resource}.
*/
private static class FileHandle extends ResourceHandle {
......
......@@ -337,14 +337,12 @@ public class ShellProperties {
public static class SpringAuthenticationProperties extends
CrshShellAuthenticationProperties {
private String[] roles = new String[] { "ROLE_ADMIN" };
private String[] roles = new String[] { "ADMIN" };
@Override
protected void applyToCrshShellConfig(Properties config) {
if (this.roles != null) {
config.put("crash.auth.spring.roles",
StringUtils.arrayToCommaDelimitedString(this.roles));
}
config.put("crash.auth.spring.roles",
StringUtils.arrayToCommaDelimitedString(this.roles));
}
public void setRoles(String[] roles) {
......
......@@ -314,8 +314,8 @@ public class CrshAutoConfigurationTests {
authentication = new UsernamePasswordAuthenticationToken(
authentication.getPrincipal(),
authentication.getCredentials(),
Collections.singleton(new SimpleGrantedAuthority(
"ROLE_ADMIN")));
Collections
.singleton(new SimpleGrantedAuthority("ADMIN")));
}
else {
throw new BadCredentialsException("Invalid username and password");
......@@ -328,7 +328,9 @@ public class CrshAutoConfigurationTests {
@Bean
public AccessDecisionManager accessDecisionManager() {
List<AccessDecisionVoter> voters = new ArrayList<AccessDecisionVoter>();
voters.add(new RoleVoter());
RoleVoter voter = new RoleVoter();
voter.setRolePrefix("");
voters.add(voter);
AccessDecisionManager result = new UnanimousBased(voters);
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