You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -171,6 +171,27 @@ When the mask is `***MASKED***` and we pass in `james.bond@universalexports.co.u
171
171
172
172
Note that this example uses `EmailAddressMaskingOperator` which has a fairly complex regular expression. If possible change your regular expression to have match groups so you can more easily access them through the `match` parameter.
173
173
174
+
#### Partially mask a value
175
+
176
+
Similar to the previous example you might want to only mask part of the value. Using `MaskOptions` you can specify:
177
+
178
+
- To show the first `n` characters and mask the rest (using `ShowFirst`)
179
+
- To show the last `n` characters and mask the rest (using `ShowLast`)
180
+
- To preserve the length of the original value (using `PreserveLength`)
181
+
182
+
The [`WhenMaskingWithOptions`](https://github.com/serilog-contrib/Serilog.Enrichers.Sensitive/blob/master/test/Serilog.Enrichers.Sensitive.Tests.Unit/WhenMaskingWithOptions.cs) test has examples of how the options work.
183
+
184
+
#### Partially mask a URI
185
+
186
+
When it comes to URIs you may want to mask only a very specific part of the URI and keep te rest visible. To support that you can use the `UriMaskOptions` to control which parts of the URI are _kept_:
187
+
188
+
-`ShowScheme`
189
+
-`ShowHost`
190
+
-`ShowPath`
191
+
-`ShowQueryString`
192
+
193
+
By default every part of the URI will be masked.
194
+
174
195
### Always mask a property
175
196
176
197
It may be that you always want to mask the value of a property regardless of whether it matches a pattern for any of the masking operators. In that case you can specify that the property is always masked:
0 commit comments