mirror of
https://github.com/status-im/consul.git
synced 2025-01-12 06:44:41 +00:00
cd1b613352
* Update AWS SDK to use PCA features. * Add AWS PCA provider * Add plumbing for config, config validation tests, add test for inheriting existing CA resources created by user * Unparallel the tests so we don't exhaust PCA limits * Merge updates * More aggressive polling; rate limit pass through on sign; Timeout on Sign and CA create * Add AWS PCA docs * Fix Vault doc typo too * Doc typo * Apply suggestions from code review Co-Authored-By: R.B. Boyer <rb@hashicorp.com> Co-Authored-By: kaitlincarter-hc <43049322+kaitlincarter-hc@users.noreply.github.com> * Doc fixes; tests for erroring if State is modified via API * More review cleanup * Uncomment tests! * Minor suggested clean ups
40 lines
1.4 KiB
Go
40 lines
1.4 KiB
Go
package query
|
|
|
|
//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/query.json unmarshal_test.go
|
|
|
|
import (
|
|
"encoding/xml"
|
|
|
|
"github.com/aws/aws-sdk-go/aws/awserr"
|
|
"github.com/aws/aws-sdk-go/aws/request"
|
|
"github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil"
|
|
)
|
|
|
|
// UnmarshalHandler is a named request handler for unmarshaling query protocol requests
|
|
var UnmarshalHandler = request.NamedHandler{Name: "awssdk.query.Unmarshal", Fn: Unmarshal}
|
|
|
|
// UnmarshalMetaHandler is a named request handler for unmarshaling query protocol request metadata
|
|
var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.query.UnmarshalMeta", Fn: UnmarshalMeta}
|
|
|
|
// Unmarshal unmarshals a response for an AWS Query service.
|
|
func Unmarshal(r *request.Request) {
|
|
defer r.HTTPResponse.Body.Close()
|
|
if r.DataFilled() {
|
|
decoder := xml.NewDecoder(r.HTTPResponse.Body)
|
|
err := xmlutil.UnmarshalXML(r.Data, decoder, r.Operation.Name+"Result")
|
|
if err != nil {
|
|
r.Error = awserr.NewRequestFailure(
|
|
awserr.New(request.ErrCodeSerialization, "failed decoding Query response", err),
|
|
r.HTTPResponse.StatusCode,
|
|
r.RequestID,
|
|
)
|
|
return
|
|
}
|
|
}
|
|
}
|
|
|
|
// UnmarshalMeta unmarshals header response values for an AWS Query service.
|
|
func UnmarshalMeta(r *request.Request) {
|
|
r.RequestID = r.HTTPResponse.Header.Get("X-Amzn-Requestid")
|
|
}
|