censor OAuth tokens from activity stream deletion records

see: https://github.com/ansible/tower/issues/1772
This commit is contained in:
Ryan Petrello
2018-05-15 09:16:37 -04:00
parent f5c4abc81b
commit 05b0c5ec6f

View File

@@ -494,6 +494,8 @@ def activity_stream_delete(sender, instance, **kwargs):
return return
changes = model_to_dict(instance) changes = model_to_dict(instance)
object1 = camelcase_to_underscore(instance.__class__.__name__) object1 = camelcase_to_underscore(instance.__class__.__name__)
if type(instance) == OAuth2AccessToken:
changes['token'] = TOKEN_CENSOR
activity_entry = ActivityStream( activity_entry = ActivityStream(
operation='delete', operation='delete',
changes=json.dumps(changes), changes=json.dumps(changes),