|
|
|
@ -124,28 +124,28 @@ public class CrshAutoConfiguration { |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
|
@ConditionalOnProperty(prefix = "shell", name = "auth", havingValue = "jaas") |
|
|
|
@ConditionalOnProperty(prefix = "shell", name = "auth", havingValue = "jaas") |
|
|
|
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class }) |
|
|
|
@ConditionalOnMissingBean(CrshShellAuthenticationProperties.class) |
|
|
|
public CrshShellAuthenticationProperties jaasAuthenticationProperties() { |
|
|
|
public JaasAuthenticationProperties jaasAuthenticationProperties() { |
|
|
|
return new JaasAuthenticationProperties(); |
|
|
|
return new JaasAuthenticationProperties(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
|
@ConditionalOnProperty(prefix = "shell", name = "auth", havingValue = "key") |
|
|
|
@ConditionalOnProperty(prefix = "shell", name = "auth", havingValue = "key") |
|
|
|
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class }) |
|
|
|
@ConditionalOnMissingBean(CrshShellAuthenticationProperties.class) |
|
|
|
public CrshShellAuthenticationProperties keyAuthenticationProperties() { |
|
|
|
public KeyAuthenticationProperties keyAuthenticationProperties() { |
|
|
|
return new KeyAuthenticationProperties(); |
|
|
|
return new KeyAuthenticationProperties(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
|
@ConditionalOnProperty(prefix = "shell", name = "auth", havingValue = "simple", matchIfMissing = true) |
|
|
|
@ConditionalOnProperty(prefix = "shell", name = "auth", havingValue = "simple", matchIfMissing = true) |
|
|
|
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class }) |
|
|
|
@ConditionalOnMissingBean(CrshShellAuthenticationProperties.class) |
|
|
|
public CrshShellAuthenticationProperties simpleAuthenticationProperties() { |
|
|
|
public SimpleAuthenticationProperties simpleAuthenticationProperties() { |
|
|
|
return new SimpleAuthenticationProperties(); |
|
|
|
return new SimpleAuthenticationProperties(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
|
@ConditionalOnMissingBean({ PluginLifeCycle.class }) |
|
|
|
@ConditionalOnMissingBean(PluginLifeCycle.class) |
|
|
|
public PluginLifeCycle shellBootstrap() { |
|
|
|
public CrshBootstrapBean shellBootstrap() { |
|
|
|
CrshBootstrapBean bootstrapBean = new CrshBootstrapBean(); |
|
|
|
CrshBootstrapBean bootstrapBean = new CrshBootstrapBean(); |
|
|
|
bootstrapBean.setConfig(this.properties.asCrshShellConfig()); |
|
|
|
bootstrapBean.setConfig(this.properties.asCrshShellConfig()); |
|
|
|
return bootstrapBean; |
|
|
|
return bootstrapBean; |
|
|
|
@ -156,7 +156,7 @@ public class CrshAutoConfiguration { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Configuration |
|
|
|
@Configuration |
|
|
|
@ConditionalOnProperty(prefix = "shell", name = "auth", havingValue = "spring", matchIfMissing = true) |
|
|
|
@ConditionalOnProperty(prefix = "shell", name = "auth", havingValue = "spring", matchIfMissing = true) |
|
|
|
@ConditionalOnBean({ AuthenticationManager.class }) |
|
|
|
@ConditionalOnBean(AuthenticationManager.class) |
|
|
|
@AutoConfigureAfter(CrshAutoConfiguration.class) |
|
|
|
@AutoConfigureAfter(CrshAutoConfiguration.class) |
|
|
|
public static class AuthenticationManagerAdapterAutoConfiguration { |
|
|
|
public static class AuthenticationManagerAdapterAutoConfiguration { |
|
|
|
|
|
|
|
|
|
|
|
@ -164,13 +164,13 @@ public class CrshAutoConfiguration { |
|
|
|
private ManagementServerProperties management; |
|
|
|
private ManagementServerProperties management; |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
|
public CRaSHPlugin<?> shellAuthenticationManager() { |
|
|
|
public AuthenticationManagerAdapter shellAuthenticationManager() { |
|
|
|
return new AuthenticationManagerAdapter(); |
|
|
|
return new AuthenticationManagerAdapter(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Bean |
|
|
|
@Bean |
|
|
|
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class }) |
|
|
|
@ConditionalOnMissingBean(CrshShellAuthenticationProperties.class) |
|
|
|
public CrshShellAuthenticationProperties springAuthenticationProperties() { |
|
|
|
public SpringAuthenticationProperties springAuthenticationProperties() { |
|
|
|
// In case no shell.auth property is provided fall back to Spring Security
|
|
|
|
// In case no shell.auth property is provided fall back to Spring Security
|
|
|
|
// based authentication and get role to access shell from
|
|
|
|
// based authentication and get role to access shell from
|
|
|
|
// ManagementServerProperties.
|
|
|
|
// ManagementServerProperties.
|
|
|
|
|