From 90e3128b910466c572cd2df1a79627591223fc5a Mon Sep 17 00:00:00 2001 From: nharris Date: Mon, 6 Feb 2023 17:02:56 -0700 Subject: [PATCH] - New censor set for common credentials --- lib/src/censors.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/src/censors.dart b/lib/src/censors.dart index 918643e..1a9ccfb 100644 --- a/lib/src/censors.dart +++ b/lib/src/censors.dart @@ -4,6 +4,7 @@ import 'package:dartvcr/src/utilities.dart'; import 'package:dartvcr/src/vcr_exception.dart'; import 'censor_element.dart'; +import 'defaults.dart'; import 'internal_utilities/content_type.dart'; /// A class representing a set of rules to censor elements from requests and responses. @@ -282,4 +283,11 @@ class Censors { static Censors get defaultCensors { return Censors(); } + + /// A pre-configured instance of [Censors] that censors common credential data. + static Censors get defaultCredentialCensors { + return Censors() + .censorQueryElementsByKeys(credentialParametersToHide) + .censorHeaderElementsByKeys(credentialHeadersToHide); + } }