Password-protect the JSON RPC interface
This commit is contained in:
@@ -34,6 +34,8 @@ import urlparse
|
||||
import urllib
|
||||
import threading
|
||||
from i18n import _
|
||||
import hmac
|
||||
|
||||
|
||||
base_units = {'BTC':8, 'mBTC':5, 'uBTC':2}
|
||||
fee_levels = [_('Within 25 blocks'), _('Within 10 blocks'), _('Within 5 blocks'), _('Within 2 blocks'), _('In the next block')]
|
||||
@@ -191,6 +193,13 @@ def json_decode(x):
|
||||
except:
|
||||
return x
|
||||
|
||||
|
||||
# taken from Django Source Code
|
||||
def constant_time_compare(val1, val2):
|
||||
"""Return True if the two strings are equal, False otherwise."""
|
||||
return hmac.compare_digest(to_bytes(val1, 'utf8'), to_bytes(val2, 'utf8'))
|
||||
|
||||
|
||||
# decorator that prints execution time
|
||||
def profiler(func):
|
||||
def do_profile(func, args, kw_args):
|
||||
|
||||
Reference in New Issue
Block a user