Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
return message
+def negotiate(method):
+ """
+ Requires clients to use SPNEGO
+ """
+ @functools.wraps(method)
+ def wrapper(self, *args, **kwargs):
+ if not self.current_user:
+ # Send the Negotiate header
+ self.add_header("WWW-Authenticate", "Negotiate")
+
+ # Respond with 401
+ self.set_status(401)
+ self.finish()
+
+ return None
+
+ return method(self, *args, **kwargs)
+
+ return wrapper
+
class ratelimit(object):
"""
A decorator class which limits how often a function can be called