##// END OF EJS Templates
logs: fix leaking of tokens to logging. Fixes #5452
marcink -
r2657:98ca006e default
parent child Browse files
Show More
@@ -663,6 +663,10 b' class UserModel(BaseModel):'
663 663 :param api_key: api key to fetch by
664 664 :param username: username to fetch by
665 665 """
666 def token_obfuscate(token):
667 if token:
668 return token[:4] + "****"
669
666 670 if user_id is None and api_key is None and username is None:
667 671 raise Exception('You need to pass user_id, api_key or username')
668 672
@@ -681,7 +685,7 b' class UserModel(BaseModel):'
681 685 if not dbuser:
682 686 log.warning(
683 687 'Unable to lookup user by id:%s api_key:%s username:%s',
684 user_id, api_key, username)
688 user_id, token_obfuscate(api_key), username)
685 689 return False
686 690 if not dbuser.active:
687 691 log.debug('User `%s:%s` is inactive, skipping fill data',
General Comments 0
You need to be logged in to leave comments. Login now