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
e2a12e77
Commit
e2a12e77
authored
Feb 14, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.4.x' into 1.5.x
parents
a0ef61a2
6f3b4db7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
ConfigurationPropertiesReportEndpoint.java
...tuate/endpoint/ConfigurationPropertiesReportEndpoint.java
+1
-2
ConfigurationPropertiesReportEndpointTests.java
.../endpoint/ConfigurationPropertiesReportEndpointTests.java
+29
-0
No files found.
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpoint.java
View file @
e2a12e77
...
...
@@ -259,10 +259,9 @@ public class ConfigurationPropertiesReportEndpoint
sanitized
.
add
(
sanitize
(
prefix
,
(
Map
<
String
,
Object
>)
item
));
}
else
if
(
item
instanceof
List
)
{
sanitize
(
prefix
,
(
List
<
Object
>)
item
);
sanitize
d
.
add
(
sanitize
(
prefix
,
(
List
<
Object
>)
item
)
);
}
else
{
item
=
this
.
sanitizer
.
sanitize
(
prefix
,
item
);
sanitized
.
add
(
this
.
sanitizer
.
sanitize
(
prefix
,
item
));
}
}
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/ConfigurationPropertiesReportEndpointTests.java
View file @
e2a12e77
...
...
@@ -17,6 +17,7 @@
package
org
.
springframework
.
boot
.
actuate
.
endpoint
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -212,6 +213,23 @@ public class ConfigurationPropertiesReportEndpointTests
assertThat
(
item
.
get
(
"somePassword"
)).
isEqualTo
(
"******"
);
}
@Test
@SuppressWarnings
(
"unchecked"
)
public
void
listsOfListsAreSanitized
()
throws
Exception
{
ConfigurationPropertiesReportEndpoint
report
=
getEndpointBean
();
Map
<
String
,
Object
>
properties
=
report
.
invoke
();
Map
<
String
,
Object
>
nestedProperties
=
(
Map
<
String
,
Object
>)
((
Map
<
String
,
Object
>)
properties
.
get
(
"testProperties"
)).
get
(
"properties"
);
assertThat
(
nestedProperties
.
get
(
"listOfListItems"
)).
isInstanceOf
(
List
.
class
);
List
<
List
<
Object
>>
listOfLists
=
(
List
<
List
<
Object
>>)
nestedProperties
.
get
(
"listOfListItems"
);
assertThat
(
listOfLists
).
hasSize
(
1
);
List
<
Object
>
list
=
listOfLists
.
get
(
0
);
assertThat
(
list
).
hasSize
(
1
);
Map
<
String
,
Object
>
item
=
(
Map
<
String
,
Object
>)
list
.
get
(
0
);
assertThat
(
item
.
get
(
"somePassword"
)).
isEqualTo
(
"******"
);
}
@Configuration
@EnableConfigurationProperties
public
static
class
Parent
{
...
...
@@ -254,10 +272,13 @@ public class ConfigurationPropertiesReportEndpointTests
private
List
<
ListItem
>
listItems
=
new
ArrayList
<
ListItem
>();
private
List
<
List
<
ListItem
>>
listOfListItems
=
new
ArrayList
<
List
<
ListItem
>>();
public
TestProperties
()
{
this
.
secrets
.
put
(
"mine"
,
"myPrivateThing"
);
this
.
secrets
.
put
(
"yours"
,
"yourPrivateThing"
);
this
.
listItems
.
add
(
new
ListItem
());
this
.
listOfListItems
.
add
(
Arrays
.
asList
(
new
ListItem
()));
}
public
String
getDbPassword
()
{
...
...
@@ -308,6 +329,14 @@ public class ConfigurationPropertiesReportEndpointTests
this
.
listItems
=
listItems
;
}
public
List
<
List
<
ListItem
>>
getListOfListItems
()
{
return
this
.
listOfListItems
;
}
public
void
setListOfListItems
(
List
<
List
<
ListItem
>>
listOfListItems
)
{
this
.
listOfListItems
=
listOfListItems
;
}
public
static
class
Hidden
{
private
String
mine
=
"mySecret"
;
...
...
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