1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
from authkit.authenticate import middleware, AuthKitConfigError, strip_base
from authkit.authenticate.multi import MultiHandler, status_checker
class Handler:
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
# Implement your middleware here
pass
def make_handler(
app,
auth_conf,
app_conf=None,
global_conf=None,
prefix='authkit.method.{{package}}.',
):
app = MultiHandler(app)
app.add_method({{repr(package)}}, Handler)
app.add_checker({{repr(package)}}, status_checker)
return app
|