##// END OF EJS Templates
authn: don't use formatted_json to log statements. It totally screws up...
marcink -
r12:2adf7c1f default
parent child Browse files
Show More
@@ -36,7 +36,6 b' from sqlalchemy.ext.hybrid import hybrid'
36 36 from rhodecode.authentication.base import RhodeCodeExternalAuthPlugin
37 37 from rhodecode.authentication.schema import AuthnPluginSettingsSchemaBase
38 38 from rhodecode.authentication.routes import AuthnPluginResourceBase
39 from rhodecode.lib.ext_json import formatted_json
40 39 from rhodecode.lib.utils2 import safe_unicode
41 40 from rhodecode.model.db import User
42 41
@@ -119,17 +118,15 b' class RhodeCodeAuthPlugin(RhodeCodeExter'
119 118 log.debug('Empty username or password skipping...')
120 119 return None
121 120
122 log.debug("Jasig CAS settings: \n%s" % (formatted_json(settings)))
121 log.debug("Jasig CAS settings: %s", settings)
123 122 params = urllib.urlencode({'username': username, 'password': password})
124 123 headers = {"Content-type": "application/x-www-form-urlencoded",
125 124 "Accept": "text/plain",
126 125 "User-Agent": "RhodeCode-auth-%s" % rhodecode.__version__}
127 126 url = settings["service_url"]
128 127
129 log.debug("Sent Jasig CAS: \n%s"
130 % (formatted_json({"url": url,
131 "body": params,
132 "headers": headers})))
128 log.debug("Sent Jasig CAS: \n%s",
129 {"url": url, "body": params, "headers": headers})
133 130 request = urllib2.Request(url, params, headers)
134 131 try:
135 132 response = urllib2.urlopen(request)
@@ -36,7 +36,6 b' from rhodecode.authentication.routes imp'
36 36 from rhodecode.lib.exceptions import (
37 37 LdapConnectionError, LdapUsernameError, LdapPasswordError, LdapImportError
38 38 )
39 from rhodecode.lib.ext_json import formatted_json
40 39 from rhodecode.lib.utils2 import safe_unicode, safe_str
41 40 from rhodecode.model.db import User
42 41 from rhodecode.model.validators import Missing
@@ -435,7 +434,7 b' class RhodeCodeAuthPlugin(RhodeCodeExter'
435 434 'extern_name': user_dn,
436 435 'extern_type': extern_type,
437 436 }
438 log.debug('ldap user: \n%s', formatted_json(user_attrs))
437 log.debug('ldap user: %s', user_attrs)
439 438 log.info('user %s authenticated correctly', user_attrs['username'])
440 439
441 440 return user_attrs
@@ -35,7 +35,6 b' from sqlalchemy.ext.hybrid import hybrid'
35 35 from rhodecode.authentication.base import RhodeCodeExternalAuthPlugin
36 36 from rhodecode.authentication.schema import AuthnPluginSettingsSchemaBase
37 37 from rhodecode.authentication.routes import AuthnPluginResourceBase
38 from rhodecode.lib.ext_json import formatted_json
39 38
40 39 log = logging.getLogger(__name__)
41 40
@@ -151,6 +150,6 b' class RhodeCodeAuthPlugin(RhodeCodeExter'
151 150 log.warning("Cannot extract additional info for PAM user")
152 151 pass
153 152
154 log.debug("pamuser: \n%s" % formatted_json(user_attrs))
153 log.debug("pamuser: %s", user_attrs)
155 154 log.info('user %s authenticated correctly' % user_attrs['username'])
156 155 return user_attrs
General Comments 0
You need to be logged in to leave comments. Login now