Permalink
Browse files

setup factored to be able to use any hashing algo

  • Loading branch information...
1 parent a00d523 commit ec1cb209668b07b6e3dee872adf307bcf472268a @vangheem vangheem committed Jan 25, 2013
Showing with 5 additions and 3 deletions.
  1. +2 −0 README.txt
  2. +3 −3 factored/auth_tkt.py
View
@@ -54,6 +54,8 @@ auth_tkt.wild_domain
An auth_tkt cookie will be generated for the wildcard domain.
auth_tkt.cookie_domain
To set the cookie on an additional different domain.
+auth_tkt.hashalg
+ Set to use a different hashing algorithm. Defaults to sha512
auth_timeout
The amount of time in seconds a normal authentication session is valid for.
auth_remember_timeout
View
@@ -9,7 +9,6 @@
class CookieHelper(AuthTktCookieHelper):
def __init__(self, *args, **kwargs):
self.cookie_domain = kwargs.pop('cookie_domain', False)
- kwargs['hashalg'] = 'sha512'
super(CookieHelper, self).__init__(*args, **kwargs)
@@ -38,7 +37,7 @@ class AuthenticationPolicy(AuthTktAuthenticationPolicy):
def __init__(self, secret, callback=None, cookie_name='auth_tkt',
secure=False, include_ip=False, timeout=None, reissue_time=None,
max_age=None, path="/", http_only=False, wild_domain=True,
- cookie_domain=False, debug=False):
+ cookie_domain=False, debug=False, hashalg='sha512'):
self.cookie = CookieHelper(
secret,
cookie_name=cookie_name,
@@ -50,7 +49,8 @@ def __init__(self, secret, callback=None, cookie_name='auth_tkt',
http_only=http_only,
path=path,
wild_domain=wild_domain,
- cookie_domain=cookie_domain)
+ cookie_domain=cookie_domain,
+ hashalg=hashalg)
self.callback = callback
self.debug = debug

0 comments on commit ec1cb20

Please sign in to comment.