File: __init__.py_tmpl

package info (click to toggle)
python-authkit 0.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 892 kB
  • ctags: 880
  • sloc: python: 6,272; makefile: 40; sh: 34
file content (23 lines) | stat: -rw-r--r-- 594 bytes parent folder | download | duplicates (3)
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