ci: upgrade pylint to latest version
core: also upgrade kombu as https://github.com/celery/kombu/issues/1101 is fixed now
This commit is contained in:
@ -1,22 +1,17 @@
|
||||
"""passbook OTP Utils"""
|
||||
|
||||
from django.conf import settings
|
||||
from django.utils.http import urlencode
|
||||
|
||||
|
||||
def otpauth_url(accountname, secret, issuer=None, digits=6):
|
||||
"""Create otpauth according to
|
||||
https://github.com/google/google-authenticator/wiki/Key-Uri-Format"""
|
||||
|
||||
accountname = accountname
|
||||
issuer = issuer if issuer else getattr(settings, 'OTP_TOTP_ISSUER')
|
||||
|
||||
# Ensure that the secret parameter is the FIRST parameter of the URI, this
|
||||
# allows Microsoft Authenticator to work.
|
||||
query = [
|
||||
('secret', secret),
|
||||
('digits', digits),
|
||||
('issuer', issuer),
|
||||
('issuer', 'passbook'),
|
||||
]
|
||||
|
||||
return 'otpauth://totp/%s:%s?%s' % (issuer, accountname, urlencode(query))
|
||||
|
||||
Reference in New Issue
Block a user