// Post handles all SCEP POST requests
Post handles all SCEP POST requests
// Post handles all SCEP POST requests
func (h *Handler) Post(w http.ResponseWriter, r *http.Request) {
	request, err := decodeSCEPRequest(r)
	if err != nil {
		writeError(w, errors.Wrap(err, "invalid scep post request"))
		return
	}
	ctx := r.Context()
	var response SCEPResponse
	switch request.Operation {
	case opnPKIOperation:
		response, err = h.PKIOperation(ctx, request)
	default:
		err = errors.Errorf("unknown operation: %s", request.Operation)
	}
	if err != nil {
		writeError(w, errors.Wrap(err, "scep post request failed"))
		return
	}
	writeSCEPResponse(w, response)
}
func ( h * Handler ) Post ( w http . ResponseWriter , r * http . Request ) { request , err := decodeSCEPRequest ( r ) if err != nil { writeError ( w , errors . Wrap ( err , " " ) ) return } ctx := r . Context ( ) var response SCEPResponse switch request . Operation { case opnPKIOperation : response , err = h . PKIOperation ( ctx , request ) default : err = errors . Errorf ( " " , request . Operation ) } if err != nil { writeError ( w , errors . Wrap ( err , " " ) ) return } writeSCEPResponse ( w , response ) }
Post handles all SCEP POST requests
Post handles all SCEP POST requests