Skip to content

Commit

Permalink
setup factored to be able to use any hashing algo
Browse files Browse the repository at this point in the history
  • Loading branch information
vangheem committed Jan 25, 2013
1 parent a00d523 commit ec1cb20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions factored/auth_tkt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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,
Expand All @@ -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

Expand Down

0 comments on commit ec1cb20

Please sign in to comment.