source: main/waeup.cas/trunk/waeup/cas/server.py @ 10328

Last change on this file since 10328 was 10327, checked in by uli, 12 years ago

Stubs for locations required by CAS protocol.

File size: 660 bytes
Line 
1"""A WSGI app for serving CAS.
2"""
3from webob import exc, Response
4from webob.dec import wsgify
5
6
7class CASServer(object):
8    """A WSGI CAS server.
9    """
10    @wsgify
11    def __call__(self, req):
12        if req.path_qs in ['/login', '/validate', '/logout']:
13            return getattr(self, req.path_qs[1:])(req)
14        return exc.HTTPNotFound()
15
16    def login(self, req):
17        return Response('Hi there!')
18
19    def validate(self, req):
20        return exc.HTTPNotImplemented()
21
22    def logout(self, req):
23        return exc.HTTPNotImplemented()
24
25cas_server = CASServer
26
27
28def make_cas_server(global_conf, **local_conf):
29    return CASServer(**local_conf)
Note: See TracBrowser for help on using the repository browser.