@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 management.shell.auth.simple.username
and
management.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
management.shell.auth.type
is set to spring
or if no explicit
management.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 management.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
management.shell.command-path-patterns
in your application configuration.
ShellProperties
Modifier and Type | Class and Description |
---|---|
static class |
CrshAutoConfiguration.AuthenticationManagerAdapterConfiguration
Class to configure CRaSH to authenticate against Spring Security.
|
static class |
CrshAutoConfiguration.CrshBootstrapBean
Spring Bean used to bootstrap the CRaSH shell.
|
Modifier and Type | Field and Description |
---|---|
static String |
AUTH_PREFIX |
Constructor and Description |
---|
CrshAutoConfiguration(ShellProperties properties) |
Modifier and Type | Method and Description |
---|---|
CrshAutoConfiguration.CrshBootstrapBean |
shellBootstrap() |
public static final String AUTH_PREFIX
public CrshAutoConfiguration(ShellProperties properties)
@Bean @ConditionalOnMissingBean(value=org.crsh.plugin.PluginLifeCycle.class) public CrshAutoConfiguration.CrshBootstrapBean shellBootstrap()
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.