Search in sources :

Example 1 with SanitizableData

use of org.springframework.boot.actuate.endpoint.SanitizableData in project spring-boot by spring-projects.

the class ConfigurationPropertiesReportEndpoint method sanitizeWithPropertySourceIfPresent.

private Object sanitizeWithPropertySourceIfPresent(String qualifiedKey, Object value) {
    ConfigurationPropertyName currentName = getCurrentName(qualifiedKey);
    ConfigurationProperty candidate = getCandidate(currentName);
    PropertySource<?> propertySource = getPropertySource(candidate);
    if (propertySource != null) {
        SanitizableData data = new SanitizableData(propertySource, qualifiedKey, value);
        return this.sanitizer.sanitize(data);
    }
    SanitizableData data = new SanitizableData(null, qualifiedKey, value);
    return this.sanitizer.sanitize(data);
}
Also used : ConfigurationProperty(org.springframework.boot.context.properties.source.ConfigurationProperty) ConfigurationPropertyName(org.springframework.boot.context.properties.source.ConfigurationPropertyName) SanitizableData(org.springframework.boot.actuate.endpoint.SanitizableData)

Example 2 with SanitizableData

use of org.springframework.boot.actuate.endpoint.SanitizableData in project spring-boot by spring-projects.

the class ConfigurationPropertiesReportEndpoint method applyInput.

private Map<String, Object> applyInput(String qualifiedKey) {
    ConfigurationPropertyName currentName = getCurrentName(qualifiedKey);
    ConfigurationProperty candidate = getCandidate(currentName);
    PropertySource<?> propertySource = getPropertySource(candidate);
    if (propertySource != null) {
        Object value = stringifyIfNecessary(candidate.getValue());
        SanitizableData data = new SanitizableData(propertySource, currentName.toString(), value);
        return getInput(candidate, this.sanitizer.sanitize(data));
    }
    return Collections.emptyMap();
}
Also used : ConfigurationProperty(org.springframework.boot.context.properties.source.ConfigurationProperty) ConfigurationPropertyName(org.springframework.boot.context.properties.source.ConfigurationPropertyName) SanitizableData(org.springframework.boot.actuate.endpoint.SanitizableData)

Aggregations

SanitizableData (org.springframework.boot.actuate.endpoint.SanitizableData)2 ConfigurationProperty (org.springframework.boot.context.properties.source.ConfigurationProperty)2 ConfigurationPropertyName (org.springframework.boot.context.properties.source.ConfigurationPropertyName)2