code: func (r *MintOAuthTokenGrantRPC) validateRequest(c context.Context, req *minter.MintOAuthTokenGrantRequest, caller identity.Identity) (*Rule, error) {
  	// Dump the whole request and relevant auth state to the debug log.
  	r.logRequest(c, req, caller)
  
  	// Reject obviously bad requests.
  	if err := r.checkRequestFormat(req); err != nil {
  		logging.WithError(err).Errorf(c, "Bad request")
  		return nil, status.Errorf(codes.InvalidArgument, "bad request - %s", err)
  	}
  
  	// TODO(vadimsh): Verify that this user is present by requiring the end user's
  	// credentials, e.g make Swarming forward user's OAuth token to the token
  	// server, so it can be validated here.
  
  	// Check that requested usage is allowed and grab the corresponding rule.
  	return r.checkRules(c, req, caller)
  }
docs: // validateRequest checks that the request is allowed.
  //
  // Returns corresponding config rule on success or a grpc error on error.