logging: changed module in logs extra as it is a reserved keyword

This commit is contained in:
RhodeCode Admin 2022-10-27 22:54:02 +02:00
parent 446b48dea6
commit 8a95bb9eb4
4 changed files with 5 additions and 5 deletions

View file

@ -223,7 +223,7 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
}
log.info('user `%s` authenticated correctly', user_attrs['username'],
extra={"action": "user_auth_ok", "module": "auth_headers", "username": user_attrs["username"]})
extra={"action": "user_auth_ok", "auth_module": "auth_headers", "username": user_attrs["username"]})
return user_attrs

View file

@ -535,7 +535,7 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
log.debug('ldap user: %s', user_attrs)
log.info('user `%s` authenticated correctly', user_attrs['username'],
extra={"action": "user_auth_ok", "module": "auth_ldap", "username": user_attrs["username"]})
extra={"action": "user_auth_ok", "auth_module": "auth_ldap", "username": user_attrs["username"]})
return user_attrs

View file

@ -163,7 +163,7 @@ class RhodeCodeAuthPlugin(RhodeCodeExternalAuthPlugin):
log.debug("pamuser: %s", user_attrs)
log.info('user `%s` authenticated correctly', user_attrs['username'],
extra={"action": "user_auth_ok", "module": "auth_pam", "username": user_attrs["username"]})
extra={"action": "user_auth_ok", "auth_module": "auth_pam", "username": user_attrs["username"]})
return user_attrs

View file

@ -168,12 +168,12 @@ class RhodeCodeAuthPlugin(RhodeCodeAuthPluginBase):
if userobj.username == User.DEFAULT_USER and userobj.active:
log.info('user `%s` authenticated correctly as anonymous user',
userobj.username,
extra={"action": "user_auth_ok", "module": "auth_rhodecode_anon", "username": userobj.username})
extra={"action": "user_auth_ok", "auth_module": "auth_rhodecode_anon", "username": userobj.username})
return user_attrs
elif userobj.username == username and password_match:
log.info('user `%s` authenticated correctly', userobj.username,
extra={"action": "user_auth_ok", "module": "auth_rhodecode", "username": userobj.username})
extra={"action": "user_auth_ok", "auth_module": "auth_rhodecode", "username": userobj.username})
return user_attrs
log.warning("user `%s` used a wrong password when "
"authenticating on this plugin", userobj.username)