code: func (ctx *Ctx) AuthZRequest(w http.ResponseWriter, r *http.Request) error {
  	var body []byte
  	if sendBody(ctx.requestURI, r.Header) && r.ContentLength > 0 && r.ContentLength < maxBodySize {
  		var err error
  		body, r.Body, err = drainBody(r.Body)
  		if err != nil {
  			return err
  		}
  	}
  
  	var h bytes.Buffer
  	if err := r.Header.Write(&h); err != nil {
  		return err
  	}
  
  	ctx.authReq = &Request{
  		User:            ctx.user,
  		UserAuthNMethod: ctx.userAuthNMethod,
  		RequestMethod:   ctx.requestMethod,
  		RequestURI:      ctx.requestURI,
  		RequestBody:     body,
  		RequestHeaders:  headers(r.Header),
  	}
  
  	if r.TLS != nil {
  		for _, c := range r.TLS.PeerCertificates {
  			pc := PeerCertificate(*c)
  			ctx.authReq.RequestPeerCertificates = append(ctx.authReq.RequestPeerCertificates, &pc)
  		}
  	}
  
  	for _, plugin := range ctx.plugins {
  		logrus.Debugf("AuthZ request using plugin %s", plugin.Name())
  
  		authRes, err := plugin.AuthZRequest(ctx.authReq)
  		if err != nil {
  			return fmt.Errorf("plugin %s failed with error: %s", plugin.Name(), err)
  		}
  
  		if !authRes.Allow {
  			return newAuthorizationError(plugin.Name(), authRes.Msg)
  		}
  	}
  
  	return nil
  }
docs: // AuthZRequest authorized the request to the docker daemon using authZ plugins