diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-07-24 18:27:00 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-07-24 18:27:00 +0000 |
commit | 1980c66952eae7016f80cc819f88e4ad9b099c65 (patch) | |
tree | 5c8ae84d1aab8f960d339c6d9fbd8b1acfc7af4d /openstack_auth/user.py | |
parent | 70b6305e63cd403419f4559104f0db36a3dd80df (diff) | |
parent | ece924a79d27ede1a8475d7f98e6d66bc3cffd6c (diff) | |
download | django_openstack_auth-1980c66952eae7016f80cc819f88e4ad9b099c65.tar.gz |
Merge "Configurable token hashing"
Diffstat (limited to 'openstack_auth/user.py')
-rw-r--r-- | openstack_auth/user.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/openstack_auth/user.py b/openstack_auth/user.py index 1f9db7a..7e9a8ef 100644 --- a/openstack_auth/user.py +++ b/openstack_auth/user.py @@ -23,6 +23,7 @@ from openstack_auth import utils LOG = logging.getLogger(__name__) +_TOKEN_HASH_ENABLED = getattr(settings, 'OPENSTACK_TOKEN_HASH_ENABLED', True) def set_session_from_user(request, user): @@ -81,8 +82,9 @@ class Token(object): # Token-related attributes self.id = auth_ref.auth_token self.unscoped_token = unscoped_token - if (keystone_cms.is_asn1_token(self.id) - or keystone_cms.is_pkiz(self.id)): + if (_TOKEN_HASH_ENABLED and + (keystone_cms.is_asn1_token(self.id) + or keystone_cms.is_pkiz(self.id))): algorithm = getattr(settings, 'OPENSTACK_TOKEN_HASH_ALGORITHM', 'md5') hasher = hashlib.new(algorithm) |