Created
March 20, 2013 22:04
webob middleware layer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from webob.dec import wsgify | |
from webob import exc | |
@wsgify.middleware | |
def auth_filter(request, app): | |
if request.headers.get('X-Auth-Token') != 'open-sesame': | |
return exc.HTTPForbidden() | |
return app(request) | |
def filter_factory(global_config, **local_config): | |
return auth_filter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment