mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
rebase: bump github.com/aws/aws-sdk-go-v2/service/sts
Bumps [github.com/aws/aws-sdk-go-v2/service/sts](https://github.com/aws/aws-sdk-go-v2) from 1.15.0 to 1.16.0. - [Release notes](https://github.com/aws/aws-sdk-go-v2/releases) - [Changelog](https://github.com/aws/aws-sdk-go-v2/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go-v2/compare/v1.15.0...service/s3/v1.16.0) --- updated-dependencies: - dependency-name: github.com/aws/aws-sdk-go-v2/service/sts dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
parent
4ebfe5ded2
commit
bb8bed8ac7
12
go.mod
12
go.mod
@ -5,7 +5,7 @@ go 1.17
|
|||||||
require (
|
require (
|
||||||
github.com/IBM/keyprotect-go-client v0.7.0
|
github.com/IBM/keyprotect-go-client v0.7.0
|
||||||
github.com/aws/aws-sdk-go v1.43.22
|
github.com/aws/aws-sdk-go v1.43.22
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.15.0
|
github.com/aws/aws-sdk-go-v2/service/sts v1.16.0
|
||||||
github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000
|
github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000
|
||||||
github.com/ceph/go-ceph v0.14.0
|
github.com/ceph/go-ceph v0.14.0
|
||||||
github.com/container-storage-interface/spec v1.5.0
|
github.com/container-storage-interface/spec v1.5.0
|
||||||
@ -44,11 +44,11 @@ require (
|
|||||||
require (
|
require (
|
||||||
github.com/armon/go-metrics v0.3.9 // indirect
|
github.com/armon/go-metrics v0.3.9 // indirect
|
||||||
github.com/armon/go-radix v1.0.0 // indirect
|
github.com/armon/go-radix v1.0.0 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2 v1.14.0 // indirect
|
github.com/aws/aws-sdk-go-v2 v1.15.0 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.5 // indirect
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.6 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.3.0 // indirect
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.0 // indirect
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.8.0 // indirect
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.0 // indirect
|
||||||
github.com/aws/smithy-go v1.11.0 // indirect
|
github.com/aws/smithy-go v1.11.1 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/bits-and-blooms/bitset v1.2.0 // indirect
|
github.com/bits-and-blooms/bitset v1.2.0 // indirect
|
||||||
github.com/blang/semver v3.5.1+incompatible // indirect
|
github.com/blang/semver v3.5.1+incompatible // indirect
|
||||||
|
24
go.sum
24
go.sum
@ -140,18 +140,18 @@ github.com/aws/aws-sdk-go v1.35.24/go.mod h1:tlPOdRjfxPBpNIwqDj61rmsnA85v9jc0Ps9
|
|||||||
github.com/aws/aws-sdk-go v1.38.49/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
|
github.com/aws/aws-sdk-go v1.38.49/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro=
|
||||||
github.com/aws/aws-sdk-go v1.43.22 h1:QY9/1TZB73UDEVQ68sUVJXf/7QUiHZl7zbbLF1wpqlc=
|
github.com/aws/aws-sdk-go v1.43.22 h1:QY9/1TZB73UDEVQ68sUVJXf/7QUiHZl7zbbLF1wpqlc=
|
||||||
github.com/aws/aws-sdk-go v1.43.22/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
github.com/aws/aws-sdk-go v1.43.22/go.mod h1:y4AeaBuwd2Lk+GepC1E9v0qOiTws0MIWAX4oIKwKHZo=
|
||||||
github.com/aws/aws-sdk-go-v2 v1.14.0 h1:IzSYBJHu0ZdUi27kIW6xVrs0eSxI4AzwbenzfXhhVs4=
|
github.com/aws/aws-sdk-go-v2 v1.15.0 h1:f9kWLNfyCzCB43eupDAk3/XgJ2EpgktiySD6leqs0js=
|
||||||
github.com/aws/aws-sdk-go-v2 v1.14.0/go.mod h1:ZA3Y8V0LrlWj63MQAnRHgKf/5QB//LSZCPNWlWrNGLU=
|
github.com/aws/aws-sdk-go-v2 v1.15.0/go.mod h1:lJYcuZZEHWNIb6ugJjbQY1fykdoobWbOS7kJYb4APoI=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.5 h1:+phazLmKkjBYhFTsGYH9J7jgnA8+Aer2yE4QeS4zn6A=
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.6 h1:xiGjGVQsem2cxoIX61uRGy+Jux2s9C/kKbTrWLdrU54=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.5/go.mod h1:2hXc8ooJqF2nAznsbJQIn+7h851/bu8GVC80OVTTqf8=
|
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.6/go.mod h1:SSPEdf9spsFgJyhjrXvawfpyzrXHBCUe+2eQ1CjC1Ak=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.3.0 h1:PO+HNeJBeRK0yVD9CQZ+VUrYfd5sXqS7YdPYHHcDkR4=
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.0 h1:bt3zw79tm209glISdMRCIVRCwvSDXxgAxh5KWe2qHkY=
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.3.0/go.mod h1:miRSv9l093jX/t/j+mBCaLqFHo9xKYzJ7DGm1BsGoJM=
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.0/go.mod h1:viTrxhAuejD+LszDahzAE2x40YjYWhMqzHxv2ZiWaME=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.8.0 h1:JNMALY8/ZnFsfAzBHtC4gq8JeZPANmIoI2VaBgYzbf8=
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.0 h1:YQ3fTXACo7xeAqg0NiqcCmBOXJruUfh+4+O2qxF2EjQ=
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.8.0/go.mod h1:rBDLgXDAwHOfxZKLRDl8OGTPzFDC+a2pLqNNj8+QwfI=
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.0/go.mod h1:R31ot6BgESRCIoxwfKtIHzZMo/vsZn2un81g9BJ4nmo=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.15.0 h1:zC/vHxWTlqZ0tIPJItg0zWHsa25cH7tXsUknSGcH39o=
|
github.com/aws/aws-sdk-go-v2/service/sts v1.16.0 h1:0+X/rJ2+DTBKWbUsn7WtF0JvNk/fRf928vkFsXkbbZs=
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts v1.15.0/go.mod h1:E264g2Gl5U9KTGzmd8ypGEAoh75VmqyuA/Ox5O1eRE4=
|
github.com/aws/aws-sdk-go-v2/service/sts v1.16.0/go.mod h1:+8k4H2ASUZZXmjx/s3DFLo9tGBb44lkz3XcgfypJY7s=
|
||||||
github.com/aws/smithy-go v1.11.0 h1:nOfSDwiiH232f90OuevPnAEQO5ZqH+xnn8uGVsvBCw4=
|
github.com/aws/smithy-go v1.11.1 h1:IQ+lPZVkSM3FRtyaDox41R8YS6iwPMYIreejOgPW49g=
|
||||||
github.com/aws/smithy-go v1.11.0/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM=
|
github.com/aws/smithy-go v1.11.1/go.mod h1:3xHYmszWVx2c0kIwQeEVf9uSm4fYZt67FBJnwub1bgM=
|
||||||
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
|
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
|
||||||
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
|
github.com/benbjohnson/clock v1.0.3/go.mod h1:bGMdMPoPVvcYyt1gHDf4J2KE153Yf9BuiUKYMaxlTDM=
|
||||||
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
|
github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
|
||||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/aws/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
|||||||
package aws
|
package aws
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "1.14.0"
|
const goModuleVersion = "1.15.0"
|
||||||
|
4
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md
generated
vendored
4
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/CHANGELOG.md
generated
vendored
@ -1,3 +1,7 @@
|
|||||||
|
# v1.1.6 (2022-03-08)
|
||||||
|
|
||||||
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
|
||||||
# v1.1.5 (2022-02-24)
|
# v1.1.5 (2022-02-24)
|
||||||
|
|
||||||
* **Dependency Update**: Updated to the latest SDK module versions
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/internal/configsources/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
|||||||
package configsources
|
package configsources
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "1.1.5"
|
const goModuleVersion = "1.1.6"
|
||||||
|
5
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md
generated
vendored
5
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/CHANGELOG.md
generated
vendored
@ -1,3 +1,8 @@
|
|||||||
|
# v2.4.0 (2022-03-08)
|
||||||
|
|
||||||
|
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||||
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
|
||||||
# v2.3.0 (2022-02-24)
|
# v2.3.0 (2022-02-24)
|
||||||
|
|
||||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/internal/endpoints/v2/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
|||||||
package endpoints
|
package endpoints
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "2.3.0"
|
const goModuleVersion = "2.4.0"
|
||||||
|
5
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md
generated
vendored
5
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md
generated
vendored
@ -1,3 +1,8 @@
|
|||||||
|
# v1.9.0 (2022-03-08)
|
||||||
|
|
||||||
|
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||||
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
|
||||||
# v1.8.0 (2022-02-24)
|
# v1.8.0 (2022-02-24)
|
||||||
|
|
||||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
package presignedurl
|
package presignedurl
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "1.8.0"
|
const goModuleVersion = "1.9.0"
|
||||||
|
6
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
6
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
@ -1,3 +1,9 @@
|
|||||||
|
# v1.16.0 (2022-03-08)
|
||||||
|
|
||||||
|
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||||
|
* **Documentation**: Updated service client model to latest release.
|
||||||
|
* **Dependency Update**: Updated to the latest SDK module versions
|
||||||
|
|
||||||
# v1.15.0 (2022-02-24)
|
# v1.15.0 (2022-02-24)
|
||||||
|
|
||||||
* **Feature**: API client updated
|
* **Feature**: API client updated
|
||||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
generated
vendored
@ -273,7 +273,7 @@ type AssumeRoleInput struct {
|
|||||||
// session. If you pass a session tag with the same key as an inherited tag, the
|
// session. If you pass a session tag with the same key as an inherited tag, the
|
||||||
// operation fails. To view the inherited tags for a session, see the CloudTrail
|
// operation fails. To view the inherited tags for a session, see the CloudTrail
|
||||||
// logs. For more information, see Viewing Session Tags in CloudTrail
|
// logs. For more information, see Viewing Session Tags in CloudTrail
|
||||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/session-tags.html#id_session-tags_ctlogs)
|
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs)
|
||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
Tags []types.Tag
|
Tags []types.Tag
|
||||||
|
|
||||||
|
20
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go
generated
vendored
20
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go
generated
vendored
@ -12,10 +12,12 @@ import (
|
|||||||
|
|
||||||
// Returns a set of temporary security credentials for users who have been
|
// Returns a set of temporary security credentials for users who have been
|
||||||
// authenticated in a mobile or web application with a web identity provider.
|
// authenticated in a mobile or web application with a web identity provider.
|
||||||
// Example providers include Amazon Cognito, Login with Amazon, Facebook, Google,
|
// Example providers include the OAuth 2.0 providers Login with Amazon and
|
||||||
// or any OpenID Connect-compatible identity provider. For mobile applications, we
|
// Facebook, or any OpenID Connect-compatible identity provider such as Google or
|
||||||
// recommend that you use Amazon Cognito. You can use Amazon Cognito with the
|
// Amazon Cognito federated identities
|
||||||
// Amazon Web Services SDK for iOS Developer Guide
|
// (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html).
|
||||||
|
// For mobile applications, we recommend that you use Amazon Cognito. You can use
|
||||||
|
// Amazon Cognito with the Amazon Web Services SDK for iOS Developer Guide
|
||||||
// (http://aws.amazon.com/sdkforios/) and the Amazon Web Services SDK for Android
|
// (http://aws.amazon.com/sdkforios/) and the Amazon Web Services SDK for Android
|
||||||
// Developer Guide (http://aws.amazon.com/sdkforandroid/) to uniquely identify a
|
// Developer Guide (http://aws.amazon.com/sdkforandroid/) to uniquely identify a
|
||||||
// user. You can also supply the user with a consistent identity throughout the
|
// user. You can also supply the user with a consistent identity throughout the
|
||||||
@ -244,11 +246,11 @@ type AssumeRoleWithWebIdentityInput struct {
|
|||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
PolicyArns []types.PolicyDescriptorType
|
PolicyArns []types.PolicyDescriptorType
|
||||||
|
|
||||||
// The fully qualified host component of the domain name of the identity provider.
|
// The fully qualified host component of the domain name of the OAuth 2.0 identity
|
||||||
// Specify this value only for OAuth 2.0 access tokens. Currently www.amazon.com
|
// provider. Do not specify this value for an OpenID Connect identity provider.
|
||||||
// and graph.facebook.com are the only supported identity providers for OAuth 2.0
|
// Currently www.amazon.com and graph.facebook.com are the only supported identity
|
||||||
// access tokens. Do not include URL schemes and port numbers. Do not specify this
|
// providers for OAuth 2.0 access tokens. Do not include URL schemes and port
|
||||||
// value for OpenID Connect ID tokens.
|
// numbers. Do not specify this value for OpenID Connect ID tokens.
|
||||||
ProviderId *string
|
ProviderId *string
|
||||||
|
|
||||||
noSmithyDocumentSerde
|
noSmithyDocumentSerde
|
||||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
|||||||
package sts
|
package sts
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "1.15.0"
|
const goModuleVersion = "1.16.0"
|
||||||
|
6
vendor/github.com/aws/smithy-go/CHANGELOG.md
generated
vendored
6
vendor/github.com/aws/smithy-go/CHANGELOG.md
generated
vendored
@ -1,3 +1,9 @@
|
|||||||
|
# Release (v1.11.1)
|
||||||
|
|
||||||
|
## Module Highlights
|
||||||
|
* `github.com/aws/smithy-go`: v1.11.1
|
||||||
|
* **Bug Fix**: Updates the smithy-go HTTP Request to correctly handle building the request to an http.Request. Related to [aws/aws-sdk-go-v2#1583](https://github.com/aws/aws-sdk-go-v2/issues/1583)
|
||||||
|
|
||||||
# Release (v1.11.0)
|
# Release (v1.11.0)
|
||||||
|
|
||||||
## Module Highlights
|
## Module Highlights
|
||||||
|
2
vendor/github.com/aws/smithy-go/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/smithy-go/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
|||||||
package smithy
|
package smithy
|
||||||
|
|
||||||
// goModuleVersion is the tagged release for this module
|
// goModuleVersion is the tagged release for this module
|
||||||
const goModuleVersion = "1.11.0"
|
const goModuleVersion = "1.11.1"
|
||||||
|
5
vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go
generated
vendored
5
vendor/github.com/aws/smithy-go/transport/http/checksum_middleware.go
generated
vendored
@ -45,6 +45,11 @@ func (m *contentMD5Checksum) HandleBuild(
|
|||||||
stream := req.GetStream()
|
stream := req.GetStream()
|
||||||
// compute checksum if payload is explicit
|
// compute checksum if payload is explicit
|
||||||
if stream != nil {
|
if stream != nil {
|
||||||
|
if !req.IsStreamSeekable() {
|
||||||
|
return out, metadata, fmt.Errorf(
|
||||||
|
"unseekable stream is not supported for computing md5 checksum")
|
||||||
|
}
|
||||||
|
|
||||||
v, err := computeMD5Checksum(stream)
|
v, err := computeMD5Checksum(stream)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return out, metadata, fmt.Errorf("error computing md5 checksum, %w", err)
|
return out, metadata, fmt.Errorf("error computing md5 checksum, %w", err)
|
||||||
|
6
vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go
generated
vendored
6
vendor/github.com/aws/smithy-go/transport/http/middleware_content_length.go
generated
vendored
@ -44,12 +44,6 @@ func (m *ComputeContentLength) HandleBuild(
|
|||||||
"failed getting length of request stream, %w", err)
|
"failed getting length of request stream, %w", err)
|
||||||
} else if ok {
|
} else if ok {
|
||||||
req.ContentLength = n
|
req.ContentLength = n
|
||||||
if n == 0 {
|
|
||||||
// If the content length could be determined, and the body is empty
|
|
||||||
// the stream must be cleared to prevent unexpected chunk encoding.
|
|
||||||
req, _ = req.SetStream(nil)
|
|
||||||
in.Request = req
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return next.HandleBuild(ctx, in)
|
return next.HandleBuild(ctx, in)
|
||||||
|
50
vendor/github.com/aws/smithy-go/transport/http/request.go
generated
vendored
50
vendor/github.com/aws/smithy-go/transport/http/request.go
generated
vendored
@ -45,19 +45,23 @@ func (r *Request) Clone() *Request {
|
|||||||
// to the request and ok set. If the length cannot be determined, an error will
|
// to the request and ok set. If the length cannot be determined, an error will
|
||||||
// be returned.
|
// be returned.
|
||||||
func (r *Request) StreamLength() (size int64, ok bool, err error) {
|
func (r *Request) StreamLength() (size int64, ok bool, err error) {
|
||||||
if r.stream == nil {
|
return streamLength(r.stream, r.isStreamSeekable, r.streamStartPos)
|
||||||
|
}
|
||||||
|
|
||||||
|
func streamLength(stream io.Reader, seekable bool, startPos int64) (size int64, ok bool, err error) {
|
||||||
|
if stream == nil {
|
||||||
return 0, true, nil
|
return 0, true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if l, ok := r.stream.(interface{ Len() int }); ok {
|
if l, ok := stream.(interface{ Len() int }); ok {
|
||||||
return int64(l.Len()), true, nil
|
return int64(l.Len()), true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if !r.isStreamSeekable {
|
if !seekable {
|
||||||
return 0, false, nil
|
return 0, false, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
s := r.stream.(io.Seeker)
|
s := stream.(io.Seeker)
|
||||||
endOffset, err := s.Seek(0, io.SeekEnd)
|
endOffset, err := s.Seek(0, io.SeekEnd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, false, err
|
return 0, false, err
|
||||||
@ -69,12 +73,12 @@ func (r *Request) StreamLength() (size int64, ok bool, err error) {
|
|||||||
// file, and wants to skip the first N bytes uploading the rest. The
|
// file, and wants to skip the first N bytes uploading the rest. The
|
||||||
// application would move the file's offset N bytes, then hand it off to
|
// application would move the file's offset N bytes, then hand it off to
|
||||||
// the SDK to send the remaining. The SDK should respect that initial offset.
|
// the SDK to send the remaining. The SDK should respect that initial offset.
|
||||||
_, err = s.Seek(r.streamStartPos, io.SeekStart)
|
_, err = s.Seek(startPos, io.SeekStart)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, false, err
|
return 0, false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return endOffset - r.streamStartPos, true, nil
|
return endOffset - startPos, true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// RewindStream will rewind the io.Reader to the relative start position if it
|
// RewindStream will rewind the io.Reader to the relative start position if it
|
||||||
@ -103,23 +107,41 @@ func (r *Request) IsStreamSeekable() bool {
|
|||||||
return r.isStreamSeekable
|
return r.isStreamSeekable
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetStream returns a clone of the request with the stream set to the provided reader.
|
// SetStream returns a clone of the request with the stream set to the provided
|
||||||
// May return an error if the provided reader is seekable but returns an error.
|
// reader. May return an error if the provided reader is seekable but returns
|
||||||
|
// an error.
|
||||||
func (r *Request) SetStream(reader io.Reader) (rc *Request, err error) {
|
func (r *Request) SetStream(reader io.Reader) (rc *Request, err error) {
|
||||||
rc = r.Clone()
|
rc = r.Clone()
|
||||||
|
|
||||||
|
if reader == http.NoBody {
|
||||||
|
reader = nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var isStreamSeekable bool
|
||||||
|
var streamStartPos int64
|
||||||
switch v := reader.(type) {
|
switch v := reader.(type) {
|
||||||
case io.Seeker:
|
case io.Seeker:
|
||||||
n, err := v.Seek(0, io.SeekCurrent)
|
n, err := v.Seek(0, io.SeekCurrent)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return r, err
|
return r, err
|
||||||
}
|
}
|
||||||
rc.isStreamSeekable = true
|
isStreamSeekable = true
|
||||||
rc.streamStartPos = n
|
streamStartPos = n
|
||||||
default:
|
default:
|
||||||
rc.isStreamSeekable = false
|
// If the stream length can be determined, and is determined to be empty,
|
||||||
|
// use a nil stream to prevent confusion between empty vs not-empty
|
||||||
|
// streams.
|
||||||
|
length, ok, err := streamLength(reader, false, 0)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
} else if ok && length == 0 {
|
||||||
|
reader = nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rc.stream = reader
|
rc.stream = reader
|
||||||
|
rc.isStreamSeekable = isStreamSeekable
|
||||||
|
rc.streamStartPos = streamStartPos
|
||||||
|
|
||||||
return rc, err
|
return rc, err
|
||||||
}
|
}
|
||||||
@ -139,7 +161,11 @@ func (r *Request) Build(ctx context.Context) *http.Request {
|
|||||||
req.Body = ioutil.NopCloser(stream)
|
req.Body = ioutil.NopCloser(stream)
|
||||||
req.ContentLength = -1
|
req.ContentLength = -1
|
||||||
default:
|
default:
|
||||||
if r.stream != nil {
|
// HTTP Client Request must only have a non-nil body if the
|
||||||
|
// ContentLength is explicitly unknown (-1) or non-zero. The HTTP
|
||||||
|
// Client will interpret a non-nil body and ContentLength 0 as
|
||||||
|
// "unknown". This is unwanted behavior.
|
||||||
|
if req.ContentLength != 0 && r.stream != nil {
|
||||||
req.Body = iointernal.NewSafeReadCloser(ioutil.NopCloser(stream))
|
req.Body = iointernal.NewSafeReadCloser(ioutil.NopCloser(stream))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
12
vendor/modules.txt
vendored
12
vendor/modules.txt
vendored
@ -53,7 +53,7 @@ github.com/aws/aws-sdk-go/service/sso
|
|||||||
github.com/aws/aws-sdk-go/service/sso/ssoiface
|
github.com/aws/aws-sdk-go/service/sso/ssoiface
|
||||||
github.com/aws/aws-sdk-go/service/sts
|
github.com/aws/aws-sdk-go/service/sts
|
||||||
github.com/aws/aws-sdk-go/service/sts/stsiface
|
github.com/aws/aws-sdk-go/service/sts/stsiface
|
||||||
# github.com/aws/aws-sdk-go-v2 v1.14.0
|
# github.com/aws/aws-sdk-go-v2 v1.15.0
|
||||||
## explicit; go 1.15
|
## explicit; go 1.15
|
||||||
github.com/aws/aws-sdk-go-v2/aws
|
github.com/aws/aws-sdk-go-v2/aws
|
||||||
github.com/aws/aws-sdk-go-v2/aws/defaults
|
github.com/aws/aws-sdk-go-v2/aws/defaults
|
||||||
@ -70,21 +70,21 @@ github.com/aws/aws-sdk-go-v2/internal/sdk
|
|||||||
github.com/aws/aws-sdk-go-v2/internal/strings
|
github.com/aws/aws-sdk-go-v2/internal/strings
|
||||||
github.com/aws/aws-sdk-go-v2/internal/sync/singleflight
|
github.com/aws/aws-sdk-go-v2/internal/sync/singleflight
|
||||||
github.com/aws/aws-sdk-go-v2/internal/timeconv
|
github.com/aws/aws-sdk-go-v2/internal/timeconv
|
||||||
# github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.5
|
# github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.6
|
||||||
## explicit; go 1.15
|
## explicit; go 1.15
|
||||||
github.com/aws/aws-sdk-go-v2/internal/configsources
|
github.com/aws/aws-sdk-go-v2/internal/configsources
|
||||||
# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.3.0
|
# github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.0
|
||||||
## explicit; go 1.15
|
## explicit; go 1.15
|
||||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2
|
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2
|
||||||
# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.8.0
|
# github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.0
|
||||||
## explicit; go 1.15
|
## explicit; go 1.15
|
||||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url
|
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url
|
||||||
# github.com/aws/aws-sdk-go-v2/service/sts v1.15.0
|
# github.com/aws/aws-sdk-go-v2/service/sts v1.16.0
|
||||||
## explicit; go 1.15
|
## explicit; go 1.15
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts
|
github.com/aws/aws-sdk-go-v2/service/sts
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints
|
github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints
|
||||||
github.com/aws/aws-sdk-go-v2/service/sts/types
|
github.com/aws/aws-sdk-go-v2/service/sts/types
|
||||||
# github.com/aws/smithy-go v1.11.0
|
# github.com/aws/smithy-go v1.11.1
|
||||||
## explicit; go 1.15
|
## explicit; go 1.15
|
||||||
github.com/aws/smithy-go
|
github.com/aws/smithy-go
|
||||||
github.com/aws/smithy-go/document
|
github.com/aws/smithy-go/document
|
||||||
|
Loading…
Reference in New Issue
Block a user