@ -21,11 +21,13 @@ import java.util.Arrays;
import java.util.Collection ;
import java.util.Collections ;
import java.util.HashSet ;
import java.util.List ;
import java.util.Locale ;
import java.util.Set ;
import java.util.stream.Collectors ;
import org.springframework.boot.actuate.endpoint.EndpointFilter ;
import org.springframework.boot.actuate.endpoint.EndpointId ;
import org.springframework.boot.actuate.endpoint.ExposableEndpoint ;
import org.springframework.boot.context.properties.bind.Bindable ;
import org.springframework.boot.context.properties.bind.Binder ;
@ -74,10 +76,19 @@ public class ExposeExcludePropertyEndpointFilter<E extends ExposableEndpoint<?>>
}
private Set < String > bind ( Binder binder , String name ) {
return asSet ( binder . bind ( name , Bindable . listOf ( String . class ) )
return asSet ( binder . bind ( name , Bindable . listOf ( String . class ) ) . map ( this : : cleanup )
. orElseGet ( ArrayList : : new ) ) ;
}
private List < String > cleanup ( List < String > values ) {
return values . stream ( ) . map ( this : : cleanup ) . collect ( Collectors . toList ( ) ) ;
}
private String cleanup ( String value ) {
return "*" . equals ( value ) ? "*"
: EndpointId . fromPropertyValue ( value ) . toLowerCaseString ( ) ;
}
private Set < String > asSet ( Collection < String > items ) {
if ( items = = null ) {
return Collections . emptySet ( ) ;