diff options
author | Michał Górny <mgorny@gentoo.org> | 2013-08-22 21:20:17 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2013-08-23 12:49:15 +0200 |
commit | 90aa5e39bb44bbc46ec52976879c7f13cbc329e1 (patch) | |
tree | 6a26d2404037505f60363d55397f048f47a1950f /okupy/common/auth.py | |
parent | Add tests for SSL auth. (diff) | |
download | identity.gentoo.org-90aa5e39bb44bbc46ec52976879c7f13cbc329e1.tar.gz identity.gentoo.org-90aa5e39bb44bbc46ec52976879c7f13cbc329e1.tar.bz2 identity.gentoo.org-90aa5e39bb44bbc46ec52976879c7f13cbc329e1.zip |
SSLCertAuthBackend: make request mandatory.
django.contrib.auth is prepared to call backends which don't have
matching prototype. Therefore, with mandatory 'request' the backend
simply won't be called for non-SSL requests.
Diffstat (limited to 'okupy/common/auth.py')
-rw-r--r-- | okupy/common/auth.py | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/okupy/common/auth.py b/okupy/common/auth.py index 0747d12..d7a7f95 100644 --- a/okupy/common/auth.py +++ b/okupy/common/auth.py @@ -15,10 +15,7 @@ class SSLCertAuthBackend(ModelBackend): It requires one of owner e-mails to match in LDAP. """ - def authenticate(self, request=None): - if request is None: - return None - + def authenticate(self, request): # it can be: SUCCESS, NONE and likely some string for failure ;) cert_verify = request.META.get('SSL_CLIENT_VERIFY', None) if cert_verify != 'SUCCESS': |