mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
b2c03bde79
commit
3a758cc7d2
@ -5,7 +5,7 @@ __license__ = 'GPL v3'
|
|||||||
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import time, sys, uuid, hashlib
|
import time, sys, hashlib, binascii, random, os
|
||||||
from urllib import quote as quote_, unquote as unquote_
|
from urllib import quote as quote_, unquote as unquote_
|
||||||
from functools import wraps
|
from functools import wraps
|
||||||
|
|
||||||
@ -89,7 +89,8 @@ class AuthController(object):
|
|||||||
def __init__(self, realm, users_dict):
|
def __init__(self, realm, users_dict):
|
||||||
self.realm = realm
|
self.realm = realm
|
||||||
self.users_dict = users_dict
|
self.users_dict = users_dict
|
||||||
self.secret = bytes(uuid.uuid4().hex)
|
self.secret = bytes(binascii.hexlify(os.urandom(random.randint(20,
|
||||||
|
30))))
|
||||||
self.cookie_name = 'android_workaround'
|
self.cookie_name = 'android_workaround'
|
||||||
|
|
||||||
def hashit(self, raw):
|
def hashit(self, raw):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user