Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
41cbbeba
Commit
41cbbeba
authored
Nov 18, 2013
by
Christian Dupuis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Re-Introduce authentication specific properties
parent
e009d3e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
11 deletions
+27
-11
CrshAutoConfiguration.java
...ork/boot/actuate/autoconfigure/CrshAutoConfiguration.java
+10
-6
ShellProperties.java
...ingframework/boot/actuate/properties/ShellProperties.java
+17
-5
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/CrshAutoConfiguration.java
View file @
41cbbeba
...
...
@@ -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.CrshShell
Authentication
Properties
;
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
()
{
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/properties/ShellProperties.java
View file @
41cbbeba
...
...
@@ -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"
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment