original_docstring: 
      Validate the incoming JWT token, don't allow access to the endpoint unless we pass this test
  
      :param scope: A list of scope identifiers used to protect the endpoint
      :param request: The incoming request object
      :param on_error: The error structure
      :return: Exit variables from the protected function
      
docstring: Validate the incoming JWT token, don't allow access to the endpoint unless we pass this test
docstring_tokens: Validate the incoming JWT token don ' t allow access to the endpoint unless we pass this test
code: def validate_jwt(scope, request, on_error=None):
      """
      Validate the incoming JWT token, don't allow access to the endpoint unless we pass this test
  
      :param scope: A list of scope identifiers used to protect the endpoint
      :param request: The incoming request object
      :param on_error: The error structure
      :return: Exit variables from the protected function
      """
      def authorization_required_decorator(original_function):
          @wraps(original_function)
          def authorization_required_wrapper(*args, **kwargs):
              if not ons_env.is_secure:
                  return original_function(*args, **kwargs)
  
              if ons_env.jwt.validate(scope, request.headers.get('authorization', '')):
                  return original_function(*args, **kwargs)
  
              if not on_error:
                  return "Access forbidden", 403
  
              return render_template(on_error.get('file'), _theme='default', data=on_error.get('error'))
  
          return authorization_required_wrapper
      return authorization_required_decorator
code_tokens: def validate_jwt ( scope , request , on_error = None ) : def authorization_required_decorator ( original_function ) : @ wraps ( original_function ) def authorization_required_wrapper ( * args , ** kwargs ) : if not ons_env . is_secure : return original_function ( * args , ** kwargs ) if ons_env . jwt . validate ( scope , request . headers . get ( 'authorization' , '' ) ) : return original_function ( * args , ** kwargs ) if not on_error : return "Access forbidden" , 403 return render_template ( on_error . get ( 'file' ) , _theme = 'default' , data = on_error . get ( 'error' ) ) return authorization_required_wrapper return authorization_required_decorator
short_docstring: Validate the incoming JWT token, don't allow access to the endpoint unless we pass this test
short_docstring_tokens: Validate the incoming JWT token don ' t allow access to the endpoint unless we pass this test
comment: """
      Validate the incoming JWT token, don't allow access to the endpoint unless we pass this test
  
      :param scope: A list of scope identifiers used to protect the endpoint
      :param request: The incoming request object
      :param on_error: The error structure
      :return: Exit variables from the protected function
      """