@Endpoint(id="configprops") public class ConfigurationPropertiesReportEndpoint extends java.lang.Object implements org.springframework.context.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.
| Modifier and Type | Class and Description |
|---|---|
static class |
ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties
A description of an application's
@ConfigurationProperties beans. |
static class |
ConfigurationPropertiesReportEndpoint.ConfigurationPropertiesBeanDescriptor
A description of a
@ConfigurationProperties bean. |
static class |
ConfigurationPropertiesReportEndpoint.ContextConfigurationProperties
A description of an application context's
@ConfigurationProperties beans. |
protected static class |
ConfigurationPropertiesReportEndpoint.GenericSerializerModifier
BeanSerializerModifier to return only relevant configuration properties. |
| Constructor and Description |
|---|
ConfigurationPropertiesReportEndpoint() |
ConfigurationPropertiesReportEndpoint(java.lang.Iterable<SanitizingFunction> sanitizingFunctions) |
| Modifier and Type | Method and Description |
|---|---|
ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties |
configurationProperties() |
ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties |
configurationPropertiesWithPrefix(java.lang.String prefix) |
protected void |
configureJsonMapper(com.fasterxml.jackson.databind.json.JsonMapper.Builder builder)
Configure Jackson's
JsonMapper to be used to serialize the
@ConfigurationProperties objects into a Map
structure. |
protected void |
configureObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
Deprecated.
since 2.6 for removal in 2.8 in favor of
configureJsonMapper(com.fasterxml.jackson.databind.json.JsonMapper.Builder) |
void |
keysToSanitize(java.lang.String... keysToSanitize) |
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
void |
setKeysToSanitize(java.lang.String... keysToSanitize) |
public ConfigurationPropertiesReportEndpoint()
public ConfigurationPropertiesReportEndpoint(java.lang.Iterable<SanitizingFunction> sanitizingFunctions)
public void setApplicationContext(org.springframework.context.ApplicationContext context)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void setKeysToSanitize(java.lang.String... keysToSanitize)
public void keysToSanitize(java.lang.String... keysToSanitize)
@ReadOperation public ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties configurationProperties()
@ReadOperation public ConfigurationPropertiesReportEndpoint.ApplicationConfigurationProperties configurationPropertiesWithPrefix(@Selector java.lang.String prefix)
@Deprecated protected void configureObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
configureJsonMapper(com.fasterxml.jackson.databind.json.JsonMapper.Builder)ObjectMapper to be used to serialize the
@ConfigurationProperties objects into a Map
structure.mapper - the object mapperprotected void configureJsonMapper(com.fasterxml.jackson.databind.json.JsonMapper.Builder builder)
JsonMapper to be used to serialize the
@ConfigurationProperties objects into a Map
structure.builder - the json mapper builder