diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java index db9ed20424..f7fc6dd765 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java @@ -93,12 +93,12 @@ import org.springframework.util.StringUtils; *
* If a Spring Security {@link AuthenticationManager} is detected, this configuration will * create a {@link CRaSHPlugin} to forward shell authentication requests to Spring - * Security. This authentication method will get enabled if {@code management.shell.auth.type} - * is set to {@code spring} or if no explicit {@code management.shell.auth} is provided - * and a {@link AuthenticationManager} is available. In the latter case shell access will - * be restricted to users having roles that match those configured in - * {@link ManagementServerProperties}. Required roles can be overridden by - * {@code management.shell.auth.spring.roles}. + * Security. This authentication method will get enabled if + * {@code management.shell.auth.type} is set to {@code spring} or if no explicit + * {@code management.shell.auth} is provided and a {@link AuthenticationManager} is + * available. In the latter case shell access will be restricted to users having roles + * that match those configured in {@link ManagementServerProperties}. Required roles can + * be overridden by {@code management.shell.auth.spring.roles}. *
* To add customizations to the shell simply define beans of type {@link CRaSHPlugin} in
* the application context. Those beans will get auto detected during startup and
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/LocalManagementPort.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/LocalManagementPort.java
index d61a0bec08..46ad260e96 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/LocalManagementPort.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/LocalManagementPort.java
@@ -38,4 +38,5 @@ import org.springframework.beans.factory.annotation.Value;
@Documented
@Value("${local.management.port}")
public @interface LocalManagementPort {
+
}
diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java
index c3981ea1b5..9852788b1e 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java
@@ -375,7 +375,8 @@ public class ShellProperties {
/**
* Auth specific properties for JAAS authentication.
*/
- @ConfigurationProperties(prefix = SHELL_PREFIX + ".auth.jaas", ignoreUnknownFields = false)
+ @ConfigurationProperties(prefix = SHELL_PREFIX
+ + ".auth.jaas", ignoreUnknownFields = false)
public static class JaasAuthenticationProperties
extends CrshShellAuthenticationProperties {
@@ -404,7 +405,8 @@ public class ShellProperties {
/**
* Auth specific properties for key authentication.
*/
- @ConfigurationProperties(prefix = SHELL_PREFIX + ".auth.key", ignoreUnknownFields = false)
+ @ConfigurationProperties(prefix = SHELL_PREFIX
+ + ".auth.key", ignoreUnknownFields = false)
public static class KeyAuthenticationProperties
extends CrshShellAuthenticationProperties {
@@ -435,7 +437,8 @@ public class ShellProperties {
/**
* Auth specific properties for simple authentication.
*/
- @ConfigurationProperties(prefix = SHELL_PREFIX + ".auth.simple", ignoreUnknownFields = false)
+ @ConfigurationProperties(prefix = SHELL_PREFIX
+ + ".auth.simple", ignoreUnknownFields = false)
public static class SimpleAuthenticationProperties
extends CrshShellAuthenticationProperties {
@@ -511,7 +514,8 @@ public class ShellProperties {
/**
* Auth specific properties for Spring authentication.
*/
- @ConfigurationProperties(prefix = SHELL_PREFIX + ".auth.spring", ignoreUnknownFields = false)
+ @ConfigurationProperties(prefix = SHELL_PREFIX
+ + ".auth.spring", ignoreUnknownFields = false)
public static class SpringAuthenticationProperties
extends CrshShellAuthenticationProperties {
diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfigurationTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfigurationTests.java
index 973b8e573e..2b4cb7089e 100644
--- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfigurationTests.java
+++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfigurationTests.java
@@ -81,8 +81,8 @@ public class CrshAutoConfigurationTests {
@Test
public void testDisabledPlugins() throws Exception {
- load("management.shell.disabled_plugins=" +
- "termIOHandler, org.crsh.auth.AuthenticationPlugin, javaLanguage");
+ load("management.shell.disabled_plugins="
+ + "termIOHandler, org.crsh.auth.AuthenticationPlugin, javaLanguage");
PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);
assertThat(lifeCycle).isNotNull();
assertThat(lifeCycle.getContext().getPlugins(TermIOHandler.class))
@@ -109,8 +109,7 @@ public class CrshAutoConfigurationTests {
@Test
public void testSshConfiguration() {
- load("management.shell.ssh.enabled=true",
- "management.shell.ssh.port=3333");
+ load("management.shell.ssh.enabled=true", "management.shell.ssh.port=3333");
PluginLifeCycle lifeCycle = this.context.getBean(PluginLifeCycle.class);
assertThat(lifeCycle.getConfig().getProperty("crash.ssh.port")).isEqualTo("3333");
assertThat(lifeCycle.getConfig().getProperty("crash.ssh.auth_timeout"))
@@ -140,7 +139,6 @@ public class CrshAutoConfigurationTests {
.isEqualTo("400000");
}
-
@Test
public void testCommandResolution() {
load();
@@ -329,7 +327,6 @@ public class CrshAutoConfigurationTests {
this.context.refresh();
}
-
@Configuration
public static class SecurityConfiguration {
diff --git a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ShellPropertiesTests.java b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ShellPropertiesTests.java
index 288a9d9553..577265879d 100644
--- a/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ShellPropertiesTests.java
+++ b/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/autoconfigure/ShellPropertiesTests.java
@@ -65,7 +65,8 @@ public class ShellPropertiesTests {
@Test
public void testBindingAuth() {
- ShellProperties props = load(ShellProperties.class, "management.shell.auth.type=spring");
+ ShellProperties props = load(ShellProperties.class,
+ "management.shell.auth.type=spring");
assertThat(props.getAuth().getType()).isEqualTo("spring");
}
@@ -78,7 +79,8 @@ public class ShellPropertiesTests {
@Test
public void testBindingCommandRefreshInterval() {
- ShellProperties props = load(ShellProperties.class, "management.shell.command-refresh-interval=1");
+ ShellProperties props = load(ShellProperties.class,
+ "management.shell.command-refresh-interval=1");
assertThat(props.getCommandRefreshInterval()).isEqualTo(1);
}
@@ -87,7 +89,7 @@ public class ShellPropertiesTests {
ShellProperties props = load(ShellProperties.class,
"management.shell.command-path-patterns=pattern1, pattern2");
assertThat(props.getCommandPathPatterns().length).isEqualTo(2);
- Assert.assertArrayEquals(new String[] {"pattern1", "pattern2"},
+ Assert.assertArrayEquals(new String[] { "pattern1", "pattern2" },
props.getCommandPathPatterns());
}
@@ -96,7 +98,7 @@ public class ShellPropertiesTests {
ShellProperties props = load(ShellProperties.class,
"management.shell.config-path-patterns=pattern1, pattern2");
assertThat(props.getConfigPathPatterns().length).isEqualTo(2);
- Assert.assertArrayEquals(new String[] {"pattern1", "pattern2"},
+ Assert.assertArrayEquals(new String[] { "pattern1", "pattern2" },
props.getConfigPathPatterns());
}
@@ -118,8 +120,7 @@ public class ShellPropertiesTests {
@Test
public void testBindingSsh() {
ShellProperties props = load(ShellProperties.class,
- "management.shell.ssh.enabled=true",
- "management.shell.ssh.port=2222",
+ "management.shell.ssh.enabled=true", "management.shell.ssh.port=2222",
"management.shell.ssh.key-path=~/.ssh/test.pem");
Properties p = props.asCrshShellConfig();
assertThat(p.get("crash.ssh.port")).isEqualTo("2222");
@@ -129,8 +130,7 @@ public class ShellPropertiesTests {
@Test
public void testBindingSshIgnored() {
ShellProperties props = load(ShellProperties.class,
- "management.shell.ssh.enabled=false",
- "management.shell.ssh.port=2222",
+ "management.shell.ssh.enabled=false", "management.shell.ssh.port=2222",
"management.shell.ssh.key-path=~/.ssh/test.pem");
Properties p = props.asCrshShellConfig();
assertThat(p.get("crash.ssh.port")).isNull();
@@ -194,14 +194,16 @@ public class ShellPropertiesTests {
@Test
public void testDefaultPasswordAutoGeneratedIfUnresolvedPlaceholder() {
- SimpleAuthenticationProperties security = load(SimpleAuthenticationProperties.class,
+ SimpleAuthenticationProperties security = load(
+ SimpleAuthenticationProperties.class,
"management.shell.auth.simple.user.password=${ADMIN_PASSWORD}");
assertThat(security.getUser().isDefaultPassword()).isTrue();
}
@Test
public void testDefaultPasswordAutoGeneratedIfEmpty() {
- SimpleAuthenticationProperties security = load(SimpleAuthenticationProperties.class,
+ SimpleAuthenticationProperties security = load(
+ SimpleAuthenticationProperties.class,
"management.shell.auth.simple.user.password=");
assertThat(security.getUser().isDefaultPassword()).isTrue();
}
@@ -242,9 +244,9 @@ public class ShellPropertiesTests {
}
@Configuration
- @EnableConfigurationProperties({ShellProperties.class,
+ @EnableConfigurationProperties({ ShellProperties.class,
JaasAuthenticationProperties.class, KeyAuthenticationProperties.class,
- SimpleAuthenticationProperties.class, SpringAuthenticationProperties.class})
+ SimpleAuthenticationProperties.class, SpringAuthenticationProperties.class })
static class TestConfiguration {
}
diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ws/WsAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java
similarity index 87%
rename from spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ws/WsAutoConfiguration.java
rename to spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java
index 36c61b3677..52b2a5b89f 100644
--- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ws/WsAutoConfiguration.java
+++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/webservices/WebServicesAutoConfiguration.java
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.springframework.boot.autoconfigure.ws;
+package org.springframework.boot.autoconfigure.webservices;
import java.util.Map;
@@ -44,13 +44,13 @@ import org.springframework.ws.transport.http.MessageDispatcherServlet;
@ConditionalOnWebApplication
@ConditionalOnClass(MessageDispatcherServlet.class)
@ConditionalOnMissingBean(WsConfigurationSupport.class)
-@EnableConfigurationProperties(WsProperties.class)
+@EnableConfigurationProperties(WebServicesProperties.class)
@AutoConfigureAfter(EmbeddedServletContainerAutoConfiguration.class)
-public class WsAutoConfiguration {
+public class WebServicesAutoConfiguration {
- private final WsProperties properties;
+ private final WebServicesProperties properties;
- public WsAutoConfiguration(WsProperties properties) {
+ public WebServicesAutoConfiguration(WebServicesProperties properties) {
this.properties = properties;
}
@@ -61,9 +61,9 @@ public class WsAutoConfiguration {
servlet.setApplicationContext(applicationContext);
String path = this.properties.getPath();
String urlMapping = (path.endsWith("/") ? path + "*" : path + "/*");
- ServletRegistrationBean registration = new ServletRegistrationBean(
- servlet, urlMapping);
- WsProperties.Servlet servletProperties = this.properties.getServlet();
+ ServletRegistrationBean registration = new ServletRegistrationBean(servlet,
+ urlMapping);
+ WebServicesProperties.Servlet servletProperties = this.properties.getServlet();
registration.setLoadOnStartup(servletProperties.getLoadOnStartup());
for (Map.Entry