Add tracking of the kind of temporary access tokens, so we can display if a pull/push by token is for a build worker

This commit is contained in:
Joseph Schorr 2015-02-17 12:35:16 -05:00
parent 3e04e3cfd7
commit 83e05d2342
10 changed files with 88 additions and 14 deletions

View file

@ -34,6 +34,10 @@ def track_and_log(event_name, repo, **kwargs):
elif authenticated_token:
metadata['token'] = authenticated_token.friendly_name
metadata['token_code'] = authenticated_token.code
if authenticated_token.kind:
metadata['token_type'] = authenticated_token.kind.name
analytics_id = 'token:' + authenticated_token.code
else:
metadata['public'] = True