aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Chatzimichos <tampakrap@gmail.com>2013-08-17 15:19:52 -0700
committerTheo Chatzimichos <tampakrap@gmail.com>2013-08-17 15:19:52 -0700
commit485e9c2fe340d4495e098517e8bccbb1ea485617 (patch)
treef0ab6fde4cc475660ee2f39ab1d038c09e0969b2 /okupy/accounts
parentMerge pull request #63 from dastergon/improve_lists_view (diff)
parentUse LDAP as secret backend for OTP. (diff)
downloadidentity.gentoo.org-485e9c2fe340d4495e098517e8bccbb1ea485617.tar.gz
identity.gentoo.org-485e9c2fe340d4495e098517e8bccbb1ea485617.tar.bz2
identity.gentoo.org-485e9c2fe340d4495e098517e8bccbb1ea485617.zip
Merge pull request #66 from mgorny/otp-ldap
Use LDAP as secret backend for OTP.
Diffstat (limited to 'okupy/accounts')
-rw-r--r--okupy/accounts/models.py2
-rw-r--r--okupy/accounts/views.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/okupy/accounts/models.py b/okupy/accounts/models.py
index 06b04d6..4d367d2 100644
--- a/okupy/accounts/models.py
+++ b/okupy/accounts/models.py
@@ -55,6 +55,8 @@ class LDAPUser(ldapdb.models.Model):
gpg_key = ListField(db_column='gpgKey')
latitude = FloatField(db_column='lat')
longitude = FloatField(db_column='lon')
+ otp_secret = CharField(db_column='gentooOTPSecret')
+ otp_recovery_keys = ListField(db_column='gentooOTPRecoveryKey')
# gentooDevGroup
roles = CharField(db_column='gentooRoles')
alias = ListField(db_column='gentooAlias')
diff --git a/okupy/accounts/views.py b/okupy/accounts/views.py
index b477e42..1f456e5 100644
--- a/okupy/accounts/views.py
+++ b/okupy/accounts/views.py
@@ -397,8 +397,7 @@ def otp_setup(request):
for i in range(0, len(secret), 4)])
if skeys:
# xxx xx xxx
- def group_key(k):
- s = str(k)
+ def group_key(s):
return ' '.join([s[0:3], s[3:5], s[5:8]])
skeys = list([group_key(k) for k in skeys])