# -*- encoding: utf-8 -*- import cgi import json import time import hashlib import functools from itsdangerous import SignatureExpired, BadSignature from werkzeug.http import dump_cookie from werkzeug.routing import Rule from werkzeug.wrappers import Response from werkzeug.exceptions import BadRequest, Forbidden, NotFound from werkzeug.wsgi import get_current_url from werkzeug.utils import redirect from isso.compat import text_type as str from isso import utils, local from isso.utils import http, parse, JSONResponse as JSON from isso.utils.crypto import pbkdf2 from isso.views import requires def sha1(text): return hashlib.sha1(text.encode('utf-8')).hexdigest() def xhr(func): """A decorator to check for CSRF on POST/PUT/DELETE using a