Class ConfigurationPropertiesReportEndpoint
java.lang.Object
org.springframework.boot.actuate.context.properties.ConfigurationPropertiesReportEndpoint
- All Implemented Interfaces:
Aware
,ApplicationContextAware
@Endpoint(id="configprops")
public class ConfigurationPropertiesReportEndpoint
extends Object
implements ApplicationContextAware
@Endpoint
to expose application properties from
@ConfigurationProperties
annotated beans.
To protect sensitive information from being exposed, certain property values are masked
if their names end with a set of configurable values (default "password" and "secret").
Configure property names by using
management.endpoint.configprops.keys-to-sanitize
in your Spring Boot
application configuration.
- Since:
- 2.0.0
- Author:
- Christian Dupuis, Dave Syer, Stephane Nicoll, Madhura Bhave, Andy Wilkinson, Chris Bono
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A description of an application's@ConfigurationProperties
beans.static final class
A description of a@ConfigurationProperties
bean.static final class
A description of an application context's@ConfigurationProperties
beans.protected static class
BeanSerializerModifier
to return only relevant configuration properties. -
Constructor Summary
ConstructorDescriptionConfigurationPropertiesReportEndpoint
(Iterable<SanitizingFunction> sanitizingFunctions) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
configureJsonMapper
(com.fasterxml.jackson.databind.json.JsonMapper.Builder builder) Configure Jackson'sJsonMapper
to be used to serialize the@ConfigurationProperties
objects into aMap
structure.void
keysToSanitize
(String... keysToSanitize) void
setApplicationContext
(ApplicationContext context) void
setKeysToSanitize
(String... keysToSanitize)
-
Constructor Details
-
ConfigurationPropertiesReportEndpoint
public ConfigurationPropertiesReportEndpoint() -
ConfigurationPropertiesReportEndpoint
-
-
Method Details
-
setApplicationContext
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Throws:
BeansException
-
setKeysToSanitize
-
keysToSanitize
-
configurationProperties
@ReadOperation public ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties configurationProperties() -
configurationPropertiesWithPrefix
@ReadOperation public ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties configurationPropertiesWithPrefix(@Selector String prefix) -
configureJsonMapper
protected void configureJsonMapper(com.fasterxml.jackson.databind.json.JsonMapper.Builder builder) Configure Jackson'sJsonMapper
to be used to serialize the@ConfigurationProperties
objects into aMap
structure.- Parameters:
builder
- the json mapper builder- Since:
- 2.6.0
-