The first real stage of the pipeline is authentication. AuthHandler inspects the request and decides whether it may continue.
Implement AuthHandler.handle(request):
class Handler:
def __init__(self):
self._next = None
def set_next(self, handler):
self._next = handler
return handler
def handle(self, request):
if self._next is not None:
return self._next.handle(request)
return None
class AuthHandler(Handler):
def handle(self, request):
"""Reject when no user, otherwise pass down the chain."""
# TODO: if request.get("user") is None: return {"status": 401, "body": "unauthorized"}
# TODO: return super().handle(request)
pass
The editor and the test runner need a wide screen. Open this page on a desktop browser and your progress will be waiting.
The first real stage of the pipeline is authentication. AuthHandler inspects the request and decides whether it may continue.
Implement AuthHandler.handle(request):
Press Run Tests or ββ© to check your solution.