Struct: customizations.ExpressSigner

import "../ibm-cos-sdk-go-v2/service/s3/internal/customizations"

Overview

ExpressSigner signs requests for the sigv4-s3express auth scheme.

This signer respects the aws.auth#sigv4 properties for signing name and region.

Implemented Interfaces

types.AnalyticsFilter, v4.HTTPPresigner, s3.HTTPPresignerV4, types.MetricsFilter, s3.PresignPost, arn.S3ObjectLambdaARN, types.SelectObjectContentEventStream

Structure Field Summary collapse

Method Summary collapse

Structure Field Details

LogSigning bool

Logger logging.Logger

Signer v4.HTTPSigner

Method Details

func (v *ExpressSigner) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, props smithy.Properties) error

SignRequest signs the request with the provided identity.



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// File 'service/s3/internal/customizations/express_signer_smithy.go', line 28

func (v *ExpressSigner) SignRequest(ctx context.Context, r *smithyhttp.Request, identity auth.Identity, props smithy.Properties) error { ca, ok := identity.(*internalauthsmithy.CredentialsAdapter) if !ok { return fmt.Errorf("unexpected identity type: %T", identity) } name, ok := smithyhttp.GetSigV4SigningName(&props) if !ok { return fmt.Errorf("sigv4 signing name is required for s3express variant") } region, ok := smithyhttp.GetSigV4SigningRegion(&props) if !ok { return fmt.Errorf("sigv4 signing region is required for s3express variant") } hash := v4.GetPayloadHash(ctx) r.Header.Set(headerAmzSessionToken, ca.Credentials.SessionToken) err := v.Signer.SignHTTP(ctx, ca.Credentials, r.Request, hash, name, region, sdk.NowTime(), func(o *v4.SignerOptions) { o.DisableSessionToken = true o.DisableURIPathEscaping, _ = smithyhttp.GetDisableDoubleEncoding(&props) o.Logger = v.Logger o.LogSigning = v.LogSigning }) if err != nil { return fmt.Errorf("sign http: %v", err) } return nil }