code: func processPubSubRequest(c context.Context, rw http.ResponseWriter, r *http.Request, callback notifcationGetter) {
  	c = defaultNS(c)
  	info, err := GetLatestSnapshotInfo(c)
  	if err != nil {
  		replyError(c, rw, err)
  		return
  	}
  	if info == nil {
  		// Return HTTP 200 to avoid a redelivery.
  		replyOK(c, rw, "Auth Service URL is not configured, skipping the message")
  		return
  	}
  	srv := getAuthService(c, info.AuthServiceURL)
  
  	notify, err := callback(c, srv, info.AuthServiceURL)
  	if err != nil {
  		replyError(c, rw, err)
  		return
  	}
  
  	// notify may be nil if PubSub messages didn't pass authentication.
  	if notify == nil {
  		replyOK(c, rw, "No new valid AuthDB change notifications")
  		return
  	}
  
  	// Don't bother processing late messages (ack them though).
  	latest := info
  	if notify.Revision > info.Rev {
  		var err error
  		if latest, err = syncAuthDB(c); err != nil {
  			replyError(c, rw, err)
  			return
  		}
  	}
  
  	if err := notify.Acknowledge(c); err != nil {
  		replyError(c, rw, err)
  		return
  	}
  
  	replyOK(
  		c, rw, "Processed PubSub notification for rev %d: %d -> %d",
  		notify.Revision, info.Rev, latest.Rev)
  }
docs: // processPubSubRequest is common wrapper for pubSubPull and pubSubPush.
  //
  // It implements most logic of notification handling. Calls supplied callback
  // to actually get service.Notification, since this part is different from Pull
  // and Push subscriptions.