@Configuration @ConditionalOnClass(value=org.crsh.plugin.PluginLifeCycle.class) @EnableConfigurationProperties(value=ShellProperties.class) public class CrshAutoConfiguration extends Object
Auto-configuration
for embedding an extensible shell
into a Spring Boot enabled application. By default a SSH daemon is started on port
2000. If the CRaSH Telnet plugin is available on the classpath, Telnet daemon will be
launched on port 5000.
The default shell authentication method uses a username and password combination. If no
configuration is provided the default username is 'user' and the password will be
printed to console during application startup. Those default values can be overridden
by using shell.auth.simple.username
and shell.auth.simple.password
.
If a Spring Security AuthenticationManager
is detected, this configuration will
create a CRaSHPlugin
to forward shell authentication requests to Spring
Security. This authentication method will get enabled if shell.auth
is set to
spring
or if no explicit shell.auth
is provided and a
AuthenticationManager
is available. In the latter case shell access will be
restricted to users having roles that match those configured in
ManagementServerProperties
. Required roles can be overridden by
shell.auth.spring.roles
.
To add customizations to the shell simply define beans of type CRaSHPlugin
in
the application context. Those beans will get auto detected during startup and
registered with the underlying shell infrastructure. To configure plugins and the CRaSH
infrastructure add beans of type ShellProperties.CrshShellProperties
to the application
context.
Additional shell commands can be implemented using the guide and documentation at
crashub.org. By default Boot will search for
commands using the following classpath scanning pattern classpath*:/commands/**
. To add different locations or override the default use
shell.command_path_patterns
in your application configuration.
ShellProperties
Modifier and Type | Class and Description |
---|---|
static class |
CrshAutoConfiguration.AuthenticationManagerAdapterAutoConfiguration
Class to configure CRaSH to authenticate against Spring Security.
|
static class |
CrshAutoConfiguration.CrshBootstrapBean
Spring Bean used to bootstrap the CRaSH shell.
|
Constructor and Description |
---|
CrshAutoConfiguration() |
@Bean @ConditionalOnMissingBean(value=ShellProperties.CrshShellAuthenticationProperties.class) public ShellProperties.JaasAuthenticationProperties jaasAuthenticationProperties()
@Bean @ConditionalOnMissingBean(value=ShellProperties.CrshShellAuthenticationProperties.class) public ShellProperties.KeyAuthenticationProperties keyAuthenticationProperties()
@Bean @ConditionalOnMissingBean(value=ShellProperties.CrshShellAuthenticationProperties.class) public ShellProperties.SimpleAuthenticationProperties simpleAuthenticationProperties()
@Bean @ConditionalOnMissingBean(value=org.crsh.plugin.PluginLifeCycle.class) public CrshAutoConfiguration.CrshBootstrapBean shellBootstrap()
Copyright © 2016 Pivotal Software, Inc.. All rights reserved.