code: 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
docs: A decorator used to protect methods with HTTP Digest authentication.