Skip to content

Commit 1f2da6a

Browse files
committed
Document SanitizingFunction
Closes gh-29950
1 parent d63e609 commit 1f2da6a

File tree

1 file changed

+11
-0
lines changed
  • spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto

1 file changed

+11
-0
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/actuator.adoc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,20 @@ The sensitive portion of the URI is identified using the format `<scheme>://<use
5353
For example, for the property `myclient.uri=http://user1:password1@localhost:8081`, the resulting sanitized value is
5454
`++http://user1:******@localhost:8081++`.
5555

56+
57+
58+
[[howto.actuator.sanitize-sensitive-values.customizing-sanitization]]
59+
==== Customizing Sanitization
60+
Sanitization can be customized in two different ways.
61+
5662
The default patterns used by the `env` and `configprops` endpoints can be replaced using configprop:management.endpoint.env.keys-to-sanitize[] and configprop:management.endpoint.configprops.keys-to-sanitize[] respectively.
5763
Alternatively, additional patterns can be configured using configprop:management.endpoint.env.additional-keys-to-sanitize[] and configprop:management.endpoint.configprops.additional-keys-to-sanitize[].
5864

65+
To take more control over the santization, define a `SanitizingFunction` bean.
66+
The `SanitizableData` with which the function is called provides access to the key and value as well as the `PropertySource` from which they came.
67+
This allows you to, for example, sanitize every value that comes from a particular property source.
68+
Each `SanitizingFunction` is called before and in addition to the built-in key-based sanitization.
69+
5970

6071

6172
[[howto.actuator.map-health-indicators-to-metrics]]

0 commit comments

Comments
 (0)