Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Log out token to audit log
Browse files Browse the repository at this point in the history
We need to know who tried to do something as well as what they were
trying to do for these logs to be useful.
  • Loading branch information
tombooth committed Apr 28, 2015
1 parent 7b95c80 commit 1b8c03f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backdrop/write/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ def audit_append(data_set_name, data):
if data:
start_at, end_at = parse_bounding_dates(data)
extra = {
'token': request.headers.get('Authorization'),
'data_set': data_set_name,
'start_at': start_at,
'end_at': end_at,
Expand All @@ -361,7 +362,8 @@ def audit_append(data_set_name, data):

def audit_delete(data_set_name):
app.audit_logger.info("Data delete action", extra={
'data_set': data_set_name
'token': request.headers.get('Authorization'),
'data_set': data_set_name,
})


Expand Down

0 comments on commit 1b8c03f

Please sign in to comment.