import binascii, hashlib, threading, time
import binascii, hashlib, threading, time
class unauthorized(resp.httperror):
def __init__(self, challenge, message=None, detail=None):
class unauthorized(resp.httperror):
def __init__(self, challenge, message=None, detail=None):
if isinstance(challenge, str):
challenge = [challenge]
self.challenge = challenge
if isinstance(challenge, str):
challenge = [challenge]
self.challenge = challenge
def handle(self, req):
for challenge in self.challenge:
req.ohead.add("WWW-Authenticate", challenge)
def handle(self, req):
for challenge in self.challenge:
req.ohead.add("WWW-Authenticate", challenge)
class forbidden(resp.httperror):
def __init__(self, message=None, detail=None):
class forbidden(resp.httperror):
def __init__(self, message=None, detail=None):
with self._lock:
self._cache[nm, pwh] = (lock, now, "f", exc)
raise
with self._lock:
self._cache[nm, pwh] = (lock, now, "f", exc)
raise