Re-Introduce authentication specific properties
This commit is contained in:
parent
e009d3e47d
commit
41cbbeba79
|
@ -45,7 +45,7 @@ import org.crsh.vfs.spi.FSDriver;
|
|||
import org.springframework.beans.factory.ListableBeanFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.properties.ShellProperties;
|
||||
import org.springframework.boot.actuate.properties.ShellProperties.CrshShellProperties;
|
||||
import org.springframework.boot.actuate.properties.ShellProperties.CrshShellAuthenticationProperties;
|
||||
import org.springframework.boot.actuate.properties.ShellProperties.JaasAuthenticationProperties;
|
||||
import org.springframework.boot.actuate.properties.ShellProperties.KeyAuthenticationProperties;
|
||||
import org.springframework.boot.actuate.properties.ShellProperties.SimpleAuthenticationProperties;
|
||||
|
@ -110,25 +110,29 @@ public class CrshAutoConfiguration {
|
|||
|
||||
@Bean
|
||||
@ConditionalOnExpression("'${shell.auth:simple}' == 'jaas'")
|
||||
public CrshShellProperties jaasAuthenticationProperties() {
|
||||
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class })
|
||||
public CrshShellAuthenticationProperties jaasAuthenticationProperties() {
|
||||
return new JaasAuthenticationProperties();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnExpression("'${shell.auth:simple}' == 'key'")
|
||||
public CrshShellProperties keyAuthenticationProperties() {
|
||||
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class })
|
||||
public CrshShellAuthenticationProperties keyAuthenticationProperties() {
|
||||
return new KeyAuthenticationProperties();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnExpression("'${shell.auth:simple}' == 'simple'")
|
||||
public CrshShellProperties simpleAuthenticationProperties() {
|
||||
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class })
|
||||
public CrshShellAuthenticationProperties simpleAuthenticationProperties() {
|
||||
return new SimpleAuthenticationProperties();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnExpression("'${shell.auth:simple}' == 'spring'")
|
||||
public CrshShellProperties SpringAuthenticationProperties() {
|
||||
@ConditionalOnMissingBean({ CrshShellAuthenticationProperties.class })
|
||||
public CrshShellAuthenticationProperties SpringAuthenticationProperties() {
|
||||
return new SpringAuthenticationProperties();
|
||||
}
|
||||
|
||||
|
@ -142,7 +146,7 @@ public class CrshAutoConfiguration {
|
|||
|
||||
@Configuration
|
||||
@ConditionalOnBean({ AuthenticationManager.class })
|
||||
public static class ShellAuthenticationManager {
|
||||
public static class AuthenticationManagerAdapterAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public CRaSHPlugin<?> shellAuthenticationManager() {
|
||||
|
|
|
@ -149,7 +149,7 @@ public class ShellProperties {
|
|||
}
|
||||
|
||||
/**
|
||||
* Base class for Auth specific properties.
|
||||
* Base class for CRaSH properties.
|
||||
*/
|
||||
public static abstract class CrshShellProperties {
|
||||
|
||||
|
@ -160,6 +160,14 @@ public class ShellProperties {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Base class for Auth specific properties.
|
||||
*/
|
||||
public static abstract class CrshShellAuthenticationProperties extends
|
||||
CrshShellProperties {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* SSH properties
|
||||
*/
|
||||
|
@ -236,7 +244,8 @@ public class ShellProperties {
|
|||
* Auth specific properties for JAAS authentication
|
||||
*/
|
||||
@ConfigurationProperties(name = "shell.auth.jaas", ignoreUnknownFields = false)
|
||||
public static class JaasAuthenticationProperties extends CrshShellProperties {
|
||||
public static class JaasAuthenticationProperties extends
|
||||
CrshShellAuthenticationProperties {
|
||||
|
||||
private String domain = "my-domain";
|
||||
|
||||
|
@ -256,7 +265,8 @@ public class ShellProperties {
|
|||
* Auth specific properties for key authentication
|
||||
*/
|
||||
@ConfigurationProperties(name = "shell.auth.key", ignoreUnknownFields = false)
|
||||
public static class KeyAuthenticationProperties extends CrshShellProperties {
|
||||
public static class KeyAuthenticationProperties extends
|
||||
CrshShellAuthenticationProperties {
|
||||
|
||||
private String path;
|
||||
|
||||
|
@ -278,7 +288,8 @@ public class ShellProperties {
|
|||
* Auth specific properties for simple authentication
|
||||
*/
|
||||
@ConfigurationProperties(name = "shell.auth.simple", ignoreUnknownFields = false)
|
||||
public static class SimpleAuthenticationProperties extends CrshShellProperties {
|
||||
public static class SimpleAuthenticationProperties extends
|
||||
CrshShellAuthenticationProperties {
|
||||
|
||||
private static Log logger = LogFactory
|
||||
.getLog(SimpleAuthenticationProperties.class);
|
||||
|
@ -323,7 +334,8 @@ public class ShellProperties {
|
|||
* Auth specific properties for Spring authentication
|
||||
*/
|
||||
@ConfigurationProperties(name = "shell.auth.spring", ignoreUnknownFields = false)
|
||||
public static class SpringAuthenticationProperties extends CrshShellProperties {
|
||||
public static class SpringAuthenticationProperties extends
|
||||
CrshShellAuthenticationProperties {
|
||||
|
||||
private String[] roles = new String[] { "ROLE_ADMIN" };
|
||||
|
||||
|
|
Loading…
Reference in New Issue