Skip to content

Commit

Permalink
- Update README.md, CHANGELOG.md (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwithan8 authored Jun 13, 2022
1 parent 01a4dc7 commit c557c0b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## Next Release
- Improvements to censoring
- Ability to define censored elements individually, with per-element case sensitivity
- Improvements to matching
- Ability to ignore certain elements when matching by body

## v0.3.1 (2022-05-26)

- Improvements to censoring
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,21 @@ file.

Censor sensitive data in the request and response bodies and headers, such as API keys and auth tokens.

NOTE: This feature currently only works on JSON response bodies, and can only censor root-level properties.
NOTE: This feature currently only works on JSON response bodies.

**Default**: *Disabled*

```csharp
using EasyVCR;

var cassette = new Cassette("path/to/cassettes", "my_cassette");

var censors = new Censors().CensorHeadersByKeys(new List<string> { "Authorization" }) // Hide the Authorization header
censors.CensorBodyElementsByKeys(new List<CensorElement> { new CensorElement("table", true) }); // Hide the table element (case sensitive) in the request and response body
var advancedOptions = new AdvancedOptions()
{
Censors = new Censors().HideHeaders(new List<string> { "Authorization" }) // Hide the Authorization header
Censors = censors
};

var httpClient = HttpClients.NewHttpClient(cassette, Mode.Record, advancedSettings);
Expand Down Expand Up @@ -162,7 +166,7 @@ using EasyVCR;

var advancedSettings = new AdvancedSettings
{
Censors = new Censors().HideQueryParameters(new List<string> { "api_key" }) // hide the api_key query parameter
Censors = new Censors().CensorQueryParametersByKeys(new List<string> { "api_key" }) // hide the api_key query parameter
};

// Create a VCR with the advanced settings applied
Expand Down

0 comments on commit c557c0b

Please sign in to comment.