Skip to content

Instantly share code, notes, and snippets.

@jaredlockhart
Created March 15, 2019 17:23
Show Gist options
  • Save jaredlockhart/dcf99e96e8f18bcc3c8af31f2ab81ebf to your computer and use it in GitHub Desktop.
Save jaredlockhart/dcf99e96e8f18bcc3c8af31f2ab81ebf to your computer and use it in GitHub Desktop.
class AuthenticationDelegator(object):
def __init__(self, auth_middlewares):
self.auth_middlewares = auth_middlewares
def process_request(self, request):
for middlware in self.auth_middlewares:
try:
return middleware.process_request(request):
except RequestRejected, e:
continue
raise RequestRejected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment