##// END OF EJS Templates
auth: improve logging
marcink -
r1955:cbfb9e89 default
parent child Browse files
Show More
@@ -872,20 +872,20 b' class AuthUser(object):'
872
872
873 # lookup by userid
873 # lookup by userid
874 if self.user_id is not None and self.user_id != anon_user.user_id:
874 if self.user_id is not None and self.user_id != anon_user.user_id:
875 log.debug('Trying Auth User lookup by USER ID: `%s`' % self.user_id)
875 log.debug('Trying Auth User lookup by USER ID: `%s`', self.user_id)
876 is_user_loaded = user_model.fill_data(self, user_id=self.user_id)
876 is_user_loaded = user_model.fill_data(self, user_id=self.user_id)
877
877
878 # try go get user by api key
878 # try go get user by api key
879 elif self._api_key and self._api_key != anon_user.api_key:
879 elif self._api_key and self._api_key != anon_user.api_key:
880 log.debug('Trying Auth User lookup by API KEY: `%s`' % self._api_key)
880 log.debug('Trying Auth User lookup by API KEY: `%s`', self._api_key)
881 is_user_loaded = user_model.fill_data(self, api_key=self._api_key)
881 is_user_loaded = user_model.fill_data(self, api_key=self._api_key)
882
882
883 # lookup by username
883 # lookup by username
884 elif self.username:
884 elif self.username:
885 log.debug('Trying Auth User lookup by USER NAME: `%s`' % self.username)
885 log.debug('Trying Auth User lookup by USER NAME: `%s`', self.username)
886 is_user_loaded = user_model.fill_data(self, username=self.username)
886 is_user_loaded = user_model.fill_data(self, username=self.username)
887 else:
887 else:
888 log.debug('No data in %s that could been used to log in' % self)
888 log.debug('No data in %s that could been used to log in', self)
889
889
890 if not is_user_loaded:
890 if not is_user_loaded:
891 log.debug('Failed to load user. Fallback to default user')
891 log.debug('Failed to load user. Fallback to default user')
@@ -904,7 +904,7 b' class AuthUser(object):'
904 if not self.username:
904 if not self.username:
905 self.username = 'None'
905 self.username = 'None'
906
906
907 log.debug('AuthUser: propagated user is now %s' % self)
907 log.debug('AuthUser: propagated user is now %s', self)
908
908
909 def get_perms(self, user, scope=None, explicit=True, algo='higherwin',
909 def get_perms(self, user, scope=None, explicit=True, algo='higherwin',
910 cache=False):
910 cache=False):
@@ -656,8 +656,8 b' class UserModel(BaseModel):'
656 raise Exception('You need to pass user_id, api_key or username')
656 raise Exception('You need to pass user_id, api_key or username')
657
657
658 log.debug(
658 log.debug(
659 'doing fill data based on: user_id:%s api_key:%s username:%s',
659 'AuthUser: fill data execution based on: '
660 user_id, api_key, username)
660 'user_id:%s api_key:%s username:%s', user_id, api_key, username)
661 try:
661 try:
662 dbuser = None
662 dbuser = None
663 if user_id:
663 if user_id:
@@ -677,7 +677,7 b' class UserModel(BaseModel):'
677 username, user_id)
677 username, user_id)
678 return False
678 return False
679
679
680 log.debug('filling user:%s data', dbuser)
680 log.debug('AuthUser: filling found user:%s data', dbuser)
681 user_data = dbuser.get_dict()
681 user_data = dbuser.get_dict()
682
682
683 user_data.update({
683 user_data.update({
General Comments 0
You need to be logged in to leave comments. Login now