def __call__(self, environ, start_response):
                
        request = Request(environ)
        auth = request.authorization

        if not auth or not self.allows(username=auth.username, password=auth.password):
            return self.authenticate()(environ, start_response)
        else:
            environ["user"] = self.usermap[auth.username]
            return self.app(environ, start_response)
tests
dataset/ETHPy150Open marchon/Flask-API-Server/apiserver/authentication.py/AuthenticationMiddleware.__call__