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
8de00277
Commit
8de00277
authored
Apr 21, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.2.x'
Closes gh-21062
parents
03a9738f
3065c88d
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
40 deletions
+41
-40
ExposeExcludePropertyEndpointFilter.java
...nfigure/endpoint/ExposeExcludePropertyEndpointFilter.java
+3
-3
OnAvailableEndpointCondition.java
...gure/endpoint/condition/OnAvailableEndpointCondition.java
+3
-3
IncludeExcludeEndpointFilter.java
...nfigure/endpoint/expose/IncludeExcludeEndpointFilter.java
+11
-11
JmxEndpointAutoConfiguration.java
...oconfigure/endpoint/jmx/JmxEndpointAutoConfiguration.java
+3
-3
ServletEndpointManagementContextConfiguration.java
...nt/web/ServletEndpointManagementContextConfiguration.java
+3
-3
WebEndpointAutoConfiguration.java
...oconfigure/endpoint/web/WebEndpointAutoConfiguration.java
+6
-6
IncludeExcludeEndpointFilterTests.java
...re/endpoint/expose/IncludeExcludeEndpointFilterTests.java
+10
-9
WebEndpointAutoConfigurationTests.java
...igure/endpoint/web/WebEndpointAutoConfigurationTests.java
+2
-2
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/ExposeExcludePropertyEndpointFilter.java
View file @
8de00277
...
...
@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.endpoint;
import
java.util.Collection
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.Includ
e
ExcludeEndpointFilter
;
import
org.springframework.boot.actuate.endpoint.EndpointFilter
;
import
org.springframework.boot.actuate.endpoint.ExposableEndpoint
;
import
org.springframework.core.env.Environment
;
...
...
@@ -30,11 +30,11 @@ import org.springframework.core.env.Environment;
* @param <E> the endpoint type
* @author Phillip Webb
* @since 2.0.0
* @deprecated since 2.2.7 in favor of {@link IncludExcludeEndpointFilter}
* @deprecated since 2.2.7 in favor of {@link Includ
e
ExcludeEndpointFilter}
*/
@Deprecated
public
class
ExposeExcludePropertyEndpointFilter
<
E
extends
ExposableEndpoint
<?>>
extends
IncludExcludeEndpointFilter
<
E
>
{
extends
Includ
e
ExcludeEndpointFilter
<
E
>
{
public
ExposeExcludePropertyEndpointFilter
(
Class
<
E
>
endpointType
,
Environment
environment
,
String
prefix
,
String
...
exposeDefaults
)
{
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/condition/OnAvailableEndpointCondition.java
View file @
8de00277
...
...
@@ -20,8 +20,8 @@ import java.util.HashSet;
import
java.util.Map
;
import
java.util.Set
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter.DefaultIncludes
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.Includ
e
ExcludeEndpointFilter
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.Includ
e
ExcludeEndpointFilter.DefaultIncludes
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.ExposableEndpoint
;
import
org.springframework.boot.autoconfigure.condition.ConditionMessage
;
...
...
@@ -87,7 +87,7 @@ class OnAvailableEndpointCondition extends AbstractEndpointCondition {
return
exposures
;
}
static
class
Exposure
extends
IncludExcludeEndpointFilter
<
ExposableEndpoint
<?>>
{
static
class
Exposure
extends
Includ
e
ExcludeEndpointFilter
<
ExposableEndpoint
<?>>
{
private
final
String
prefix
;
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludExcludeEndpointFilter.java
→
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/Includ
e
ExcludeEndpointFilter.java
View file @
8de00277
...
...
@@ -40,7 +40,7 @@ import org.springframework.util.Assert;
* @author Phillip Webb
* @since 2.2.7
*/
public
class
IncludExcludeEndpointFilter
<
E
extends
ExposableEndpoint
<?>>
implements
EndpointFilter
<
E
>
{
public
class
Includ
e
ExcludeEndpointFilter
<
E
extends
ExposableEndpoint
<?>>
implements
EndpointFilter
<
E
>
{
private
final
Class
<
E
>
endpointType
;
...
...
@@ -51,7 +51,7 @@ public class IncludExcludeEndpointFilter<E extends ExposableEndpoint<?>> impleme
private
final
EndpointPatterns
exclude
;
/**
* Create a new {@link IncludExcludeEndpointFilter} with include/exclude rules bound
* Create a new {@link Includ
e
ExcludeEndpointFilter} with include/exclude rules bound
* from the {@link Environment}.
* @param endpointType the endpoint type that should be considered (other types always
* match)
...
...
@@ -59,13 +59,13 @@ public class IncludExcludeEndpointFilter<E extends ExposableEndpoint<?>> impleme
* @param prefix the property prefix to bind
* @param defaultIncludes the default {@code includes} to use when none are specified.
*/
public
IncludExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Environment
environment
,
String
prefix
,
public
Includ
e
ExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Environment
environment
,
String
prefix
,
String
...
defaultIncludes
)
{
this
(
endpointType
,
environment
,
prefix
,
new
EndpointPatterns
(
defaultIncludes
));
}
/**
* Create a new {@link IncludExcludeEndpointFilter} with include/exclude rules bound
* Create a new {@link Includ
e
ExcludeEndpointFilter} with include/exclude rules bound
* from the {@link Environment}.
* @param endpointType the endpoint type that should be considered (other types always
* match)
...
...
@@ -73,12 +73,12 @@ public class IncludExcludeEndpointFilter<E extends ExposableEndpoint<?>> impleme
* @param prefix the property prefix to bind
* @param defaultIncludes the default {@code includes} to use when none are specified.
*/
public
IncludExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Environment
environment
,
String
prefix
,
public
Includ
e
ExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Environment
environment
,
String
prefix
,
DefaultIncludes
defaultIncludes
)
{
this
(
endpointType
,
environment
,
prefix
,
DefaultIncludes
.
patterns
(
defaultIncludes
));
}
private
IncludExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Environment
environment
,
String
prefix
,
private
Includ
e
ExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Environment
environment
,
String
prefix
,
EndpointPatterns
defaultIncludes
)
{
Assert
.
notNull
(
endpointType
,
"EndpointType must not be null"
);
Assert
.
notNull
(
environment
,
"Environment must not be null"
);
...
...
@@ -92,7 +92,7 @@ public class IncludExcludeEndpointFilter<E extends ExposableEndpoint<?>> impleme
}
/**
* Create a new {@link IncludExcludeEndpointFilter} with specific include/exclude
* Create a new {@link Includ
e
ExcludeEndpointFilter} with specific include/exclude
* rules.
* @param endpointType the endpoint type that should be considered (other types always
* match)
...
...
@@ -100,13 +100,13 @@ public class IncludExcludeEndpointFilter<E extends ExposableEndpoint<?>> impleme
* @param exclude the exclude patterns
* @param defaultIncludes the default {@code includes} to use when none are specified.
*/
public
IncludExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Collection
<
String
>
include
,
Collection
<
String
>
exclude
,
public
Includ
e
ExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Collection
<
String
>
include
,
Collection
<
String
>
exclude
,
String
...
defaultIncludes
)
{
this
(
endpointType
,
include
,
exclude
,
new
EndpointPatterns
(
defaultIncludes
));
}
/**
* Create a new {@link IncludExcludeEndpointFilter} with specific include/exclude
* Create a new {@link Includ
e
ExcludeEndpointFilter} with specific include/exclude
* rules.
* @param endpointType the endpoint type that should be considered (other types always
* match)
...
...
@@ -114,12 +114,12 @@ public class IncludExcludeEndpointFilter<E extends ExposableEndpoint<?>> impleme
* @param exclude the exclude patterns
* @param defaultIncludes the default {@code includes} to use when none are specified.
*/
public
IncludExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Collection
<
String
>
include
,
Collection
<
String
>
exclude
,
public
Includ
e
ExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Collection
<
String
>
include
,
Collection
<
String
>
exclude
,
DefaultIncludes
defaultIncludes
)
{
this
(
endpointType
,
include
,
exclude
,
DefaultIncludes
.
patterns
(
defaultIncludes
));
}
private
IncludExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Collection
<
String
>
include
,
Collection
<
String
>
exclude
,
private
Includ
e
ExcludeEndpointFilter
(
Class
<
E
>
endpointType
,
Collection
<
String
>
include
,
Collection
<
String
>
exclude
,
EndpointPatterns
defaultIncludes
)
{
Assert
.
notNull
(
endpointType
,
"EndpointType Type must not be null"
);
Assert
.
notNull
(
defaultIncludes
,
"DefaultIncludes must not be null"
);
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointAutoConfiguration.java
View file @
8de00277
...
...
@@ -23,7 +23,7 @@ import javax.management.MBeanServer;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
org.springframework.beans.factory.ObjectProvider
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.Includ
e
ExcludeEndpointFilter
;
import
org.springframework.boot.actuate.endpoint.EndpointFilter
;
import
org.springframework.boot.actuate.endpoint.annotation.Endpoint
;
import
org.springframework.boot.actuate.endpoint.invoke.OperationInvokerAdvisor
;
...
...
@@ -97,9 +97,9 @@ public class JmxEndpointAutoConfiguration {
}
@Bean
public
IncludExcludeEndpointFilter
<
ExposableJmxEndpoint
>
jmxIncludeExcludePropertyEndpointFilter
()
{
public
Includ
e
ExcludeEndpointFilter
<
ExposableJmxEndpoint
>
jmxIncludeExcludePropertyEndpointFilter
()
{
JmxEndpointProperties
.
Exposure
exposure
=
this
.
properties
.
getExposure
();
return
new
IncludExcludeEndpointFilter
<>(
ExposableJmxEndpoint
.
class
,
exposure
.
getInclude
(),
return
new
Includ
e
ExcludeEndpointFilter
<>(
ExposableJmxEndpoint
.
class
,
exposure
.
getInclude
(),
exposure
.
getExclude
(),
"*"
);
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java
View file @
8de00277
...
...
@@ -18,7 +18,7 @@ package org.springframework.boot.actuate.autoconfigure.endpoint.web;
import
org.glassfish.jersey.server.ResourceConfig
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.Includ
e
ExcludeEndpointFilter
;
import
org.springframework.boot.actuate.autoconfigure.web.ManagementContextConfiguration
;
import
org.springframework.boot.actuate.endpoint.web.ExposableServletEndpoint
;
import
org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar
;
...
...
@@ -47,10 +47,10 @@ import org.springframework.web.servlet.DispatcherServlet;
public
class
ServletEndpointManagementContextConfiguration
{
@Bean
public
IncludExcludeEndpointFilter
<
ExposableServletEndpoint
>
servletExposeExcludePropertyEndpointFilter
(
public
Includ
e
ExcludeEndpointFilter
<
ExposableServletEndpoint
>
servletExposeExcludePropertyEndpointFilter
(
WebEndpointProperties
properties
)
{
WebEndpointProperties
.
Exposure
exposure
=
properties
.
getExposure
();
return
new
IncludExcludeEndpointFilter
<>(
ExposableServletEndpoint
.
class
,
exposure
.
getInclude
(),
return
new
Includ
e
ExcludeEndpointFilter
<>(
ExposableServletEndpoint
.
class
,
exposure
.
getInclude
(),
exposure
.
getExclude
());
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.java
View file @
8de00277
...
...
@@ -22,8 +22,8 @@ import java.util.stream.Collectors;
import
org.springframework.beans.factory.ObjectProvider
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter.DefaultIncludes
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.Includ
e
ExcludeEndpointFilter
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.Includ
e
ExcludeEndpointFilter.DefaultIncludes
;
import
org.springframework.boot.actuate.endpoint.EndpointFilter
;
import
org.springframework.boot.actuate.endpoint.EndpointsSupplier
;
import
org.springframework.boot.actuate.endpoint.annotation.Endpoint
;
...
...
@@ -113,16 +113,16 @@ public class WebEndpointAutoConfiguration {
}
@Bean
public
IncludExcludeEndpointFilter
<
ExposableWebEndpoint
>
webExposeExcludePropertyEndpointFilter
()
{
public
Includ
e
ExcludeEndpointFilter
<
ExposableWebEndpoint
>
webExposeExcludePropertyEndpointFilter
()
{
WebEndpointProperties
.
Exposure
exposure
=
this
.
properties
.
getExposure
();
return
new
IncludExcludeEndpointFilter
<>(
ExposableWebEndpoint
.
class
,
exposure
.
getInclude
(),
return
new
Includ
e
ExcludeEndpointFilter
<>(
ExposableWebEndpoint
.
class
,
exposure
.
getInclude
(),
exposure
.
getExclude
(),
DefaultIncludes
.
WEB
);
}
@Bean
public
IncludExcludeEndpointFilter
<
ExposableControllerEndpoint
>
controllerExposeExcludePropertyEndpointFilter
()
{
public
Includ
e
ExcludeEndpointFilter
<
ExposableControllerEndpoint
>
controllerExposeExcludePropertyEndpointFilter
()
{
WebEndpointProperties
.
Exposure
exposure
=
this
.
properties
.
getExposure
();
return
new
IncludExcludeEndpointFilter
<>(
ExposableControllerEndpoint
.
class
,
exposure
.
getInclude
(),
return
new
Includ
e
ExcludeEndpointFilter
<>(
ExposableControllerEndpoint
.
class
,
exposure
.
getInclude
(),
exposure
.
getExclude
());
}
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/IncludExcludeEndpointFilterTests.java
→
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/expose/Includ
e
ExcludeEndpointFilterTests.java
View file @
8de00277
...
...
@@ -32,13 +32,13 @@ import static org.mockito.BDDMockito.given;
import
static
org
.
mockito
.
Mockito
.
mock
;
/**
* Tests for {@link IncludExcludeEndpointFilter}.
* Tests for {@link Includ
e
ExcludeEndpointFilter}.
*
* @author Phillip Webb
*/
class
IncludExcludeEndpointFilterTests
{
class
Includ
e
ExcludeEndpointFilterTests
{
private
IncludExcludeEndpointFilter
<?>
filter
;
private
Includ
e
ExcludeEndpointFilter
<?>
filter
;
@BeforeEach
void
setup
()
{
...
...
@@ -48,14 +48,14 @@ class IncludExcludeEndpointFilterTests {
@Test
void
createWhenEndpointTypeIsNullShouldThrowException
()
{
assertThatIllegalArgumentException
()
.
isThrownBy
(()
->
new
IncludExcludeEndpointFilter
<>(
null
,
new
MockEnvironment
(),
"foo"
))
.
isThrownBy
(()
->
new
Includ
e
ExcludeEndpointFilter
<>(
null
,
new
MockEnvironment
(),
"foo"
))
.
withMessageContaining
(
"EndpointType must not be null"
);
}
@Test
void
createWhenEnvironmentIsNullShouldThrowException
()
{
assertThatIllegalArgumentException
()
.
isThrownBy
(()
->
new
IncludExcludeEndpointFilter
<>(
ExposableEndpoint
.
class
,
null
,
"foo"
))
.
isThrownBy
(()
->
new
Includ
e
ExcludeEndpointFilter
<>(
ExposableEndpoint
.
class
,
null
,
"foo"
))
.
withMessageContaining
(
"Environment must not be null"
);
}
...
...
@@ -63,14 +63,15 @@ class IncludExcludeEndpointFilterTests {
void
createWhenPrefixIsNullShouldThrowException
()
{
assertThatIllegalArgumentException
()
.
isThrownBy
(
()
->
new
IncludExcludeEndpointFilter
<>(
ExposableEndpoint
.
class
,
new
MockEnvironment
(),
null
))
()
->
new
Includ
e
ExcludeEndpointFilter
<>(
ExposableEndpoint
.
class
,
new
MockEnvironment
(),
null
))
.
withMessageContaining
(
"Prefix must not be empty"
);
}
@Test
void
createWhenPrefixIsEmptyShouldThrowException
()
{
assertThatIllegalArgumentException
()
.
isThrownBy
(()
->
new
IncludExcludeEndpointFilter
<>(
ExposableEndpoint
.
class
,
new
MockEnvironment
(),
""
))
.
isThrownBy
(
()
->
new
IncludeExcludeEndpointFilter
<>(
ExposableEndpoint
.
class
,
new
MockEnvironment
(),
""
))
.
withMessageContaining
(
"Prefix must not be empty"
);
}
...
...
@@ -121,7 +122,7 @@ class IncludExcludeEndpointFilterTests {
MockEnvironment
environment
=
new
MockEnvironment
();
environment
.
setProperty
(
"foo.include"
,
"bar"
);
environment
.
setProperty
(
"foo.exclude"
,
""
);
this
.
filter
=
new
IncludExcludeEndpointFilter
<>(
DifferentTestExposableWebEndpoint
.
class
,
environment
,
"foo"
);
this
.
filter
=
new
Includ
e
ExcludeEndpointFilter
<>(
DifferentTestExposableWebEndpoint
.
class
,
environment
,
"foo"
);
assertThat
(
match
(
EndpointId
.
of
(
"baz"
))).
isTrue
();
}
...
...
@@ -157,7 +158,7 @@ class IncludExcludeEndpointFilterTests {
MockEnvironment
environment
=
new
MockEnvironment
();
environment
.
setProperty
(
"foo.include"
,
include
);
environment
.
setProperty
(
"foo.exclude"
,
exclude
);
this
.
filter
=
new
IncludExcludeEndpointFilter
<>(
TestExposableWebEndpoint
.
class
,
environment
,
"foo"
,
"def"
);
this
.
filter
=
new
Includ
e
ExcludeEndpointFilter
<>(
TestExposableWebEndpoint
.
class
,
environment
,
"foo"
,
"def"
);
}
@SuppressWarnings
({
"rawtypes"
,
"unchecked"
})
...
...
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfigurationTests.java
View file @
8de00277
...
...
@@ -24,7 +24,7 @@ import java.util.stream.Collectors;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.IncludExcludeEndpointFilter
;
import
org.springframework.boot.actuate.autoconfigure.endpoint.expose.Includ
e
ExcludeEndpointFilter
;
import
org.springframework.boot.actuate.endpoint.EndpointId
;
import
org.springframework.boot.actuate.endpoint.annotation.Endpoint
;
import
org.springframework.boot.actuate.endpoint.http.ActuatorMediaType
;
...
...
@@ -104,7 +104,7 @@ class WebEndpointAutoConfigurationTests {
@Test
void
webApplicationConfiguresExposeExcludePropertyEndpointFilter
()
{
this
.
contextRunner
.
run
((
context
)
->
assertThat
(
context
).
getBeans
(
IncludExcludeEndpointFilter
.
class
).
containsKeys
(
.
run
((
context
)
->
assertThat
(
context
).
getBeans
(
Includ
e
ExcludeEndpointFilter
.
class
).
containsKeys
(
"webExposeExcludePropertyEndpointFilter"
,
"controllerExposeExcludePropertyEndpointFilter"
));
}
...
...
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