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