Make sure Spring related security beans for the shell are not installed if not wanted

refs #1121
This commit is contained in:
Christian Dupuis
2014-06-18 16:56:35 +02:00
parent f8e847a6fc
commit edffabeee4
2 changed files with 2 additions and 3 deletions

View File

@@ -155,6 +155,7 @@ public class CrshAutoConfiguration {
* Class to configure CRaSH to authenticate against Spring Security.
*/
@Configuration
@ConditionalOnExpression("'${shell.auth:spring}' == 'spring'")
@ConditionalOnBean({ AuthenticationManager.class })
@AutoConfigureAfter(CrshAutoConfiguration.class)
public static class AuthenticationManagerAdapterAutoConfiguration {
@@ -168,7 +169,6 @@ public class CrshAutoConfiguration {
}
@Bean
@ConditionalOnExpression("'${shell.auth:spring}' == 'spring'")
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class })
public CrshShellAuthenticationProperties springAuthenticationProperties() {
// In case no shell.auth property is provided fall back to Spring Security

View File

@@ -427,9 +427,8 @@ public class ShellProperties {
}
public void setRoles(String[] roles) {
// 'roles' can be empty. This means no special to access right to connect to
// 'roles' can be null. This means no special to access right to connect to
// shell is required.
Assert.notNull(roles, "roles must not be null");
this.roles = roles;
}