def digest_auth(realm, auth_func):
    def digest_auth_decorator(func):
        def func_replacement(self, *args, **kwargs):
            # 'self' here is the RequestHandler object, which is inheriting
            # from DigestAuthMixin to get 'get_authenticated_user'
            if self.get_authenticated_user(auth_func, realm):
                return func(self, *args, **kwargs)
        return func_replacement
    return digest_auth_decorator
A decorator used to protect methods with HTTP Digest authentication.
dataset/ETHPy150Open gmr/tinman/tinman/auth/digest.py/digest_auth