@ConfigurationProperties(prefix="endpoints.configprops", ignoreUnknownFields=false) public class ConfigurationPropertiesReportEndpoint extends AbstractEndpoint<Map<String,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 endpoints.configprops.keys_to_sanitize
in your Spring Boot application configuration.
Modifier and Type | Class and Description |
---|---|
protected static class |
ConfigurationPropertiesReportEndpoint.ConfigurationPropertiesMetaData
Convenience class for grabbing and caching valid property names from
/META-INF/spring-configuration-metadata.json so that metadata that is known to be
valid can be used to pull the correct nested properties out of beans that might
otherwise be tricky (contain cycles or other unserializable properties).
|
protected static class |
ConfigurationPropertiesReportEndpoint.GenericSerializerModifier
BeanSerializerModifier to return only relevant configuration properties. |
Constructor and Description |
---|
ConfigurationPropertiesReportEndpoint() |
Modifier and Type | Method and Description |
---|---|
protected void |
configureObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
Configure Jackson's
ObjectMapper to be used to serialize the
ConfigurationProperties objects into a Map structure. |
protected Map<String,Object> |
extract(ApplicationContext context)
Extract beans annotated
ConfigurationProperties and serialize into
Map . |
Map<String,Object> |
invoke()
Called to invoke the endpoint.
|
void |
setApplicationContext(ApplicationContext context) |
void |
setKeysToSanitize(String... keysToSanitize) |
void |
setMetadataLocations(String metadataLocations)
Location path for JSON metadata about config properties.
|
getId, isEnabled, isSensitive, setEnabled, setEnvironment, setId, setSensitive
public ConfigurationPropertiesReportEndpoint()
public void setApplicationContext(ApplicationContext context) throws BeansException
setApplicationContext
in interface ApplicationContextAware
BeansException
public void setKeysToSanitize(String... keysToSanitize)
public void setMetadataLocations(String metadataLocations)
metadataLocations
- the metadataLocations to setpublic Map<String,Object> invoke()
Endpoint
protected Map<String,Object> extract(ApplicationContext context)
ConfigurationProperties
and serialize into
Map
.protected void configureObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)
ObjectMapper
to be used to serialize the
ConfigurationProperties
objects into a Map
structure.Copyright © 2014 Pivotal Software, Inc.. All rights reserved.