Skip to content

Commit fcee321

Browse files
Bump version to 1.7.4
1 parent dfcfa19 commit fcee321

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog for Serilog.Enrichers.Sensitive
22

3+
## 1.7.4
4+
5+
- Add masking options for properties [#29](https://github.com/serilog-contrib/Serilog.Enrichers.Sensitive/issues/29)
6+
37
## 1.7.3
48

59
- Add support for masking property values that contain a `Uri`, reported by @yadanilov19

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>1.7.3.0</Version>
3+
<Version>1.7.4.0</Version>
44
<Authors>Sander van Vliet, Huibert Jan Nieuwkamer, Scott Toberman</Authors>
55
<Company>Codenizer BV</Company>
66
<Copyright>2023 Sander van Vliet</Copyright>

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Serilog.Enrichers.Sensitive
1+
# Serilog.Enrichers.Sensitive
22

33
[![build-and-test](https://github.com/serilog-contrib/Serilog.Enrichers.Sensitive/actions/workflows/dotnet.yml/badge.svg)](https://github.com/serilog-contrib/Serilog.Enrichers.Sensitive/actions/workflows/dotnet.yml) [![release](https://github.com/serilog-contrib/Serilog.Enrichers.Sensitive/actions/workflows/release.yml/badge.svg)](https://github.com/serilog-contrib/Serilog.Enrichers.Sensitive/actions/workflows/release.yml) [![NuGet Serilog.Enrichers.Sensitive](https://buildstats.info/nuget/Serilog.Enrichers.Sensitive)](https://www.nuget.org/packages/Serilog.Enrichers.Sensitive/)
44

@@ -171,6 +171,27 @@ When the mask is `***MASKED***` and we pass in `james.bond@universalexports.co.u
171171

172172
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.
173173

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+
174195
### Always mask a property
175196

176197
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

Comments
 (0)