Class ConfigurationPropertiesReportEndpoint
- java.lang.Object
- org.springframework.boot.actuate.endpoint.AbstractEndpoint<Map<String,Object>>
- org.springframework.boot.actuate.endpoint.ConfigurationPropertiesReportEndpoint
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,Endpoint<Map<String,Object>>
,org.springframework.context.ApplicationContextAware
,org.springframework.context.EnvironmentAware
@ConfigurationProperties(prefix="endpoints.configprops") public class ConfigurationPropertiesReportEndpoint extends AbstractEndpoint<Map<String,Object>> implements org.springframework.context.ApplicationContextAware
Endpoint
to expose application properties fromConfigurationProperties
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
endpoints.configprops.keys_to_sanitize
in your Spring Boot application configuration.
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ConfigurationPropertiesReportEndpoint.GenericSerializerModifier
BeanSerializerModifier
to return only relevant configuration properties.
Constructor Summary
Constructors Constructor Description ConfigurationPropertiesReportEndpoint()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
Configure Jackson'sObjectMapper
to be used to serialize theConfigurationProperties
objects into aMap
structure.protected Map<String,Object>
extract(org.springframework.context.ApplicationContext context)
Extract beans annotatedConfigurationProperties
and serialize intoMap
.Map<String,Object>
invoke()
Called to invoke the endpoint.void
setApplicationContext(org.springframework.context.ApplicationContext context)
void
setKeysToSanitize(String... keysToSanitize)
Methods inherited from class org.springframework.boot.actuate.endpoint.AbstractEndpoint
getEnvironment, getId, isEnabled, isSensitive, setEnabled, setEnvironment, setId, setSensitive
Constructor Detail
ConfigurationPropertiesReportEndpoint
public ConfigurationPropertiesReportEndpoint()
Method Detail
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext context) throws org.springframework.beans.BeansException
- Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
- Throws:
org.springframework.beans.BeansException
setKeysToSanitize
public void setKeysToSanitize(String... keysToSanitize)
invoke
public Map<String,Object> invoke()
Description copied from interface:Endpoint
Called to invoke the endpoint.
extract
protected Map<String,Object> extract(org.springframework.context.ApplicationContext context)
Extract beans annotatedConfigurationProperties
and serialize intoMap
.- Parameters:
context
- the application context- Returns:
- the beans
configureObjectMapper
protected void configureObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
Configure Jackson'sObjectMapper
to be used to serialize theConfigurationProperties
objects into aMap
structure.- Parameters:
mapper
- the object mapper