auth: optimized logging with lazy eval of params formatting

This commit is contained in:
RhodeCode Admin 2023-05-11 12:26:08 +02:00
parent a05c3915b9
commit 0e5495de20

View file

@ -47,6 +47,7 @@ def discover_legacy_plugins(config, prefix=legacy_plugin_prefix):
setting in database which are using the specified prefix. Normally 'py:' is
used for the legacy plugins.
"""
log.debug('authentication: running legacy plugin discovery for prefix %s',
legacy_plugin_prefix)
try:
@ -64,10 +65,11 @@ def discover_legacy_plugins(config, prefix=legacy_plugin_prefix):
except Exception as e:
log.exception(
'Exception while loading legacy authentication plugin '
'"{}": {}'.format(plugin_id, e.message))
'"%s": %s', plugin_id, e)
def includeme(config):
# Set authentication policy.
authn_policy = SessionAuthenticationPolicy()
config.set_authentication_policy(authn_policy)