From 7bbc764fead608421a340378f04946d8fc24c0a6 Mon Sep 17 00:00:00 2001 From: Jason Del Ponte Date: Thu, 23 Jun 2016 15:54:42 -0700 Subject: [PATCH] aws/signer/v4: Move AWS V4 Signer into public package (#735) * aws/signer/v4: Move AWS V4 Signer into public package Moves the private/signer/v4 into the aws/signer/v4 package, exposing it for general use. * aws/signer/v4: Update signers documentation and request handler name Updates the documentation for the V4 signer, along with renaming the request handler's name to reduce confusion between it and signing request outside of the context of the SDK. * private/model/api: Update code gen to use public v4 signer * private/signer/v4: Remove old private v4 signer --- {private => aws}/signer/v4/functional_test.go | 3 +- {private => aws}/signer/v4/header_rules.go | 0 .../signer/v4/header_rules_test.go | 0 aws/signer/v4/v4.go | 584 ++++++++++++++++++ {private => aws}/signer/v4/v4_test.go | 162 +++-- private/model/api/api.go | 4 +- private/protocol/ec2query/build_test.go | 20 +- private/protocol/ec2query/unmarshal_test.go | 20 +- private/protocol/jsonrpc/build_test.go | 16 +- private/protocol/jsonrpc/unmarshal_test.go | 14 +- private/protocol/query/build_test.go | 28 +- private/protocol/query/unmarshal_test.go | 32 +- private/protocol/restjson/build_test.go | 40 +- private/protocol/restjson/unmarshal_test.go | 24 +- private/protocol/restxml/build_test.go | 48 +- private/protocol/restxml/unmarshal_test.go | 26 +- private/signer/v2/v2.go | 10 +- private/signer/v2/v2_test.go | 4 +- private/signer/v4/v4.go | 465 -------------- service/acm/service.go | 4 +- service/apigateway/service.go | 4 +- service/applicationautoscaling/service.go | 4 +- .../applicationdiscoveryservice/service.go | 4 +- service/autoscaling/service.go | 4 +- service/cloudformation/service.go | 4 +- service/cloudfront/service.go | 4 +- service/cloudhsm/service.go | 4 +- service/cloudsearch/service.go | 4 +- service/cloudsearchdomain/service.go | 4 +- service/cloudtrail/service.go | 4 +- service/cloudwatch/service.go | 4 +- service/cloudwatchevents/service.go | 4 +- service/cloudwatchlogs/service.go | 4 +- service/codecommit/service.go | 4 +- service/codedeploy/service.go | 4 +- service/codepipeline/service.go | 4 +- service/cognitoidentity/service.go | 4 +- service/cognitoidentityprovider/service.go | 4 +- service/cognitosync/service.go | 4 +- service/configservice/service.go | 4 +- service/databasemigrationservice/service.go | 4 +- service/datapipeline/service.go | 4 +- service/devicefarm/service.go | 4 +- service/directconnect/service.go | 4 +- service/directoryservice/service.go | 4 +- service/dynamodb/service.go | 4 +- service/dynamodbstreams/service.go | 4 +- service/ec2/service.go | 4 +- service/ecr/service.go | 4 +- service/ecs/service.go | 4 +- service/efs/service.go | 4 +- service/elasticache/service.go | 4 +- service/elasticbeanstalk/service.go | 4 +- service/elasticsearchservice/service.go | 4 +- service/elastictranscoder/service.go | 4 +- service/elb/service.go | 4 +- service/emr/service.go | 4 +- service/firehose/service.go | 4 +- service/gamelift/service.go | 4 +- service/glacier/service.go | 4 +- service/iam/service.go | 4 +- service/inspector/service.go | 4 +- service/iot/service.go | 4 +- service/iotdataplane/service.go | 4 +- service/kinesis/service.go | 4 +- service/kms/service.go | 4 +- service/lambda/service.go | 4 +- service/machinelearning/service.go | 4 +- .../marketplacecommerceanalytics/service.go | 4 +- service/marketplacemetering/service.go | 4 +- service/mobileanalytics/service.go | 4 +- service/opsworks/service.go | 4 +- service/rds/service.go | 4 +- service/redshift/service.go | 4 +- service/route53/service.go | 4 +- service/route53domains/service.go | 4 +- service/s3/service.go | 4 +- service/ses/service.go | 4 +- service/simpledb/service.go | 2 +- service/sns/service.go | 4 +- service/sqs/service.go | 4 +- service/ssm/service.go | 4 +- service/storagegateway/service.go | 4 +- service/sts/service.go | 4 +- service/support/service.go | 4 +- service/swf/service.go | 4 +- service/waf/service.go | 4 +- service/workspaces/service.go | 4 +- 88 files changed, 942 insertions(+), 832 deletions(-) rename {private => aws}/signer/v4/functional_test.go (99%) rename {private => aws}/signer/v4/header_rules.go (100%) rename {private => aws}/signer/v4/header_rules_test.go (100%) create mode 100644 aws/signer/v4/v4.go rename {private => aws}/signer/v4/v4_test.go (78%) delete mode 100644 private/signer/v4/v4.go diff --git a/private/signer/v4/functional_test.go b/aws/signer/v4/functional_test.go similarity index 99% rename from private/signer/v4/functional_test.go rename to aws/signer/v4/functional_test.go index e5f42e8ca22..3001bc279b2 100644 --- a/private/signer/v4/functional_test.go +++ b/aws/signer/v4/functional_test.go @@ -6,11 +6,10 @@ import ( "testing" "time" - "github.com/stretchr/testify/assert" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/service/s3" + "github.com/stretchr/testify/assert" ) func TestPresignHandler(t *testing.T) { diff --git a/private/signer/v4/header_rules.go b/aws/signer/v4/header_rules.go similarity index 100% rename from private/signer/v4/header_rules.go rename to aws/signer/v4/header_rules.go diff --git a/private/signer/v4/header_rules_test.go b/aws/signer/v4/header_rules_test.go similarity index 100% rename from private/signer/v4/header_rules_test.go rename to aws/signer/v4/header_rules_test.go diff --git a/aws/signer/v4/v4.go b/aws/signer/v4/v4.go new file mode 100644 index 00000000000..bdc2f4de735 --- /dev/null +++ b/aws/signer/v4/v4.go @@ -0,0 +1,584 @@ +// Package v4 implements signing for AWS V4 signer +// +// Provides request signing for request that need to be signed with +// AWS V4 Signatures. +package v4 + +import ( + "crypto/hmac" + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "net/http" + "net/url" + "sort" + "strconv" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol/rest" +) + +const ( + authHeaderPrefix = "AWS4-HMAC-SHA256" + timeFormat = "20060102T150405Z" + shortTimeFormat = "20060102" +) + +var ignoredHeaders = rules{ + blacklist{ + mapRule{ + "Authorization": struct{}{}, + "User-Agent": struct{}{}, + }, + }, +} + +// requiredSignedHeaders is a whitelist for build canonical headers. +var requiredSignedHeaders = rules{ + whitelist{ + mapRule{ + "Cache-Control": struct{}{}, + "Content-Disposition": struct{}{}, + "Content-Encoding": struct{}{}, + "Content-Language": struct{}{}, + "Content-Md5": struct{}{}, + "Content-Type": struct{}{}, + "Expires": struct{}{}, + "If-Match": struct{}{}, + "If-Modified-Since": struct{}{}, + "If-None-Match": struct{}{}, + "If-Unmodified-Since": struct{}{}, + "Range": struct{}{}, + "X-Amz-Acl": struct{}{}, + "X-Amz-Copy-Source": struct{}{}, + "X-Amz-Copy-Source-If-Match": struct{}{}, + "X-Amz-Copy-Source-If-Modified-Since": struct{}{}, + "X-Amz-Copy-Source-If-None-Match": struct{}{}, + "X-Amz-Copy-Source-If-Unmodified-Since": struct{}{}, + "X-Amz-Copy-Source-Range": struct{}{}, + "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{}, + "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{}, + "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, + "X-Amz-Grant-Full-control": struct{}{}, + "X-Amz-Grant-Read": struct{}{}, + "X-Amz-Grant-Read-Acp": struct{}{}, + "X-Amz-Grant-Write": struct{}{}, + "X-Amz-Grant-Write-Acp": struct{}{}, + "X-Amz-Metadata-Directive": struct{}{}, + "X-Amz-Mfa": struct{}{}, + "X-Amz-Request-Payer": struct{}{}, + "X-Amz-Server-Side-Encryption": struct{}{}, + "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id": struct{}{}, + "X-Amz-Server-Side-Encryption-Customer-Algorithm": struct{}{}, + "X-Amz-Server-Side-Encryption-Customer-Key": struct{}{}, + "X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, + "X-Amz-Storage-Class": struct{}{}, + "X-Amz-Website-Redirect-Location": struct{}{}, + }, + }, + patterns{"X-Amz-Meta-"}, +} + +// allowedHoisting is a whitelist for build query headers. The boolean value +// represents whether or not it is a pattern. +var allowedQueryHoisting = inclusiveRules{ + blacklist{requiredSignedHeaders}, + patterns{"X-Amz-"}, +} + +// Signer applies AWS v4 signing to given request. Use this to sign requests +// that need to be signed with AWS V4 Signatures. +type Signer struct { + // The authentication credentials the request will be signed against. + // This value must be set to sign requests. + Credentials *credentials.Credentials + + // Sets the log level the signer should use when reporting information to + // the logger. If the logger is nil nothing will be logged. See + // aws.LogLevelType for more information on available logging levels + // + // By default nothing will be logged. + Debug aws.LogLevelType + + // The logger loging information will be written to. If there the logger + // is nil, nothing will be logged. + Logger aws.Logger + + // Disables the Signer's moving HTTP header key/value pairs from the HTTP + // request header to the request's query string. This is most commonly used + // with pre-signed requests preventing headers from being added to the + // request's query string. + DisableHeaderHoisting bool +} + +// NewSigner returns a Signer pointer configured with the credentials and optional +// option values provided. If not options are provided the Signer will use its +// default configuration. +func NewSigner(credentials *credentials.Credentials, options ...func(*Signer)) *Signer { + v4 := &Signer{ + Credentials: credentials, + } + + for _, option := range options { + option(v4) + } + + return v4 +} + +type signingCtx struct { + ServiceName string + Region string + Request *http.Request + Body io.ReadSeeker + Query url.Values + Time time.Time + ExpireTime time.Duration + SignedHeaderVals http.Header + + credValues credentials.Value + isPresign bool + formattedTime string + formattedShortTime string + + signedHeaders string + canonicalHeaders string + canonicalString string + credentialString string + stringToSign string + signature string + authorization string +} + +// Sign signs AWS v4 requests with the provided body, service name, region the +// request is made to, and time the request is signed at. The signTime allows +// you to specify that a request is signed for the future, and cannot be +// used until then. +// +// Returns a list of HTTP headers that were included in the signature or an +// error if signing the request failed. Generally for signed requests this value +// is not needed as the full request context will be captured by the http.Request +// value. It is included for reference though. +// +// Sign differs from Presign in that it will sign the request using HTTP +// header values. This type of signing is intended for http.Request values that +// will not be shared, or are shared in a way the header values on the request +// will not be lost. +// +// The requests body is an io.ReadSeeker so the SHA256 of the body can be +// generated. To bypass the signer computing the hash you can set the +// "X-Amz-Content-Sha256" header with a precomputed value. The signer will +// only compute the hash if the request header value is empty. +func (v4 Signer) Sign(r *http.Request, body io.ReadSeeker, service, region string, signTime time.Time) (http.Header, error) { + return v4.signWithBody(r, body, service, region, 0, signTime) +} + +// Presign signs AWS v4 requests with the provided body, service name, region +// the request is made to, and time the request is signed at. The signTime +// allows you to specify that a request is signed for the future, and cannot +// be used until then. +// +// Returns a list of HTTP headers that were included in the signature or an +// error if signing the request failed. For presigned requests these headers +// and their values must be included on the HTTP request when it is made. This +// is helpful to know what header values need to be shared with the party the +// presigned request will be distributed to. +// +// Presign differs from Sign in that it will sign the request using query string +// instead of header values. This allows you to share the Presigned Request's +// URL with third parties, or distribute it throughout your system with minimal +// dependencies. +// +// Presign also takes an exp value which is the duration the +// signed request will be valid after the signing time. This is allows you to +// set when the request will expire. +// +// The requests body is an io.ReadSeeker so the SHA256 of the body can be +// generated. To bypass the signer computing the hash you can set the +// "X-Amz-Content-Sha256" header with a precomputed value. The signer will +// only compute the hash if the request header value is empty. +// +// Presigning a S3 request will not compute the body's SHA256 hash by default. +// This is done due to the general use case for S3 presigned URLs is to share +// PUT/GET capabilities. If you would like to include the body's SHA256 in the +// presigned request's signature you can set the "X-Amz-Content-Sha256" +// HTTP header and that will be included in the request's signature. +func (v4 Signer) Presign(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) { + return v4.signWithBody(r, body, service, region, exp, signTime) +} + +func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) { + ctx := &signingCtx{ + Request: r, + Body: body, + Query: r.URL.Query(), + Time: signTime, + ExpireTime: exp, + isPresign: exp != 0, + ServiceName: service, + Region: region, + } + + if ctx.isRequestSigned() { + if !v4.Credentials.IsExpired() && time.Now().Before(ctx.Time.Add(10*time.Minute)) { + // If the request is already signed, and the credentials have not + // expired, and the request is not too old ignore the signing request. + return ctx.SignedHeaderVals, nil + } + ctx.Time = time.Now() + ctx.handlePresignRemoval() + } + + var err error + ctx.credValues, err = v4.Credentials.Get() + if err != nil { + return http.Header{}, err + } + + ctx.assignAmzQueryValues() + ctx.build(v4.DisableHeaderHoisting) + + if v4.Debug.Matches(aws.LogDebugWithSigning) { + v4.logSigningInfo(ctx) + } + + return ctx.SignedHeaderVals, nil +} + +func (ctx *signingCtx) handlePresignRemoval() { + if !ctx.isPresign { + return + } + + // The credentials have expired for this request. The current signing + // is invalid, and needs to be request because the request will fail. + ctx.removePresign() + + // Update the request's query string to ensure the values stays in + // sync in the case retrieving the new credentials fails. + ctx.Request.URL.RawQuery = ctx.Query.Encode() +} + +func (ctx *signingCtx) assignAmzQueryValues() { + if ctx.isPresign { + ctx.Query.Set("X-Amz-Algorithm", authHeaderPrefix) + if ctx.credValues.SessionToken != "" { + ctx.Query.Set("X-Amz-Security-Token", ctx.credValues.SessionToken) + } else { + ctx.Query.Del("X-Amz-Security-Token") + } + + return + } + + if ctx.credValues.SessionToken != "" { + ctx.Request.Header.Set("X-Amz-Security-Token", ctx.credValues.SessionToken) + } +} + +// SignRequestHandler is a named request handler the SDK will use to sign +// service client request with using the V4 signature. +var SignRequestHandler = request.NamedHandler{ + Name: "v4.SignRequestHandler", Fn: SignSDKRequest, +} + +// SignSDKRequest signs an AWS request with the V4 signature. This +// request handler is bested used only with the SDK's built in service client's +// API operation requests. +// +// This function should not be used on its on its own, but in conjunction with +// an AWS service client's API operation call. To sign a standalone request +// not created by a service client's API operation method use the "Sign" or +// "Presign" functions of the "Signer" type. +// +// If the credentials of the request's config are set to +// credentials.AnonymousCredentials the request will not be signed. +func SignSDKRequest(req *request.Request) { + // If the request does not need to be signed ignore the signing of the + // request if the AnonymousCredentials object is used. + if req.Config.Credentials == credentials.AnonymousCredentials { + return + } + + region := req.ClientInfo.SigningRegion + if region == "" { + region = aws.StringValue(req.Config.Region) + } + + name := req.ClientInfo.SigningName + if name == "" { + name = req.ClientInfo.ServiceName + } + + v4 := NewSigner(req.Config.Credentials, func(v4 *Signer) { + v4.Debug = req.Config.LogLevel.Value() + v4.Logger = req.Config.Logger + v4.DisableHeaderHoisting = req.NotHoist + }) + + signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.Body, name, region, req.ExpireTime, req.Time) + req.SignedHeaderVals = signedHeaders + req.Error = err +} + +const logSignInfoMsg = `DEBUG: Request Signiture: +---[ CANONICAL STRING ]----------------------------- +%s +---[ STRING TO SIGN ]-------------------------------- +%s%s +-----------------------------------------------------` +const logSignedURLMsg = ` +---[ SIGNED URL ]------------------------------------ +%s` + +func (v4 *Signer) logSigningInfo(ctx *signingCtx) { + signedURLMsg := "" + if ctx.isPresign { + signedURLMsg = fmt.Sprintf(logSignedURLMsg, ctx.Request.URL.String()) + } + msg := fmt.Sprintf(logSignInfoMsg, ctx.canonicalString, ctx.stringToSign, signedURLMsg) + v4.Logger.Log(msg) +} + +func (ctx *signingCtx) build(disableHeaderHoisting bool) { + ctx.buildTime() // no depends + ctx.buildCredentialString() // no depends + + unsignedHeaders := ctx.Request.Header + if ctx.isPresign { + if !disableHeaderHoisting { + urlValues := url.Values{} + urlValues, unsignedHeaders = buildQuery(allowedQueryHoisting, unsignedHeaders) // no depends + for k := range urlValues { + ctx.Query[k] = urlValues[k] + } + } + } + + ctx.buildCanonicalHeaders(ignoredHeaders, unsignedHeaders) + ctx.buildCanonicalString() // depends on canon headers / signed headers + ctx.buildStringToSign() // depends on canon string + ctx.buildSignature() // depends on string to sign + + if ctx.isPresign { + ctx.Request.URL.RawQuery += "&X-Amz-Signature=" + ctx.signature + } else { + parts := []string{ + authHeaderPrefix + " Credential=" + ctx.credValues.AccessKeyID + "/" + ctx.credentialString, + "SignedHeaders=" + ctx.signedHeaders, + "Signature=" + ctx.signature, + } + ctx.Request.Header.Set("Authorization", strings.Join(parts, ", ")) + } +} + +func (ctx *signingCtx) buildTime() { + ctx.formattedTime = ctx.Time.UTC().Format(timeFormat) + ctx.formattedShortTime = ctx.Time.UTC().Format(shortTimeFormat) + + if ctx.isPresign { + duration := int64(ctx.ExpireTime / time.Second) + ctx.Query.Set("X-Amz-Date", ctx.formattedTime) + ctx.Query.Set("X-Amz-Expires", strconv.FormatInt(duration, 10)) + } else { + ctx.Request.Header.Set("X-Amz-Date", ctx.formattedTime) + } +} + +func (ctx *signingCtx) buildCredentialString() { + ctx.credentialString = strings.Join([]string{ + ctx.formattedShortTime, + ctx.Region, + ctx.ServiceName, + "aws4_request", + }, "/") + + if ctx.isPresign { + ctx.Query.Set("X-Amz-Credential", ctx.credValues.AccessKeyID+"/"+ctx.credentialString) + } +} + +func buildQuery(r rule, header http.Header) (url.Values, http.Header) { + query := url.Values{} + unsignedHeaders := http.Header{} + for k, h := range header { + if r.IsValid(k) { + query[k] = h + } else { + unsignedHeaders[k] = h + } + } + + return query, unsignedHeaders +} +func (ctx *signingCtx) buildCanonicalHeaders(r rule, header http.Header) { + var headers []string + headers = append(headers, "host") + for k, v := range header { + canonicalKey := http.CanonicalHeaderKey(k) + if !r.IsValid(canonicalKey) { + continue // ignored header + } + if ctx.SignedHeaderVals == nil { + ctx.SignedHeaderVals = make(http.Header) + } + + lowerCaseKey := strings.ToLower(k) + if _, ok := ctx.SignedHeaderVals[lowerCaseKey]; ok { + // include additional values + ctx.SignedHeaderVals[lowerCaseKey] = append(ctx.SignedHeaderVals[lowerCaseKey], v...) + continue + } + + headers = append(headers, lowerCaseKey) + ctx.SignedHeaderVals[lowerCaseKey] = v + } + sort.Strings(headers) + + ctx.signedHeaders = strings.Join(headers, ";") + + if ctx.isPresign { + ctx.Query.Set("X-Amz-SignedHeaders", ctx.signedHeaders) + } + + headerValues := make([]string, len(headers)) + for i, k := range headers { + if k == "host" { + headerValues[i] = "host:" + ctx.Request.URL.Host + } else { + headerValues[i] = k + ":" + + strings.Join(ctx.SignedHeaderVals[k], ",") + } + } + + ctx.canonicalHeaders = strings.Join(stripExcessSpaces(headerValues), "\n") +} + +func (ctx *signingCtx) buildCanonicalString() { + ctx.Request.URL.RawQuery = strings.Replace(ctx.Query.Encode(), "+", "%20", -1) + uri := ctx.Request.URL.Opaque + if uri != "" { + uri = "/" + strings.Join(strings.Split(uri, "/")[3:], "/") + } else { + uri = ctx.Request.URL.Path + } + if uri == "" { + uri = "/" + } + + if ctx.ServiceName != "s3" { + uri = rest.EscapePath(uri, false) + } + + ctx.canonicalString = strings.Join([]string{ + ctx.Request.Method, + uri, + ctx.Request.URL.RawQuery, + ctx.canonicalHeaders + "\n", + ctx.signedHeaders, + ctx.bodyDigest(), + }, "\n") +} + +func (ctx *signingCtx) buildStringToSign() { + ctx.stringToSign = strings.Join([]string{ + authHeaderPrefix, + ctx.formattedTime, + ctx.credentialString, + hex.EncodeToString(makeSha256([]byte(ctx.canonicalString))), + }, "\n") +} + +func (ctx *signingCtx) buildSignature() { + secret := ctx.credValues.SecretAccessKey + date := makeHmac([]byte("AWS4"+secret), []byte(ctx.formattedShortTime)) + region := makeHmac(date, []byte(ctx.Region)) + service := makeHmac(region, []byte(ctx.ServiceName)) + credentials := makeHmac(service, []byte("aws4_request")) + signature := makeHmac(credentials, []byte(ctx.stringToSign)) + ctx.signature = hex.EncodeToString(signature) +} + +func (ctx *signingCtx) bodyDigest() string { + hash := ctx.Request.Header.Get("X-Amz-Content-Sha256") + if hash == "" { + if ctx.isPresign && ctx.ServiceName == "s3" { + hash = "UNSIGNED-PAYLOAD" + } else if ctx.Body == nil { + hash = hex.EncodeToString(makeSha256([]byte{})) + } else { + hash = hex.EncodeToString(makeSha256Reader(ctx.Body)) + } + ctx.Request.Header.Add("X-Amz-Content-Sha256", hash) + } + return hash +} + +// isRequestSigned returns if the request is currently signed or presigned +func (ctx *signingCtx) isRequestSigned() bool { + if ctx.isPresign && ctx.Query.Get("X-Amz-Signature") != "" { + return true + } + if ctx.Request.Header.Get("Authorization") != "" { + return true + } + + return false +} + +// unsign removes signing flags for both signed and presigned requests. +func (ctx *signingCtx) removePresign() { + ctx.Query.Del("X-Amz-Algorithm") + ctx.Query.Del("X-Amz-Signature") + ctx.Query.Del("X-Amz-Security-Token") + ctx.Query.Del("X-Amz-Date") + ctx.Query.Del("X-Amz-Expires") + ctx.Query.Del("X-Amz-Credential") + ctx.Query.Del("X-Amz-SignedHeaders") +} + +func makeHmac(key []byte, data []byte) []byte { + hash := hmac.New(sha256.New, key) + hash.Write(data) + return hash.Sum(nil) +} + +func makeSha256(data []byte) []byte { + hash := sha256.New() + hash.Write(data) + return hash.Sum(nil) +} + +func makeSha256Reader(reader io.ReadSeeker) []byte { + hash := sha256.New() + start, _ := reader.Seek(0, 1) + defer reader.Seek(start, 0) + + io.Copy(hash, reader) + return hash.Sum(nil) +} + +func stripExcessSpaces(headerVals []string) []string { + vals := make([]string, len(headerVals)) + for i, str := range headerVals { + stripped := "" + found := false + str = strings.TrimSpace(str) + for _, c := range str { + if !found && c == ' ' { + stripped += string(c) + found = true + } else if c != ' ' { + stripped += string(c) + found = false + } + } + vals[i] = stripped + } + return vals +} diff --git a/private/signer/v4/v4_test.go b/aws/signer/v4/v4_test.go similarity index 78% rename from private/signer/v4/v4_test.go rename to aws/signer/v4/v4_test.go index 604d6423582..dc9602fc69a 100644 --- a/private/signer/v4/v4_test.go +++ b/aws/signer/v4/v4_test.go @@ -1,6 +1,7 @@ package v4 import ( + "io" "net/http" "strings" "testing" @@ -14,7 +15,36 @@ import ( "github.com/aws/aws-sdk-go/awstesting" ) -func buildSigner(serviceName string, region string, signTime time.Time, expireTime time.Duration, body string) signer { +func TestStripExcessHeaders(t *testing.T) { + vals := []string{ + "123", + "1 2 3", + " 1 2 3", + "1 2 3", + "1 23", + "1 2 3", + "1 2 ", + " 1 2 ", + } + + expected := []string{ + "123", + "1 2 3", + "1 2 3", + "1 2 3", + "1 23", + "1 2 3", + "1 2", + "1 2", + } + + newVals := stripExcessSpaces(vals) + for i := 0; i < len(newVals); i++ { + assert.Equal(t, newVals[i], expected[i]) + } +} + +func buildRequest(serviceName, region, body string) (*http.Request, io.ReadSeeker) { endpoint := "https://" + serviceName + "." + region + ".amazonaws.com" reader := strings.NewReader(body) req, _ := http.NewRequest("POST", endpoint, reader) @@ -25,15 +55,11 @@ func buildSigner(serviceName string, region string, signTime time.Time, expireTi req.Header.Add("X-Amz-Meta-Other-Header", "some-value=!@#$%^&* (+)") req.Header.Add("X-Amz-Meta-Other-Header_With_Underscore", "some-value=!@#$%^&* (+)") req.Header.Add("X-amz-Meta-Other-Header_With_Underscore", "some-value=!@#$%^&* (+)") + return req, reader +} - return signer{ - Request: req, - Time: signTime, - ExpireTime: expireTime, - Query: req.URL.Query(), - Body: reader, - ServiceName: serviceName, - Region: region, +func buildSigner() Signer { + return Signer{ Credentials: credentials.NewStaticCredentials("AKID", "SECRET", "SESSION"), } } @@ -52,8 +78,10 @@ func assertEqual(t *testing.T, expected, given string) { } func TestPresignRequest(t *testing.T) { - signer := buildSigner("dynamodb", "us-east-1", time.Unix(0, 0), 300*time.Second, "{}") - signer.sign() + req, body := buildRequest("dynamodb", "us-east-1", "{}") + + signer := buildSigner() + signer.Presign(req, body, "dynamodb", "us-east-1", 300*time.Second, time.Unix(0, 0)) expectedDate := "19700101T000000Z" expectedHeaders := "content-length;content-type;host;x-amz-meta-other-header;x-amz-meta-other-header_with_underscore" @@ -61,7 +89,7 @@ func TestPresignRequest(t *testing.T) { expectedCred := "AKID/19700101/us-east-1/dynamodb/aws4_request" expectedTarget := "prefix.Operation" - q := signer.Request.URL.Query() + q := req.URL.Query() assert.Equal(t, expectedSig, q.Get("X-Amz-Signature")) assert.Equal(t, expectedCred, q.Get("X-Amz-Credential")) assert.Equal(t, expectedHeaders, q.Get("X-Amz-SignedHeaders")) @@ -71,55 +99,40 @@ func TestPresignRequest(t *testing.T) { } func TestSignRequest(t *testing.T) { - signer := buildSigner("dynamodb", "us-east-1", time.Unix(0, 0), 0, "{}") - signer.sign() + req, body := buildRequest("dynamodb", "us-east-1", "{}") + signer := buildSigner() + signer.Sign(req, body, "dynamodb", "us-east-1", time.Unix(0, 0)) expectedDate := "19700101T000000Z" expectedSig := "AWS4-HMAC-SHA256 Credential=AKID/19700101/us-east-1/dynamodb/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-amz-meta-other-header;x-amz-meta-other-header_with_underscore;x-amz-security-token;x-amz-target, Signature=ea766cabd2ec977d955a3c2bae1ae54f4515d70752f2207618396f20aa85bd21" - q := signer.Request.Header + q := req.Header assert.Equal(t, expectedSig, q.Get("Authorization")) assert.Equal(t, expectedDate, q.Get("X-Amz-Date")) } -func TestSignEmptyBody(t *testing.T) { - signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "") - signer.Body = nil - signer.sign() - hash := signer.Request.Header.Get("X-Amz-Content-Sha256") - assert.Equal(t, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", hash) -} - func TestSignBody(t *testing.T) { - signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "hello") - signer.sign() - hash := signer.Request.Header.Get("X-Amz-Content-Sha256") + req, body := buildRequest("dynamodb", "us-east-1", "hello") + signer := buildSigner() + signer.Sign(req, body, "dynamodb", "us-east-1", time.Now()) + hash := req.Header.Get("X-Amz-Content-Sha256") assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash) } -func TestSignSeekedBody(t *testing.T) { - signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, " hello") - signer.Body.Read(make([]byte, 3)) // consume first 3 bytes so body is now "hello" - signer.sign() - hash := signer.Request.Header.Get("X-Amz-Content-Sha256") - assert.Equal(t, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824", hash) - - start, _ := signer.Body.Seek(0, 1) - assert.Equal(t, int64(3), start) -} - func TestPresignEmptyBodyS3(t *testing.T) { - signer := buildSigner("s3", "us-east-1", time.Now(), 5*time.Minute, "hello") - signer.sign() - hash := signer.Request.Header.Get("X-Amz-Content-Sha256") + req, body := buildRequest("s3", "us-east-1", "hello") + signer := buildSigner() + signer.Presign(req, body, "s3", "us-east-1", 5*time.Minute, time.Now()) + hash := req.Header.Get("X-Amz-Content-Sha256") assert.Equal(t, "UNSIGNED-PAYLOAD", hash) } func TestSignPrecomputedBodyChecksum(t *testing.T) { - signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "hello") - signer.Request.Header.Set("X-Amz-Content-Sha256", "PRECOMPUTED") - signer.sign() - hash := signer.Request.Header.Get("X-Amz-Content-Sha256") + req, body := buildRequest("dynamodb", "us-east-1", "hello") + req.Header.Set("X-Amz-Content-Sha256", "PRECOMPUTED") + signer := buildSigner() + signer.Sign(req, body, "dynamodb", "us-east-1", time.Now()) + hash := req.Header.Get("X-Amz-Content-Sha256") assert.Equal(t, "PRECOMPUTED", hash) } @@ -134,7 +147,7 @@ func TestAnonymousCredentials(t *testing.T) { nil, nil, ) - Sign(r) + SignSDKRequest(r) urlQ := r.HTTPRequest.URL.Query() assert.Empty(t, urlQ.Get("X-Amz-Signature")) @@ -162,10 +175,10 @@ func TestIgnoreResignRequestWithValidCreds(t *testing.T) { nil, ) - Sign(r) + SignSDKRequest(r) sig := r.HTTPRequest.Header.Get("Authorization") - Sign(r) + SignSDKRequest(r) assert.Equal(t, sig, r.HTTPRequest.Header.Get("Authorization")) } @@ -185,10 +198,10 @@ func TestIgnorePreResignRequestWithValidCreds(t *testing.T) { ) r.ExpireTime = time.Minute * 10 - Sign(r) + SignSDKRequest(r) sig := r.HTTPRequest.Header.Get("X-Amz-Signature") - Sign(r) + SignSDKRequest(r) assert.Equal(t, sig, r.HTTPRequest.Header.Get("X-Amz-Signature")) } @@ -204,7 +217,7 @@ func TestResignRequestExpiredCreds(t *testing.T) { nil, nil, ) - Sign(r) + SignSDKRequest(r) querySig := r.HTTPRequest.Header.Get("Authorization") var origSignedHeaders string for _, p := range strings.Split(querySig, ", ") { @@ -218,7 +231,7 @@ func TestResignRequestExpiredCreds(t *testing.T) { creds.Expire() - Sign(r) + SignSDKRequest(r) updatedQuerySig := r.HTTPRequest.Header.Get("Authorization") assert.NotEqual(t, querySig, updatedQuerySig) @@ -252,7 +265,7 @@ func TestPreResignRequestExpiredCreds(t *testing.T) { ) r.ExpireTime = time.Minute * 10 - Sign(r) + SignSDKRequest(r) querySig := r.HTTPRequest.URL.Query().Get("X-Amz-Signature") signedHeaders := r.HTTPRequest.URL.Query().Get("X-Amz-SignedHeaders") assert.NotEmpty(t, signedHeaders) @@ -260,7 +273,7 @@ func TestPreResignRequestExpiredCreds(t *testing.T) { creds.Expire() r.Time = time.Now().Add(time.Hour * 48) - Sign(r) + SignSDKRequest(r) assert.NotEqual(t, querySig, r.HTTPRequest.URL.Query().Get("X-Amz-Signature")) resignedHeaders := r.HTTPRequest.URL.Query().Get("X-Amz-SignedHeaders") assert.Equal(t, signedHeaders, resignedHeaders) @@ -280,55 +293,28 @@ func TestResignRequestExpiredRequest(t *testing.T) { nil, ) - Sign(r) + SignSDKRequest(r) querySig := r.HTTPRequest.Header.Get("Authorization") // Simulate the request occured 15 minutes in the past r.Time = r.Time.Add(-15 * time.Minute) - Sign(r) + SignSDKRequest(r) assert.NotEqual(t, querySig, r.HTTPRequest.Header.Get("Authorization")) } -func TestStripExcessHeaders(t *testing.T) { - vals := []string{ - "123", - "1 2 3", - " 1 2 3", - "1 2 3", - "1 23", - "1 2 3", - "1 2 ", - " 1 2 ", - } - - expected := []string{ - "123", - "1 2 3", - "1 2 3", - "1 2 3", - "1 23", - "1 2 3", - "1 2", - "1 2", - } - - newVals := stripExcessSpaces(vals) - for i := 0; i < len(newVals); i++ { - assert.Equal(t, newVals[i], expected[i]) - } -} - func BenchmarkPresignRequest(b *testing.B) { - signer := buildSigner("dynamodb", "us-east-1", time.Now(), 300*time.Second, "{}") + signer := buildSigner() + req, body := buildRequest("dynamodb", "us-east-1", "{}") for i := 0; i < b.N; i++ { - signer.sign() + signer.Presign(req, body, "dynamodb", "us-east-1", 300*time.Second, time.Now()) } } func BenchmarkSignRequest(b *testing.B) { - signer := buildSigner("dynamodb", "us-east-1", time.Now(), 0, "{}") + signer := buildSigner() + req, body := buildRequest("dynamodb", "us-east-1", "{}") for i := 0; i < b.N; i++ { - signer.sign() + signer.Sign(req, body, "dynamodb", "us-east-1", time.Now()) } } diff --git a/private/model/api/api.go b/private/model/api/api.go index f2c889dd5ee..4a4a5ed9a69 100644 --- a/private/model/api/api.go +++ b/private/model/api/api.go @@ -306,7 +306,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack({{if eq .Metadata.SignatureVersion "v2"}}v2{{else}}v4{{end}}.Sign) + svc.Handlers.Sign.PushBackNamed({{if eq .Metadata.SignatureVersion "v2"}}v2{{else}}v4{{end}}.SignRequestHandler) {{if eq .Metadata.SignatureVersion "v2"}}svc.Handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler) {{end}}svc.Handlers.Build.PushBackNamed({{ .ProtocolPackage }}.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed({{ .ProtocolPackage }}.UnmarshalHandler) @@ -347,7 +347,7 @@ func (a *API) ServiceGoCode() string { a.imports["github.com/aws/aws-sdk-go/private/signer/v2"] = true a.imports["github.com/aws/aws-sdk-go/aws/corehandlers"] = true } else { - a.imports["github.com/aws/aws-sdk-go/private/signer/v4"] = true + a.imports["github.com/aws/aws-sdk-go/aws/signer/v4"] = true } a.imports["github.com/aws/aws-sdk-go/private/protocol/"+a.ProtocolPackage()] = true diff --git a/private/protocol/ec2query/build_test.go b/private/protocol/ec2query/build_test.go index 140efb53d20..eeff8e09d99 100644 --- a/private/protocol/ec2query/build_test.go +++ b/private/protocol/ec2query/build_test.go @@ -17,11 +17,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/ec2query" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/signer/v4" "github.com/aws/aws-sdk-go/private/util" "github.com/stretchr/testify/assert" ) @@ -80,7 +80,7 @@ func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -172,7 +172,7 @@ func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -266,7 +266,7 @@ func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -362,7 +362,7 @@ func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -452,7 +452,7 @@ func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -542,7 +542,7 @@ func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -632,7 +632,7 @@ func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -723,7 +723,7 @@ func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -813,7 +813,7 @@ func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) diff --git a/private/protocol/ec2query/unmarshal_test.go b/private/protocol/ec2query/unmarshal_test.go index 78bcc878d6c..2e026770651 100644 --- a/private/protocol/ec2query/unmarshal_test.go +++ b/private/protocol/ec2query/unmarshal_test.go @@ -17,11 +17,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/ec2query" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/signer/v4" "github.com/aws/aws-sdk-go/private/util" "github.com/stretchr/testify/assert" ) @@ -80,7 +80,7 @@ func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -182,7 +182,7 @@ func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -271,7 +271,7 @@ func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -359,7 +359,7 @@ func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -447,7 +447,7 @@ func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -535,7 +535,7 @@ func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -629,7 +629,7 @@ func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -717,7 +717,7 @@ func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) @@ -805,7 +805,7 @@ func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) diff --git a/private/protocol/jsonrpc/build_test.go b/private/protocol/jsonrpc/build_test.go index c8a46cac8a4..a4378a08c3e 100644 --- a/private/protocol/jsonrpc/build_test.go +++ b/private/protocol/jsonrpc/build_test.go @@ -17,11 +17,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/signer/v4" "github.com/aws/aws-sdk-go/private/util" "github.com/stretchr/testify/assert" ) @@ -82,7 +82,7 @@ func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -175,7 +175,7 @@ func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -267,7 +267,7 @@ func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -392,7 +392,7 @@ func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -485,7 +485,7 @@ func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -739,7 +739,7 @@ func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -832,7 +832,7 @@ func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/private/protocol/jsonrpc/unmarshal_test.go b/private/protocol/jsonrpc/unmarshal_test.go index 43045a703af..10845639c9a 100644 --- a/private/protocol/jsonrpc/unmarshal_test.go +++ b/private/protocol/jsonrpc/unmarshal_test.go @@ -17,11 +17,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/signer/v4" "github.com/aws/aws-sdk-go/private/util" "github.com/stretchr/testify/assert" ) @@ -82,7 +82,7 @@ func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -186,7 +186,7 @@ func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -286,7 +286,7 @@ func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -384,7 +384,7 @@ func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -510,7 +510,7 @@ func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) @@ -600,7 +600,7 @@ func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/private/protocol/query/build_test.go b/private/protocol/query/build_test.go index f0da8bf95dc..7f87c2fd40a 100644 --- a/private/protocol/query/build_test.go +++ b/private/protocol/query/build_test.go @@ -17,11 +17,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/query" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/signer/v4" "github.com/aws/aws-sdk-go/private/util" "github.com/stretchr/testify/assert" ) @@ -80,7 +80,7 @@ func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -234,7 +234,7 @@ func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -330,7 +330,7 @@ func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -450,7 +450,7 @@ func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -574,7 +574,7 @@ func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -664,7 +664,7 @@ func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -754,7 +754,7 @@ func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -846,7 +846,7 @@ func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -936,7 +936,7 @@ func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -1026,7 +1026,7 @@ func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -1117,7 +1117,7 @@ func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -1207,7 +1207,7 @@ func newInputService12ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -1459,7 +1459,7 @@ func newInputService13ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/private/protocol/query/unmarshal_test.go b/private/protocol/query/unmarshal_test.go index f60594fe767..f0725a489db 100644 --- a/private/protocol/query/unmarshal_test.go +++ b/private/protocol/query/unmarshal_test.go @@ -17,11 +17,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/query" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/signer/v4" "github.com/aws/aws-sdk-go/private/util" "github.com/stretchr/testify/assert" ) @@ -80,7 +80,7 @@ func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -184,7 +184,7 @@ func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -274,7 +274,7 @@ func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -363,7 +363,7 @@ func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -451,7 +451,7 @@ func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -539,7 +539,7 @@ func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -627,7 +627,7 @@ func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -715,7 +715,7 @@ func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -813,7 +813,7 @@ func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -911,7 +911,7 @@ func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -999,7 +999,7 @@ func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -1093,7 +1093,7 @@ func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -1181,7 +1181,7 @@ func newOutputService13ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -1269,7 +1269,7 @@ func newOutputService14ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) @@ -1357,7 +1357,7 @@ func newOutputService15ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/private/protocol/restjson/build_test.go b/private/protocol/restjson/build_test.go index cc933748944..c2239b94730 100644 --- a/private/protocol/restjson/build_test.go +++ b/private/protocol/restjson/build_test.go @@ -17,11 +17,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/restjson" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/signer/v4" "github.com/aws/aws-sdk-go/private/util" "github.com/stretchr/testify/assert" ) @@ -80,7 +80,7 @@ func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -170,7 +170,7 @@ func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -262,7 +262,7 @@ func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -354,7 +354,7 @@ func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -446,7 +446,7 @@ func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -540,7 +540,7 @@ func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -634,7 +634,7 @@ func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -730,7 +730,7 @@ func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -836,7 +836,7 @@ func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -944,7 +944,7 @@ func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -1053,7 +1053,7 @@ func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -1161,7 +1161,7 @@ func newInputService12ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -1285,7 +1285,7 @@ func newInputService13ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -1415,7 +1415,7 @@ func newInputService14ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -1539,7 +1539,7 @@ func newInputService15ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -1803,7 +1803,7 @@ func newInputService16ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -1929,7 +1929,7 @@ func newInputService17ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -2021,7 +2021,7 @@ func newInputService18ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -2113,7 +2113,7 @@ func newInputService19ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/private/protocol/restjson/unmarshal_test.go b/private/protocol/restjson/unmarshal_test.go index 8c2bf099b5e..6b9817c8708 100644 --- a/private/protocol/restjson/unmarshal_test.go +++ b/private/protocol/restjson/unmarshal_test.go @@ -17,11 +17,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/restjson" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/signer/v4" "github.com/aws/aws-sdk-go/private/util" "github.com/stretchr/testify/assert" ) @@ -80,7 +80,7 @@ func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -188,7 +188,7 @@ func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -286,7 +286,7 @@ func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -382,7 +382,7 @@ func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -470,7 +470,7 @@ func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -564,7 +564,7 @@ func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -652,7 +652,7 @@ func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -740,7 +740,7 @@ func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -828,7 +828,7 @@ func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -918,7 +918,7 @@ func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) @@ -1014,7 +1014,7 @@ func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/private/protocol/restxml/build_test.go b/private/protocol/restxml/build_test.go index 5cff5810221..40fa0ada368 100644 --- a/private/protocol/restxml/build_test.go +++ b/private/protocol/restxml/build_test.go @@ -17,11 +17,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/restxml" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/signer/v4" "github.com/aws/aws-sdk-go/private/util" "github.com/stretchr/testify/assert" ) @@ -80,7 +80,7 @@ func newInputService1ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -242,7 +242,7 @@ func newInputService2ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -340,7 +340,7 @@ func newInputService3ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -474,7 +474,7 @@ func newInputService4ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -576,7 +576,7 @@ func newInputService5ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -668,7 +668,7 @@ func newInputService6ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -760,7 +760,7 @@ func newInputService7ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -852,7 +852,7 @@ func newInputService8ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -944,7 +944,7 @@ func newInputService9ProtocolTestClient(cfg aws.Config, handlers request.Handler } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1042,7 +1042,7 @@ func newInputService10ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1143,7 +1143,7 @@ func newInputService11ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1235,7 +1235,7 @@ func newInputService12ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1327,7 +1327,7 @@ func newInputService13ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1421,7 +1421,7 @@ func newInputService14ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1515,7 +1515,7 @@ func newInputService15ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1607,7 +1607,7 @@ func newInputService16ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1731,7 +1731,7 @@ func newInputService17ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1925,7 +1925,7 @@ func newInputService18ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -2031,7 +2031,7 @@ func newInputService19ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -2125,7 +2125,7 @@ func newInputService20ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -2249,7 +2249,7 @@ func newInputService21ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -2513,7 +2513,7 @@ func newInputService22ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -2605,7 +2605,7 @@ func newInputService23ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) diff --git a/private/protocol/restxml/unmarshal_test.go b/private/protocol/restxml/unmarshal_test.go index 427e2109f61..c2c936f192e 100644 --- a/private/protocol/restxml/unmarshal_test.go +++ b/private/protocol/restxml/unmarshal_test.go @@ -17,11 +17,11 @@ import ( "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/restxml" "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" - "github.com/aws/aws-sdk-go/private/signer/v4" "github.com/aws/aws-sdk-go/private/util" "github.com/stretchr/testify/assert" ) @@ -80,7 +80,7 @@ func newOutputService1ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -216,7 +216,7 @@ func newOutputService2ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -305,7 +305,7 @@ func newOutputService3ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -393,7 +393,7 @@ func newOutputService4ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -481,7 +481,7 @@ func newOutputService5ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -569,7 +569,7 @@ func newOutputService6ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -663,7 +663,7 @@ func newOutputService7ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -751,7 +751,7 @@ func newOutputService8ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -839,7 +839,7 @@ func newOutputService9ProtocolTestClient(cfg aws.Config, handlers request.Handle } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -935,7 +935,7 @@ func newOutputService10ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1023,7 +1023,7 @@ func newOutputService11ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) @@ -1127,7 +1127,7 @@ func newOutputService12ProtocolTestClient(cfg aws.Config, handlers request.Handl } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) diff --git a/private/signer/v2/v2.go b/private/signer/v2/v2.go index 97658ffb997..88c3a2f617f 100644 --- a/private/signer/v2/v2.go +++ b/private/signer/v2/v2.go @@ -40,12 +40,18 @@ type signer struct { signature string } -// Sign requests with signature version 2. +// SignRequestHandler is a named request handler the SDK will use to sign +// service client request with using the V4 signature. +var SignRequestHandler = request.NamedHandler{ + Name: "v2.SignRequestHandler", Fn: SignSDKRequest, +} + +// SignSDKRequest requests with signature version 2. // // Will sign the requests with the service config's Credentials object // Signing is skipped if the credentials is the credentials.AnonymousCredentials // object. -func Sign(req *request.Request) { +func SignSDKRequest(req *request.Request) { // If the request does not need to be signed ignore the signing of the // request if the AnonymousCredentials object is used. if req.Config.Credentials == credentials.AnonymousCredentials { diff --git a/private/signer/v2/v2_test.go b/private/signer/v2/v2_test.go index c407416be4e..1e8e04b269b 100644 --- a/private/signer/v2/v2_test.go +++ b/private/signer/v2/v2_test.go @@ -163,7 +163,7 @@ func TestGet(t *testing.T) { assert.Equal("GET", r.HTTPRequest.Method) assert.Equal("", r.HTTPRequest.URL.Query().Get("Signature")) - Sign(r) + SignSDKRequest(r) assert.NoError(r.Error) t.Logf("Signature: %s", r.HTTPRequest.URL.Query().Get("Signature")) assert.NotEqual("", r.HTTPRequest.URL.Query().Get("Signature")) @@ -186,7 +186,7 @@ func TestAnonymousCredentials(t *testing.T) { ) r.Build() - Sign(r) + SignSDKRequest(r) req := r.HTTPRequest req.ParseForm() diff --git a/private/signer/v4/v4.go b/private/signer/v4/v4.go deleted file mode 100644 index 47658005629..00000000000 --- a/private/signer/v4/v4.go +++ /dev/null @@ -1,465 +0,0 @@ -// Package v4 implements signing for AWS V4 signer -package v4 - -import ( - "crypto/hmac" - "crypto/sha256" - "encoding/hex" - "fmt" - "io" - "net/http" - "net/url" - "sort" - "strconv" - "strings" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/rest" -) - -const ( - authHeaderPrefix = "AWS4-HMAC-SHA256" - timeFormat = "20060102T150405Z" - shortTimeFormat = "20060102" -) - -var ignoredHeaders = rules{ - blacklist{ - mapRule{ - "Authorization": struct{}{}, - "User-Agent": struct{}{}, - }, - }, -} - -// requiredSignedHeaders is a whitelist for build canonical headers. -var requiredSignedHeaders = rules{ - whitelist{ - mapRule{ - "Cache-Control": struct{}{}, - "Content-Disposition": struct{}{}, - "Content-Encoding": struct{}{}, - "Content-Language": struct{}{}, - "Content-Md5": struct{}{}, - "Content-Type": struct{}{}, - "Expires": struct{}{}, - "If-Match": struct{}{}, - "If-Modified-Since": struct{}{}, - "If-None-Match": struct{}{}, - "If-Unmodified-Since": struct{}{}, - "Range": struct{}{}, - "X-Amz-Acl": struct{}{}, - "X-Amz-Copy-Source": struct{}{}, - "X-Amz-Copy-Source-If-Match": struct{}{}, - "X-Amz-Copy-Source-If-Modified-Since": struct{}{}, - "X-Amz-Copy-Source-If-None-Match": struct{}{}, - "X-Amz-Copy-Source-If-Unmodified-Since": struct{}{}, - "X-Amz-Copy-Source-Range": struct{}{}, - "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Algorithm": struct{}{}, - "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key": struct{}{}, - "X-Amz-Copy-Source-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, - "X-Amz-Grant-Full-control": struct{}{}, - "X-Amz-Grant-Read": struct{}{}, - "X-Amz-Grant-Read-Acp": struct{}{}, - "X-Amz-Grant-Write": struct{}{}, - "X-Amz-Grant-Write-Acp": struct{}{}, - "X-Amz-Metadata-Directive": struct{}{}, - "X-Amz-Mfa": struct{}{}, - "X-Amz-Request-Payer": struct{}{}, - "X-Amz-Server-Side-Encryption": struct{}{}, - "X-Amz-Server-Side-Encryption-Aws-Kms-Key-Id": struct{}{}, - "X-Amz-Server-Side-Encryption-Customer-Algorithm": struct{}{}, - "X-Amz-Server-Side-Encryption-Customer-Key": struct{}{}, - "X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{}, - "X-Amz-Storage-Class": struct{}{}, - "X-Amz-Website-Redirect-Location": struct{}{}, - }, - }, - patterns{"X-Amz-Meta-"}, -} - -// allowedHoisting is a whitelist for build query headers. The boolean value -// represents whether or not it is a pattern. -var allowedQueryHoisting = inclusiveRules{ - blacklist{requiredSignedHeaders}, - patterns{"X-Amz-"}, -} - -type signer struct { - Request *http.Request - Time time.Time - ExpireTime time.Duration - ServiceName string - Region string - CredValues credentials.Value - Credentials *credentials.Credentials - Query url.Values - Body io.ReadSeeker - Debug aws.LogLevelType - Logger aws.Logger - - isPresign bool - formattedTime string - formattedShortTime string - - signedHeaders string - canonicalHeaders string - canonicalString string - credentialString string - stringToSign string - signature string - authorization string - notHoist bool - signedHeaderVals http.Header -} - -// Sign requests with signature version 4. -// -// Will sign the requests with the service config's Credentials object -// Signing is skipped if the credentials is the credentials.AnonymousCredentials -// object. -func Sign(req *request.Request) { - // If the request does not need to be signed ignore the signing of the - // request if the AnonymousCredentials object is used. - if req.Config.Credentials == credentials.AnonymousCredentials { - return - } - - region := req.ClientInfo.SigningRegion - if region == "" { - region = aws.StringValue(req.Config.Region) - } - - name := req.ClientInfo.SigningName - if name == "" { - name = req.ClientInfo.ServiceName - } - - s := signer{ - Request: req.HTTPRequest, - Time: req.Time, - ExpireTime: req.ExpireTime, - Query: req.HTTPRequest.URL.Query(), - Body: req.Body, - ServiceName: name, - Region: region, - Credentials: req.Config.Credentials, - Debug: req.Config.LogLevel.Value(), - Logger: req.Config.Logger, - notHoist: req.NotHoist, - } - - req.Error = s.sign() - req.Time = s.Time - req.SignedHeaderVals = s.signedHeaderVals -} - -func (v4 *signer) sign() error { - if v4.ExpireTime != 0 { - v4.isPresign = true - } - - if v4.isRequestSigned() { - if !v4.Credentials.IsExpired() && time.Now().Before(v4.Time.Add(10*time.Minute)) { - // If the request is already signed, and the credentials have not - // expired, and the request is not too old ignore the signing request. - return nil - } - v4.Time = time.Now() - - // The credentials have expired for this request. The current signing - // is invalid, and needs to be request because the request will fail. - if v4.isPresign { - v4.removePresign() - // Update the request's query string to ensure the values stays in - // sync in the case retrieving the new credentials fails. - v4.Request.URL.RawQuery = v4.Query.Encode() - } - } - - var err error - v4.CredValues, err = v4.Credentials.Get() - if err != nil { - return err - } - - if v4.isPresign { - v4.Query.Set("X-Amz-Algorithm", authHeaderPrefix) - if v4.CredValues.SessionToken != "" { - v4.Query.Set("X-Amz-Security-Token", v4.CredValues.SessionToken) - } else { - v4.Query.Del("X-Amz-Security-Token") - } - } else if v4.CredValues.SessionToken != "" { - v4.Request.Header.Set("X-Amz-Security-Token", v4.CredValues.SessionToken) - } - - v4.build() - - if v4.Debug.Matches(aws.LogDebugWithSigning) { - v4.logSigningInfo() - } - - return nil -} - -const logSignInfoMsg = `DEBUG: Request Signiture: ----[ CANONICAL STRING ]----------------------------- -%s ----[ STRING TO SIGN ]-------------------------------- -%s%s ------------------------------------------------------` -const logSignedURLMsg = ` ----[ SIGNED URL ]------------------------------------ -%s` - -func (v4 *signer) logSigningInfo() { - signedURLMsg := "" - if v4.isPresign { - signedURLMsg = fmt.Sprintf(logSignedURLMsg, v4.Request.URL.String()) - } - msg := fmt.Sprintf(logSignInfoMsg, v4.canonicalString, v4.stringToSign, signedURLMsg) - v4.Logger.Log(msg) -} - -func (v4 *signer) build() { - - v4.buildTime() // no depends - v4.buildCredentialString() // no depends - - unsignedHeaders := v4.Request.Header - if v4.isPresign { - if !v4.notHoist { - urlValues := url.Values{} - urlValues, unsignedHeaders = buildQuery(allowedQueryHoisting, unsignedHeaders) // no depends - for k := range urlValues { - v4.Query[k] = urlValues[k] - } - } - } - - v4.buildCanonicalHeaders(ignoredHeaders, unsignedHeaders) - v4.buildCanonicalString() // depends on canon headers / signed headers - v4.buildStringToSign() // depends on canon string - v4.buildSignature() // depends on string to sign - - if v4.isPresign { - v4.Request.URL.RawQuery += "&X-Amz-Signature=" + v4.signature - } else { - parts := []string{ - authHeaderPrefix + " Credential=" + v4.CredValues.AccessKeyID + "/" + v4.credentialString, - "SignedHeaders=" + v4.signedHeaders, - "Signature=" + v4.signature, - } - v4.Request.Header.Set("Authorization", strings.Join(parts, ", ")) - } -} - -func (v4 *signer) buildTime() { - v4.formattedTime = v4.Time.UTC().Format(timeFormat) - v4.formattedShortTime = v4.Time.UTC().Format(shortTimeFormat) - - if v4.isPresign { - duration := int64(v4.ExpireTime / time.Second) - v4.Query.Set("X-Amz-Date", v4.formattedTime) - v4.Query.Set("X-Amz-Expires", strconv.FormatInt(duration, 10)) - } else { - v4.Request.Header.Set("X-Amz-Date", v4.formattedTime) - } -} - -func (v4 *signer) buildCredentialString() { - v4.credentialString = strings.Join([]string{ - v4.formattedShortTime, - v4.Region, - v4.ServiceName, - "aws4_request", - }, "/") - - if v4.isPresign { - v4.Query.Set("X-Amz-Credential", v4.CredValues.AccessKeyID+"/"+v4.credentialString) - } -} - -func buildQuery(r rule, header http.Header) (url.Values, http.Header) { - query := url.Values{} - unsignedHeaders := http.Header{} - for k, h := range header { - if r.IsValid(k) { - query[k] = h - } else { - unsignedHeaders[k] = h - } - } - - return query, unsignedHeaders -} -func (v4 *signer) buildCanonicalHeaders(r rule, header http.Header) { - var headers []string - headers = append(headers, "host") - for k, v := range header { - canonicalKey := http.CanonicalHeaderKey(k) - if !r.IsValid(canonicalKey) { - continue // ignored header - } - if v4.signedHeaderVals == nil { - v4.signedHeaderVals = make(http.Header) - } - - lowerCaseKey := strings.ToLower(k) - if _, ok := v4.signedHeaderVals[lowerCaseKey]; ok { - // include additional values - v4.signedHeaderVals[lowerCaseKey] = append(v4.signedHeaderVals[lowerCaseKey], v...) - continue - } - - headers = append(headers, lowerCaseKey) - v4.signedHeaderVals[lowerCaseKey] = v - } - sort.Strings(headers) - - v4.signedHeaders = strings.Join(headers, ";") - - if v4.isPresign { - v4.Query.Set("X-Amz-SignedHeaders", v4.signedHeaders) - } - - headerValues := make([]string, len(headers)) - for i, k := range headers { - if k == "host" { - headerValues[i] = "host:" + v4.Request.URL.Host - } else { - headerValues[i] = k + ":" + - strings.Join(v4.signedHeaderVals[k], ",") - } - } - - v4.canonicalHeaders = strings.Join(stripExcessSpaces(headerValues), "\n") -} - -func (v4 *signer) buildCanonicalString() { - v4.Request.URL.RawQuery = strings.Replace(v4.Query.Encode(), "+", "%20", -1) - uri := v4.Request.URL.Opaque - if uri != "" { - uri = "/" + strings.Join(strings.Split(uri, "/")[3:], "/") - } else { - uri = v4.Request.URL.Path - } - if uri == "" { - uri = "/" - } - - if v4.ServiceName != "s3" { - uri = rest.EscapePath(uri, false) - } - - v4.canonicalString = strings.Join([]string{ - v4.Request.Method, - uri, - v4.Request.URL.RawQuery, - v4.canonicalHeaders + "\n", - v4.signedHeaders, - v4.bodyDigest(), - }, "\n") -} - -func (v4 *signer) buildStringToSign() { - v4.stringToSign = strings.Join([]string{ - authHeaderPrefix, - v4.formattedTime, - v4.credentialString, - hex.EncodeToString(makeSha256([]byte(v4.canonicalString))), - }, "\n") -} - -func (v4 *signer) buildSignature() { - secret := v4.CredValues.SecretAccessKey - date := makeHmac([]byte("AWS4"+secret), []byte(v4.formattedShortTime)) - region := makeHmac(date, []byte(v4.Region)) - service := makeHmac(region, []byte(v4.ServiceName)) - credentials := makeHmac(service, []byte("aws4_request")) - signature := makeHmac(credentials, []byte(v4.stringToSign)) - v4.signature = hex.EncodeToString(signature) -} - -func (v4 *signer) bodyDigest() string { - hash := v4.Request.Header.Get("X-Amz-Content-Sha256") - if hash == "" { - if v4.isPresign && v4.ServiceName == "s3" { - hash = "UNSIGNED-PAYLOAD" - } else if v4.Body == nil { - hash = hex.EncodeToString(makeSha256([]byte{})) - } else { - hash = hex.EncodeToString(makeSha256Reader(v4.Body)) - } - v4.Request.Header.Add("X-Amz-Content-Sha256", hash) - } - return hash -} - -// isRequestSigned returns if the request is currently signed or presigned -func (v4 *signer) isRequestSigned() bool { - if v4.isPresign && v4.Query.Get("X-Amz-Signature") != "" { - return true - } - if v4.Request.Header.Get("Authorization") != "" { - return true - } - - return false -} - -// unsign removes signing flags for both signed and presigned requests. -func (v4 *signer) removePresign() { - v4.Query.Del("X-Amz-Algorithm") - v4.Query.Del("X-Amz-Signature") - v4.Query.Del("X-Amz-Security-Token") - v4.Query.Del("X-Amz-Date") - v4.Query.Del("X-Amz-Expires") - v4.Query.Del("X-Amz-Credential") - v4.Query.Del("X-Amz-SignedHeaders") -} - -func makeHmac(key []byte, data []byte) []byte { - hash := hmac.New(sha256.New, key) - hash.Write(data) - return hash.Sum(nil) -} - -func makeSha256(data []byte) []byte { - hash := sha256.New() - hash.Write(data) - return hash.Sum(nil) -} - -func makeSha256Reader(reader io.ReadSeeker) []byte { - hash := sha256.New() - start, _ := reader.Seek(0, 1) - defer reader.Seek(start, 0) - - io.Copy(hash, reader) - return hash.Sum(nil) -} - -func stripExcessSpaces(headerVals []string) []string { - vals := make([]string, len(headerVals)) - for i, str := range headerVals { - stripped := "" - found := false - str = strings.TrimSpace(str) - for _, c := range str { - if !found && c == ' ' { - stripped += string(c) - found = true - } else if c != ' ' { - stripped += string(c) - found = false - } - } - vals[i] = stripped - } - return vals -} diff --git a/service/acm/service.go b/service/acm/service.go index eb37326505f..782c2bbaabb 100644 --- a/service/acm/service.go +++ b/service/acm/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Welcome to the AWS Certificate Manager (ACM) Command Reference. This guide @@ -67,7 +67,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/apigateway/service.go b/service/apigateway/service.go index 6e6c8cfb3d6..3372a2f7437 100644 --- a/service/apigateway/service.go +++ b/service/apigateway/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon API Gateway helps developers deliver robust, secure and scalable mobile @@ -62,7 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/applicationautoscaling/service.go b/service/applicationautoscaling/service.go index 7a989c14b75..d6e797ff2d4 100644 --- a/service/applicationautoscaling/service.go +++ b/service/applicationautoscaling/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Application Auto Scaling is a general purpose Auto Scaling service for supported @@ -84,7 +84,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/applicationdiscoveryservice/service.go b/service/applicationdiscoveryservice/service.go index ea983d9e7cd..0e3ad5726f4 100644 --- a/service/applicationdiscoveryservice/service.go +++ b/service/applicationdiscoveryservice/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // The AWS Application Discovery Service helps Systems Integrators quickly and @@ -254,7 +254,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/autoscaling/service.go b/service/autoscaling/service.go index bb58f66ed4b..e529e4de8b3 100644 --- a/service/autoscaling/service.go +++ b/service/autoscaling/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Auto Scaling is designed to automatically launch or terminate EC2 instances @@ -60,7 +60,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/cloudformation/service.go b/service/cloudformation/service.go index 8e9ca6521b0..bd9d2917eb4 100644 --- a/service/cloudformation/service.go +++ b/service/cloudformation/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS CloudFormation enables you to create and manage AWS infrastructure deployments @@ -75,7 +75,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/cloudfront/service.go b/service/cloudfront/service.go index 51b73c6efef..99d23c72ea0 100644 --- a/service/cloudfront/service.go +++ b/service/cloudfront/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restxml" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // CloudFront is a client for CloudFront. @@ -58,7 +58,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) diff --git a/service/cloudhsm/service.go b/service/cloudhsm/service.go index f52aa7a5ac1..4b626715881 100644 --- a/service/cloudhsm/service.go +++ b/service/cloudhsm/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) //The service client's operations are safe to be used concurrently. @@ -59,7 +59,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/cloudsearch/service.go b/service/cloudsearch/service.go index f4333a8366b..e4a16069a2b 100644 --- a/service/cloudsearch/service.go +++ b/service/cloudsearch/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // You use the Amazon CloudSearch configuration service to create, configure, @@ -66,7 +66,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/cloudsearchdomain/service.go b/service/cloudsearchdomain/service.go index df719b1a42a..1ac8e7ba47f 100644 --- a/service/cloudsearchdomain/service.go +++ b/service/cloudsearchdomain/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // You use the AmazonCloudSearch2013 API to upload documents to a search domain @@ -68,7 +68,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/cloudtrail/service.go b/service/cloudtrail/service.go index eddc99e3e2a..621e16698dd 100644 --- a/service/cloudtrail/service.go +++ b/service/cloudtrail/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // This is the CloudTrail API Reference. It provides descriptions of actions, @@ -79,7 +79,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/cloudwatch/service.go b/service/cloudwatch/service.go index 342498f0ec4..8b707e5f122 100644 --- a/service/cloudwatch/service.go +++ b/service/cloudwatch/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon CloudWatch monitors your Amazon Web Services (AWS) resources and the @@ -72,7 +72,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/cloudwatchevents/service.go b/service/cloudwatchevents/service.go index 14f99f9b403..0501a80d952 100644 --- a/service/cloudwatchevents/service.go +++ b/service/cloudwatchevents/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon CloudWatch Events helps you to respond to state changes in your AWS @@ -73,7 +73,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/cloudwatchlogs/service.go b/service/cloudwatchlogs/service.go index e5a47270c5c..0641103045d 100644 --- a/service/cloudwatchlogs/service.go +++ b/service/cloudwatchlogs/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // You can use Amazon CloudWatch Logs to monitor, store, and access your log @@ -88,7 +88,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/codecommit/service.go b/service/codecommit/service.go index bf756307aba..ec608b7c19a 100644 --- a/service/codecommit/service.go +++ b/service/codecommit/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // This is the AWS CodeCommit API Reference. This reference provides descriptions @@ -86,7 +86,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/codedeploy/service.go b/service/codedeploy/service.go index 6f9e89b9a79..e89d8da8509 100644 --- a/service/codedeploy/service.go +++ b/service/codedeploy/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Overview This reference guide provides descriptions of the AWS CodeDeploy @@ -107,7 +107,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/codepipeline/service.go b/service/codepipeline/service.go index ec7b481c323..8daf80c68c2 100644 --- a/service/codepipeline/service.go +++ b/service/codepipeline/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Overview @@ -164,7 +164,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/cognitoidentity/service.go b/service/cognitoidentity/service.go index 6304582b122..f240b7e416c 100644 --- a/service/cognitoidentity/service.go +++ b/service/cognitoidentity/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Cognito is a web service that delivers scoped temporary credentials @@ -91,7 +91,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/cognitoidentityprovider/service.go b/service/cognitoidentityprovider/service.go index ef080c03283..a176c34daa0 100644 --- a/service/cognitoidentityprovider/service.go +++ b/service/cognitoidentityprovider/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // You can create a user pool in Amazon Cognito Identity to manage directories @@ -65,7 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/cognitosync/service.go b/service/cognitosync/service.go index a9d91f37cb6..a7c0db013bf 100644 --- a/service/cognitosync/service.go +++ b/service/cognitosync/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Cognito Sync provides an AWS service and client library that enable @@ -75,7 +75,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/configservice/service.go b/service/configservice/service.go index 4764a43a992..473f6033609 100644 --- a/service/configservice/service.go +++ b/service/configservice/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS Config provides a way to keep track of the configurations of all the @@ -83,7 +83,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/databasemigrationservice/service.go b/service/databasemigrationservice/service.go index 3144a0579ab..398fa017385 100644 --- a/service/databasemigrationservice/service.go +++ b/service/databasemigrationservice/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS Database Migration Service (AWS DMS) can migrate your data to and from @@ -65,7 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/datapipeline/service.go b/service/datapipeline/service.go index 638c0ee449a..b993e569f15 100644 --- a/service/datapipeline/service.go +++ b/service/datapipeline/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS Data Pipeline configures and manages a data-driven workflow called a @@ -81,7 +81,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/devicefarm/service.go b/service/devicefarm/service.go index ca8536763de..12cfb829ef1 100644 --- a/service/devicefarm/service.go +++ b/service/devicefarm/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS Device Farm is a service that enables mobile app developers to test Android, @@ -62,7 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/directconnect/service.go b/service/directconnect/service.go index 553218ab661..d6fe2143535 100644 --- a/service/directconnect/service.go +++ b/service/directconnect/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS Direct Connect links your internal network to an AWS Direct Connect location @@ -71,7 +71,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/directoryservice/service.go b/service/directoryservice/service.go index 9eb1b1a912c..62acf33ce54 100644 --- a/service/directoryservice/service.go +++ b/service/directoryservice/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // This is the AWS Directory Service API Reference. This guide provides detailed @@ -62,7 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/dynamodb/service.go b/service/dynamodb/service.go index f61f4fecff7..2af4076f809 100644 --- a/service/dynamodb/service.go +++ b/service/dynamodb/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // This is the Amazon DynamoDB API Reference. This guide provides descriptions @@ -174,7 +174,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/dynamodbstreams/service.go b/service/dynamodbstreams/service.go index 3b9eb598a97..c8aaeee1981 100644 --- a/service/dynamodbstreams/service.go +++ b/service/dynamodbstreams/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon DynamoDB Streams provides API actions for accessing streams and processing @@ -77,7 +77,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/ec2/service.go b/service/ec2/service.go index 9d5fa81608d..076eeaab011 100644 --- a/service/ec2/service.go +++ b/service/ec2/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/ec2query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity @@ -61,7 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(ec2query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(ec2query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(ec2query.UnmarshalMetaHandler) diff --git a/service/ecr/service.go b/service/ecr/service.go index 0f6c6760e21..53e3c57e363 100644 --- a/service/ecr/service.go +++ b/service/ecr/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon EC2 Container Registry (Amazon ECR) is a managed AWS Docker registry @@ -65,7 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/ecs/service.go b/service/ecs/service.go index 260b39edc3d..fe99d735a8a 100644 --- a/service/ecs/service.go +++ b/service/ecs/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon EC2 Container Service (Amazon ECS) is a highly scalable, fast, container @@ -71,7 +71,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/efs/service.go b/service/efs/service.go index cf1ecde586a..de3a48ac3d3 100644 --- a/service/efs/service.go +++ b/service/efs/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) //The service client's operations are safe to be used concurrently. @@ -57,7 +57,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/elasticache/service.go b/service/elasticache/service.go index 8e4cbb460ff..c13234d7306 100644 --- a/service/elasticache/service.go +++ b/service/elasticache/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon ElastiCache is a web service that makes it easier to set up, operate, @@ -68,7 +68,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/elasticbeanstalk/service.go b/service/elasticbeanstalk/service.go index 5e6d4236d5d..795a6fef13d 100644 --- a/service/elasticbeanstalk/service.go +++ b/service/elasticbeanstalk/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS Elastic Beanstalk makes it easy for you to create, deploy, and manage @@ -74,7 +74,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/elasticsearchservice/service.go b/service/elasticsearchservice/service.go index 1617a90dff0..60f3971a995 100644 --- a/service/elasticsearchservice/service.go +++ b/service/elasticsearchservice/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Use the Amazon Elasticsearch configuration API to create, configure, and @@ -64,7 +64,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/elastictranscoder/service.go b/service/elastictranscoder/service.go index 322bdcdc55a..c23818a23aa 100644 --- a/service/elastictranscoder/service.go +++ b/service/elastictranscoder/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // The AWS Elastic Transcoder Service. @@ -58,7 +58,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/elb/service.go b/service/elb/service.go index 867254809af..3dc5c73fb6d 100644 --- a/service/elb/service.go +++ b/service/elb/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Elastic Load Balancing distributes incoming traffic across your EC2 instances. @@ -70,7 +70,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/emr/service.go b/service/emr/service.go index 7074979e212..755e1699ade 100644 --- a/service/emr/service.go +++ b/service/emr/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Elastic MapReduce (Amazon EMR) is a web service that makes it easy @@ -64,7 +64,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/firehose/service.go b/service/firehose/service.go index fcb419882e7..7fd7f37ada1 100644 --- a/service/firehose/service.go +++ b/service/firehose/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Kinesis Firehose is a fully-managed service that delivers real-time @@ -62,7 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/gamelift/service.go b/service/gamelift/service.go index 882524fa0b9..13df480aaeb 100644 --- a/service/gamelift/service.go +++ b/service/gamelift/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Welcome to the Amazon GameLift API Reference. Amazon GameLift is a managed @@ -98,7 +98,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/glacier/service.go b/service/glacier/service.go index b83c63a6187..a318653d023 100644 --- a/service/glacier/service.go +++ b/service/glacier/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Glacier is a storage solution for "cold data." @@ -88,7 +88,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/iam/service.go b/service/iam/service.go index b2fa8550f05..362916f98be 100644 --- a/service/iam/service.go +++ b/service/iam/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS Identity and Access Management (IAM) is a web service that you can use @@ -111,7 +111,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/inspector/service.go b/service/inspector/service.go index 243f52b03e2..4d099420b54 100644 --- a/service/inspector/service.go +++ b/service/inspector/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Inspector enables you to analyze the behavior of your AWS resources @@ -62,7 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/iot/service.go b/service/iot/service.go index 49cda063b3e..38869db5f16 100644 --- a/service/iot/service.go +++ b/service/iot/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS IoT provides secure, bi-directional communication between Internet-connected @@ -66,7 +66,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/iotdataplane/service.go b/service/iotdataplane/service.go index 916a5ef3325..888b329d077 100644 --- a/service/iotdataplane/service.go +++ b/service/iotdataplane/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS IoT-Data enables secure, bi-directional communication between Internet-connected @@ -64,7 +64,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/kinesis/service.go b/service/kinesis/service.go index 687b7466b86..e2fe21e77ec 100644 --- a/service/kinesis/service.go +++ b/service/kinesis/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Kinesis Streams is a managed service that scales elastically for real @@ -61,7 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/kms/service.go b/service/kms/service.go index b6cc6322f87..4afd3a8e294 100644 --- a/service/kms/service.go +++ b/service/kms/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS Key Management Service (AWS KMS) is an encryption and key management @@ -130,7 +130,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/lambda/service.go b/service/lambda/service.go index 0ccde6c02a8..8b155cf848f 100644 --- a/service/lambda/service.go +++ b/service/lambda/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Overview @@ -64,7 +64,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/machinelearning/service.go b/service/machinelearning/service.go index d0021a894be..6ea471742d9 100644 --- a/service/machinelearning/service.go +++ b/service/machinelearning/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Definition of the public APIs exposed by Amazon Machine Learning @@ -60,7 +60,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/marketplacecommerceanalytics/service.go b/service/marketplacecommerceanalytics/service.go index 42c041877eb..0c257635f78 100644 --- a/service/marketplacecommerceanalytics/service.go +++ b/service/marketplacecommerceanalytics/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Provides AWS Marketplace business intelligence data on-demand. @@ -61,7 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/marketplacemetering/service.go b/service/marketplacemetering/service.go index 9dafec86cc0..9ab3a08c89a 100644 --- a/service/marketplacemetering/service.go +++ b/service/marketplacemetering/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // This reference provides descriptions of the low-level AWS Marketplace Metering @@ -69,7 +69,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/mobileanalytics/service.go b/service/mobileanalytics/service.go index c12cf9c00af..a6252f70d0f 100644 --- a/service/mobileanalytics/service.go +++ b/service/mobileanalytics/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restjson" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Mobile Analytics is a service for collecting, visualizing, and understanding @@ -59,7 +59,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) diff --git a/service/opsworks/service.go b/service/opsworks/service.go index 2df69358860..b1b43cd4d52 100644 --- a/service/opsworks/service.go +++ b/service/opsworks/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Welcome to the AWS OpsWorks API Reference. This guide provides descriptions, @@ -103,7 +103,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/rds/service.go b/service/rds/service.go index 43920b5f621..1082f992a07 100644 --- a/service/rds/service.go +++ b/service/rds/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Relational Database Service (Amazon RDS) is a web service that makes @@ -99,7 +99,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/redshift/service.go b/service/redshift/service.go index c25dff23bfc..f2870625dfe 100644 --- a/service/redshift/service.go +++ b/service/redshift/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Overview This is an interface reference for Amazon Redshift. It contains @@ -79,7 +79,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/route53/service.go b/service/route53/service.go index f4a82bde562..269c4db3602 100644 --- a/service/route53/service.go +++ b/service/route53/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restxml" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Route53 is a client for Route 53. @@ -58,7 +58,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) diff --git a/service/route53domains/service.go b/service/route53domains/service.go index 14517baeb8d..f119641eafc 100644 --- a/service/route53domains/service.go +++ b/service/route53domains/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Route53Domains is a client for Amazon Route 53 Domains. @@ -60,7 +60,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/s3/service.go b/service/s3/service.go index cf01da53501..5833952a2a6 100644 --- a/service/s3/service.go +++ b/service/s3/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/restxml" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // S3 is a client for Amazon S3. @@ -58,7 +58,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) diff --git a/service/ses/service.go b/service/ses/service.go index 18d1f57bda5..2952ac1314b 100644 --- a/service/ses/service.go +++ b/service/ses/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // This is the API Reference for Amazon Simple Email Service (Amazon SES). This @@ -65,7 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/simpledb/service.go b/service/simpledb/service.go index 1dfe8775262..196047620fa 100644 --- a/service/simpledb/service.go +++ b/service/simpledb/service.go @@ -73,7 +73,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v2.Sign) + svc.Handlers.Sign.PushBackNamed(v2.SignRequestHandler) svc.Handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) diff --git a/service/sns/service.go b/service/sns/service.go index 7d87839b327..75ecb0ac5d7 100644 --- a/service/sns/service.go +++ b/service/sns/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Amazon Simple Notification Service (Amazon SNS) is a web service that enables @@ -70,7 +70,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/sqs/service.go b/service/sqs/service.go index 7418ab42b8f..aaf456caac6 100644 --- a/service/sqs/service.go +++ b/service/sqs/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // Welcome to the Amazon Simple Queue Service API Reference. This section describes @@ -91,7 +91,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/ssm/service.go b/service/ssm/service.go index 9c67170530c..21cf35fbfea 100644 --- a/service/ssm/service.go +++ b/service/ssm/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // This is the Amazon Simple Systems Manager (SSM) API Reference. SSM enables @@ -167,7 +167,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/storagegateway/service.go b/service/storagegateway/service.go index eea7b49f7ff..aefbd494563 100644 --- a/service/storagegateway/service.go +++ b/service/storagegateway/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // AWS Storage Gateway is the service that connects an on-premises software @@ -111,7 +111,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/sts/service.go b/service/sts/service.go index fbe3cff33ae..c938e6ca114 100644 --- a/service/sts/service.go +++ b/service/sts/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // The AWS Security Token Service (STS) is a web service that enables you to @@ -102,7 +102,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(query.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(query.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(query.UnmarshalMetaHandler) diff --git a/service/support/service.go b/service/support/service.go index a6ef18cca82..7b7eb0f066c 100644 --- a/service/support/service.go +++ b/service/support/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // The AWS Support API reference is intended for programmers who need detailed @@ -94,7 +94,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/swf/service.go b/service/swf/service.go index 43881554682..9c9dd66da83 100644 --- a/service/swf/service.go +++ b/service/swf/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // The Amazon Simple Workflow Service (Amazon SWF) makes it easy to build applications @@ -72,7 +72,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/waf/service.go b/service/waf/service.go index d6e980b2e11..a4a780f2ccb 100644 --- a/service/waf/service.go +++ b/service/waf/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // This is the AWS WAF API Reference. This guide is for developers who need @@ -63,7 +63,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) diff --git a/service/workspaces/service.go b/service/workspaces/service.go index 59998437e57..1d1b5ec9167 100644 --- a/service/workspaces/service.go +++ b/service/workspaces/service.go @@ -7,8 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" - "github.com/aws/aws-sdk-go/private/signer/v4" ) // This is the Amazon WorkSpaces API Reference. This guide provides detailed @@ -62,7 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio } // Handlers - svc.Handlers.Sign.PushBack(v4.Sign) + svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)