1515 'a_password_here' : 'hello' ,
1616 'api_key' : 'secret_key' ,
1717 'apiKey' : 'secret_key' ,
18+ 'access_token' : 'oauth2 access token' ,
1819}
1920
2021
@@ -25,6 +26,7 @@ def _will_throw_type_error(foo, **kwargs):
2526 a_password_here = "Don't look at me!" # NOQA F841
2627 api_key = "I'm hideous!" # NOQA F841
2728 apiKey = "4567000012345678" # NOQA F841
29+ access_token = "secret stuff!" # NOQA F841
2830
2931 # TypeError: unsupported operand type(s) for /: 'str' and 'str'
3032 raise exception_class ()
@@ -89,6 +91,8 @@ def _check_vars_sanitized(self, vars, proc):
8991 self .assertEquals (vars ['api_key' ], proc .MASK )
9092 self .assertTrue ('apiKey' in vars )
9193 self .assertEquals (vars ['apiKey' ], proc .MASK )
94+ self .assertTrue ('access_token' in vars )
95+ self .assertEquals (vars ['access_token' ], proc .MASK )
9296
9397 def test_stacktrace (self , * args , ** kwargs ):
9498 """
@@ -191,7 +195,8 @@ def test_cookie_as_string_with_partials(self):
191195 def test_cookie_header (self ):
192196 data = get_http_data ()
193197 data ['request' ]['headers' ]['Cookie' ] = 'foo=bar;password=hello' \
194- ';the_secret=hello;a_password_here=hello;api_key=secret_key'
198+ ';the_secret=hello;a_password_here=hello;api_key=secret_key' \
199+ ';access_token=at'
195200
196201 proc = SanitizePasswordsProcessor (Mock ())
197202 result = proc .process (data )
@@ -201,7 +206,8 @@ def test_cookie_header(self):
201206 self .assertEquals (
202207 http ['headers' ]['Cookie' ],
203208 'foo=bar;password=%(m)s'
204- ';the_secret=%(m)s;a_password_here=%(m)s;api_key=%(m)s' % dict (m = proc .MASK ))
209+ ';the_secret=%(m)s;a_password_here=%(m)s;api_key=%(m)s'
210+ ';access_token=%(m)s' % dict (m = proc .MASK ))
205211
206212 def test_sanitize_credit_card (self ):
207213 proc = SanitizePasswordsProcessor (Mock ())
0 commit comments