mirror of https://github.com/k3s-io/k3s
Merge pull request #65568 from eisig/aws-sdk
Automatic merge from submit-queue (batch tested with PRs 65357, 65568). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. update aws-sdk to support new region cn-northwest-1 Update aws sdk to support region cn-northwest-1 in China. **What this PR does / why we need it**: need newer aws-sdk version to support new region cn-northwest-1 **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```pull/8/head
commit
09784ccf83
|
@ -149,163 +149,178 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/awserr",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/awserr",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/awsutil",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/awsutil",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/client",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/client",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/client/metadata",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/client/metadata",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/corehandlers",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/corehandlers",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/endpointcreds",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/stscreds",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/credentials/stscreds",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/csm",
|
||||||
|
"Comment": "v1.14.12",
|
||||||
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/defaults",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/defaults",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/ec2metadata",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/ec2metadata",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/endpoints",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/endpoints",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/request",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/request",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/session",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/session",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/aws/signer/v4",
|
"ImportPath": "github.com/aws/aws-sdk-go/aws/signer/v4",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ImportPath": "github.com/aws/aws-sdk-go/internal/sdkio",
|
||||||
|
"Comment": "v1.14.12",
|
||||||
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ImportPath": "github.com/aws/aws-sdk-go/internal/sdkrand",
|
||||||
|
"Comment": "v1.14.12",
|
||||||
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/internal/shareddefaults",
|
"ImportPath": "github.com/aws/aws-sdk-go/internal/shareddefaults",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol",
|
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/ec2query",
|
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/ec2query",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil",
|
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/jsonrpc",
|
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/jsonrpc",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query",
|
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil",
|
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/query/queryutil",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest",
|
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/rest",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil",
|
"ImportPath": "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/service/autoscaling",
|
"ImportPath": "github.com/aws/aws-sdk-go/service/autoscaling",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/service/ec2",
|
"ImportPath": "github.com/aws/aws-sdk-go/service/ec2",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/service/ecr",
|
"ImportPath": "github.com/aws/aws-sdk-go/service/ecr",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/service/elb",
|
"ImportPath": "github.com/aws/aws-sdk-go/service/elb",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/service/elbv2",
|
"ImportPath": "github.com/aws/aws-sdk-go/service/elbv2",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/service/kms",
|
"ImportPath": "github.com/aws/aws-sdk-go/service/kms",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/aws/aws-sdk-go/service/sts",
|
"ImportPath": "github.com/aws/aws-sdk-go/service/sts",
|
||||||
"Comment": "v1.12.7",
|
"Comment": "v1.14.12",
|
||||||
"Rev": "760741802ad40f49ae9fc4a69ef6706d2527d62e"
|
"Rev": "fde4ded7becdeae4d26bf1212916aabba79349b4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "github.com/bazelbuild/bazel-gazelle/cmd/gazelle",
|
"ImportPath": "github.com/bazelbuild/bazel-gazelle/cmd/gazelle",
|
||||||
|
|
|
@ -3072,6 +3072,216 @@ SOFTWARE.
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
= vendor/github.com/aws/aws-sdk-go/aws/csm licensed under: =
|
||||||
|
|
||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
= vendor/github.com/aws/aws-sdk-go/LICENSE.txt 3b83ef96387f14655fc854ddc3c6bd57
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
= vendor/github.com/aws/aws-sdk-go/aws/defaults licensed under: =
|
= vendor/github.com/aws/aws-sdk-go/aws/defaults licensed under: =
|
||||||
|
|
||||||
|
@ -4332,6 +4542,426 @@ SOFTWARE.
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
= vendor/github.com/aws/aws-sdk-go/internal/sdkio licensed under: =
|
||||||
|
|
||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
= vendor/github.com/aws/aws-sdk-go/LICENSE.txt 3b83ef96387f14655fc854ddc3c6bd57
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
= vendor/github.com/aws/aws-sdk-go/internal/sdkrand licensed under: =
|
||||||
|
|
||||||
|
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
= vendor/github.com/aws/aws-sdk-go/LICENSE.txt 3b83ef96387f14655fc854ddc3c6bd57
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
|
||||||
================================================================================
|
================================================================================
|
||||||
= vendor/github.com/aws/aws-sdk-go/internal/shareddefaults licensed under: =
|
= vendor/github.com/aws/aws-sdk-go/internal/shareddefaults licensed under: =
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@ filegroup(
|
||||||
"//vendor/github.com/armon/circbuf:all-srcs",
|
"//vendor/github.com/armon/circbuf:all-srcs",
|
||||||
"//vendor/github.com/asaskevich/govalidator:all-srcs",
|
"//vendor/github.com/asaskevich/govalidator:all-srcs",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws:all-srcs",
|
"//vendor/github.com/aws/aws-sdk-go/aws:all-srcs",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/internal/sdkio:all-srcs",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/internal/sdkrand:all-srcs",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/internal/shareddefaults:all-srcs",
|
"//vendor/github.com/aws/aws-sdk-go/internal/shareddefaults:all-srcs",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/private/protocol:all-srcs",
|
"//vendor/github.com/aws/aws-sdk-go/private/protocol:all-srcs",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/service/autoscaling:all-srcs",
|
"//vendor/github.com/aws/aws-sdk-go/service/autoscaling:all-srcs",
|
||||||
|
|
|
@ -24,6 +24,7 @@ go_library(
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/credentials:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/credentials:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/endpoints:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/endpoints:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/internal/sdkio:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -43,6 +44,7 @@ filegroup(
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/client:all-srcs",
|
"//vendor/github.com/aws/aws-sdk-go/aws/client:all-srcs",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/corehandlers:all-srcs",
|
"//vendor/github.com/aws/aws-sdk-go/aws/corehandlers:all-srcs",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/credentials:all-srcs",
|
"//vendor/github.com/aws/aws-sdk-go/aws/credentials:all-srcs",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/aws/csm:all-srcs",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/defaults:all-srcs",
|
"//vendor/github.com/aws/aws-sdk-go/aws/defaults:all-srcs",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/ec2metadata:all-srcs",
|
"//vendor/github.com/aws/aws-sdk-go/aws/ec2metadata:all-srcs",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/endpoints:all-srcs",
|
"//vendor/github.com/aws/aws-sdk-go/aws/endpoints:all-srcs",
|
||||||
|
|
|
@ -14,6 +14,7 @@ go_library(
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/internal/sdkrand:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,12 @@ type Config struct {
|
||||||
Endpoint string
|
Endpoint string
|
||||||
SigningRegion string
|
SigningRegion string
|
||||||
SigningName string
|
SigningName string
|
||||||
|
|
||||||
|
// States that the signing name did not come from a modeled source but
|
||||||
|
// was derived based on other data. Used by service client constructors
|
||||||
|
// to determine if the signin name can be overriden based on metadata the
|
||||||
|
// service has.
|
||||||
|
SigningNameDerived bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ConfigProvider provides a generic way for a service client to receive
|
// ConfigProvider provides a generic way for a service client to receive
|
||||||
|
@ -85,6 +91,6 @@ func (c *Client) AddDebugHandlers() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Handlers.Send.PushFrontNamed(request.NamedHandler{Name: "awssdk.client.LogRequest", Fn: logRequest})
|
c.Handlers.Send.PushFrontNamed(LogHTTPRequestHandler)
|
||||||
c.Handlers.Send.PushBackNamed(request.NamedHandler{Name: "awssdk.client.LogResponse", Fn: logResponse})
|
c.Handlers.Send.PushBackNamed(LogHTTPResponseHandler)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package client
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
"strconv"
|
||||||
"sync"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws/request"
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
|
"github.com/aws/aws-sdk-go/internal/sdkrand"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultRetryer implements basic retry logic using exponential backoff for
|
// DefaultRetryer implements basic retry logic using exponential backoff for
|
||||||
|
@ -30,25 +30,27 @@ func (d DefaultRetryer) MaxRetries() int {
|
||||||
return d.NumMaxRetries
|
return d.NumMaxRetries
|
||||||
}
|
}
|
||||||
|
|
||||||
var seededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())})
|
|
||||||
|
|
||||||
// RetryRules returns the delay duration before retrying this request again
|
// RetryRules returns the delay duration before retrying this request again
|
||||||
func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration {
|
func (d DefaultRetryer) RetryRules(r *request.Request) time.Duration {
|
||||||
// Set the upper limit of delay in retrying at ~five minutes
|
// Set the upper limit of delay in retrying at ~five minutes
|
||||||
minTime := 30
|
minTime := 30
|
||||||
throttle := d.shouldThrottle(r)
|
throttle := d.shouldThrottle(r)
|
||||||
if throttle {
|
if throttle {
|
||||||
|
if delay, ok := getRetryDelay(r); ok {
|
||||||
|
return delay
|
||||||
|
}
|
||||||
|
|
||||||
minTime = 500
|
minTime = 500
|
||||||
}
|
}
|
||||||
|
|
||||||
retryCount := r.RetryCount
|
retryCount := r.RetryCount
|
||||||
if retryCount > 13 {
|
if throttle && retryCount > 8 {
|
||||||
retryCount = 13
|
|
||||||
} else if throttle && retryCount > 8 {
|
|
||||||
retryCount = 8
|
retryCount = 8
|
||||||
|
} else if retryCount > 13 {
|
||||||
|
retryCount = 13
|
||||||
}
|
}
|
||||||
|
|
||||||
delay := (1 << uint(retryCount)) * (seededRand.Intn(minTime) + minTime)
|
delay := (1 << uint(retryCount)) * (sdkrand.SeededRand.Intn(minTime) + minTime)
|
||||||
return time.Duration(delay) * time.Millisecond
|
return time.Duration(delay) * time.Millisecond
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +62,7 @@ func (d DefaultRetryer) ShouldRetry(r *request.Request) bool {
|
||||||
return *r.Retryable
|
return *r.Retryable
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.HTTPResponse.StatusCode >= 500 {
|
if r.HTTPResponse.StatusCode >= 500 && r.HTTPResponse.StatusCode != 501 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
return r.IsErrorRetryable() || d.shouldThrottle(r)
|
return r.IsErrorRetryable() || d.shouldThrottle(r)
|
||||||
|
@ -68,29 +70,47 @@ func (d DefaultRetryer) ShouldRetry(r *request.Request) bool {
|
||||||
|
|
||||||
// ShouldThrottle returns true if the request should be throttled.
|
// ShouldThrottle returns true if the request should be throttled.
|
||||||
func (d DefaultRetryer) shouldThrottle(r *request.Request) bool {
|
func (d DefaultRetryer) shouldThrottle(r *request.Request) bool {
|
||||||
if r.HTTPResponse.StatusCode == 502 ||
|
switch r.HTTPResponse.StatusCode {
|
||||||
r.HTTPResponse.StatusCode == 503 ||
|
case 429:
|
||||||
r.HTTPResponse.StatusCode == 504 {
|
case 502:
|
||||||
return true
|
case 503:
|
||||||
|
case 504:
|
||||||
|
default:
|
||||||
|
return r.IsErrorThrottle()
|
||||||
}
|
}
|
||||||
return r.IsErrorThrottle()
|
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
// lockedSource is a thread-safe implementation of rand.Source
|
// This will look in the Retry-After header, RFC 7231, for how long
|
||||||
type lockedSource struct {
|
// it will wait before attempting another request
|
||||||
lk sync.Mutex
|
func getRetryDelay(r *request.Request) (time.Duration, bool) {
|
||||||
src rand.Source
|
if !canUseRetryAfterHeader(r) {
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
|
||||||
|
delayStr := r.HTTPResponse.Header.Get("Retry-After")
|
||||||
|
if len(delayStr) == 0 {
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
|
||||||
|
delay, err := strconv.Atoi(delayStr)
|
||||||
|
if err != nil {
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
|
||||||
|
return time.Duration(delay) * time.Second, true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *lockedSource) Int63() (n int64) {
|
// Will look at the status code to see if the retry header pertains to
|
||||||
r.lk.Lock()
|
// the status code.
|
||||||
n = r.src.Int63()
|
func canUseRetryAfterHeader(r *request.Request) bool {
|
||||||
r.lk.Unlock()
|
switch r.HTTPResponse.StatusCode {
|
||||||
return
|
case 429:
|
||||||
}
|
case 503:
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
func (r *lockedSource) Seed(seed int64) {
|
return true
|
||||||
r.lk.Lock()
|
|
||||||
r.src.Seed(seed)
|
|
||||||
r.lk.Unlock()
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,22 +44,57 @@ func (reader *teeReaderCloser) Close() error {
|
||||||
return reader.Source.Close()
|
return reader.Source.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LogHTTPRequestHandler is a SDK request handler to log the HTTP request sent
|
||||||
|
// to a service. Will include the HTTP request body if the LogLevel of the
|
||||||
|
// request matches LogDebugWithHTTPBody.
|
||||||
|
var LogHTTPRequestHandler = request.NamedHandler{
|
||||||
|
Name: "awssdk.client.LogRequest",
|
||||||
|
Fn: logRequest,
|
||||||
|
}
|
||||||
|
|
||||||
func logRequest(r *request.Request) {
|
func logRequest(r *request.Request) {
|
||||||
logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
|
logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
|
||||||
dumpedBody, err := httputil.DumpRequestOut(r.HTTPRequest, logBody)
|
bodySeekable := aws.IsReaderSeekable(r.Body)
|
||||||
|
|
||||||
|
b, err := httputil.DumpRequestOut(r.HTTPRequest, logBody)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg, r.ClientInfo.ServiceName, r.Operation.Name, err))
|
r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg,
|
||||||
|
r.ClientInfo.ServiceName, r.Operation.Name, err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if logBody {
|
if logBody {
|
||||||
|
if !bodySeekable {
|
||||||
|
r.SetReaderBody(aws.ReadSeekCloser(r.HTTPRequest.Body))
|
||||||
|
}
|
||||||
// Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's
|
// Reset the request body because dumpRequest will re-wrap the r.HTTPRequest's
|
||||||
// Body as a NoOpCloser and will not be reset after read by the HTTP
|
// Body as a NoOpCloser and will not be reset after read by the HTTP
|
||||||
// client reader.
|
// client reader.
|
||||||
r.ResetBody()
|
r.ResetBody()
|
||||||
}
|
}
|
||||||
|
|
||||||
r.Config.Logger.Log(fmt.Sprintf(logReqMsg, r.ClientInfo.ServiceName, r.Operation.Name, string(dumpedBody)))
|
r.Config.Logger.Log(fmt.Sprintf(logReqMsg,
|
||||||
|
r.ClientInfo.ServiceName, r.Operation.Name, string(b)))
|
||||||
|
}
|
||||||
|
|
||||||
|
// LogHTTPRequestHeaderHandler is a SDK request handler to log the HTTP request sent
|
||||||
|
// to a service. Will only log the HTTP request's headers. The request payload
|
||||||
|
// will not be read.
|
||||||
|
var LogHTTPRequestHeaderHandler = request.NamedHandler{
|
||||||
|
Name: "awssdk.client.LogRequestHeader",
|
||||||
|
Fn: logRequestHeader,
|
||||||
|
}
|
||||||
|
|
||||||
|
func logRequestHeader(r *request.Request) {
|
||||||
|
b, err := httputil.DumpRequestOut(r.HTTPRequest, false)
|
||||||
|
if err != nil {
|
||||||
|
r.Config.Logger.Log(fmt.Sprintf(logReqErrMsg,
|
||||||
|
r.ClientInfo.ServiceName, r.Operation.Name, err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.Config.Logger.Log(fmt.Sprintf(logReqMsg,
|
||||||
|
r.ClientInfo.ServiceName, r.Operation.Name, string(b)))
|
||||||
}
|
}
|
||||||
|
|
||||||
const logRespMsg = `DEBUG: Response %s/%s Details:
|
const logRespMsg = `DEBUG: Response %s/%s Details:
|
||||||
|
@ -72,27 +107,44 @@ const logRespErrMsg = `DEBUG ERROR: Response %s/%s:
|
||||||
%s
|
%s
|
||||||
-----------------------------------------------------`
|
-----------------------------------------------------`
|
||||||
|
|
||||||
|
// LogHTTPResponseHandler is a SDK request handler to log the HTTP response
|
||||||
|
// received from a service. Will include the HTTP response body if the LogLevel
|
||||||
|
// of the request matches LogDebugWithHTTPBody.
|
||||||
|
var LogHTTPResponseHandler = request.NamedHandler{
|
||||||
|
Name: "awssdk.client.LogResponse",
|
||||||
|
Fn: logResponse,
|
||||||
|
}
|
||||||
|
|
||||||
func logResponse(r *request.Request) {
|
func logResponse(r *request.Request) {
|
||||||
lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)}
|
lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)}
|
||||||
r.HTTPResponse.Body = &teeReaderCloser{
|
|
||||||
Reader: io.TeeReader(r.HTTPResponse.Body, lw),
|
logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody)
|
||||||
Source: r.HTTPResponse.Body,
|
if logBody {
|
||||||
|
r.HTTPResponse.Body = &teeReaderCloser{
|
||||||
|
Reader: io.TeeReader(r.HTTPResponse.Body, lw),
|
||||||
|
Source: r.HTTPResponse.Body,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handlerFn := func(req *request.Request) {
|
handlerFn := func(req *request.Request) {
|
||||||
body, err := httputil.DumpResponse(req.HTTPResponse, false)
|
b, err := httputil.DumpResponse(req.HTTPResponse, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
lw.Logger.Log(fmt.Sprintf(logRespErrMsg, req.ClientInfo.ServiceName, req.Operation.Name, err))
|
lw.Logger.Log(fmt.Sprintf(logRespErrMsg,
|
||||||
|
req.ClientInfo.ServiceName, req.Operation.Name, err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
b, err := ioutil.ReadAll(lw.buf)
|
lw.Logger.Log(fmt.Sprintf(logRespMsg,
|
||||||
if err != nil {
|
req.ClientInfo.ServiceName, req.Operation.Name, string(b)))
|
||||||
lw.Logger.Log(fmt.Sprintf(logRespErrMsg, req.ClientInfo.ServiceName, req.Operation.Name, err))
|
|
||||||
return
|
if logBody {
|
||||||
}
|
b, err := ioutil.ReadAll(lw.buf)
|
||||||
lw.Logger.Log(fmt.Sprintf(logRespMsg, req.ClientInfo.ServiceName, req.Operation.Name, string(body)))
|
if err != nil {
|
||||||
if req.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) {
|
lw.Logger.Log(fmt.Sprintf(logRespErrMsg,
|
||||||
|
req.ClientInfo.ServiceName, req.Operation.Name, err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
lw.Logger.Log(string(b))
|
lw.Logger.Log(string(b))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -106,3 +158,27 @@ func logResponse(r *request.Request) {
|
||||||
Name: handlerName, Fn: handlerFn,
|
Name: handlerName, Fn: handlerFn,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LogHTTPResponseHeaderHandler is a SDK request handler to log the HTTP
|
||||||
|
// response received from a service. Will only log the HTTP response's headers.
|
||||||
|
// The response payload will not be read.
|
||||||
|
var LogHTTPResponseHeaderHandler = request.NamedHandler{
|
||||||
|
Name: "awssdk.client.LogResponseHeader",
|
||||||
|
Fn: logResponseHeader,
|
||||||
|
}
|
||||||
|
|
||||||
|
func logResponseHeader(r *request.Request) {
|
||||||
|
if r.Config.Logger == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
b, err := httputil.DumpResponse(r.HTTPResponse, false)
|
||||||
|
if err != nil {
|
||||||
|
r.Config.Logger.Log(fmt.Sprintf(logRespErrMsg,
|
||||||
|
r.ClientInfo.ServiceName, r.Operation.Name, err))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
r.Config.Logger.Log(fmt.Sprintf(logRespMsg,
|
||||||
|
r.ClientInfo.ServiceName, r.Operation.Name, string(b)))
|
||||||
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package metadata
|
||||||
// ClientInfo wraps immutable data from the client.Client structure.
|
// ClientInfo wraps immutable data from the client.Client structure.
|
||||||
type ClientInfo struct {
|
type ClientInfo struct {
|
||||||
ServiceName string
|
ServiceName string
|
||||||
|
ServiceID string
|
||||||
APIVersion string
|
APIVersion string
|
||||||
Endpoint string
|
Endpoint string
|
||||||
SigningName string
|
SigningName string
|
||||||
|
|
|
@ -151,6 +151,15 @@ type Config struct {
|
||||||
// with accelerate.
|
// with accelerate.
|
||||||
S3UseAccelerate *bool
|
S3UseAccelerate *bool
|
||||||
|
|
||||||
|
// S3DisableContentMD5Validation config option is temporarily disabled,
|
||||||
|
// For S3 GetObject API calls, #1837.
|
||||||
|
//
|
||||||
|
// Set this to `true` to disable the S3 service client from automatically
|
||||||
|
// adding the ContentMD5 to S3 Object Put and Upload API calls. This option
|
||||||
|
// will also disable the SDK from performing object ContentMD5 validation
|
||||||
|
// on GetObject API calls.
|
||||||
|
S3DisableContentMD5Validation *bool
|
||||||
|
|
||||||
// Set this to `true` to disable the EC2Metadata client from overriding the
|
// Set this to `true` to disable the EC2Metadata client from overriding the
|
||||||
// default http.Client's Timeout. This is helpful if you do not want the
|
// default http.Client's Timeout. This is helpful if you do not want the
|
||||||
// EC2Metadata client to create a new http.Client. This options is only
|
// EC2Metadata client to create a new http.Client. This options is only
|
||||||
|
@ -168,7 +177,7 @@ type Config struct {
|
||||||
//
|
//
|
||||||
EC2MetadataDisableTimeoutOverride *bool
|
EC2MetadataDisableTimeoutOverride *bool
|
||||||
|
|
||||||
// Instructs the endpiont to be generated for a service client to
|
// Instructs the endpoint to be generated for a service client to
|
||||||
// be the dual stack endpoint. The dual stack endpoint will support
|
// be the dual stack endpoint. The dual stack endpoint will support
|
||||||
// both IPv4 and IPv6 addressing.
|
// both IPv4 and IPv6 addressing.
|
||||||
//
|
//
|
||||||
|
@ -336,6 +345,15 @@ func (c *Config) WithS3Disable100Continue(disable bool) *Config {
|
||||||
func (c *Config) WithS3UseAccelerate(enable bool) *Config {
|
func (c *Config) WithS3UseAccelerate(enable bool) *Config {
|
||||||
c.S3UseAccelerate = &enable
|
c.S3UseAccelerate = &enable
|
||||||
return c
|
return c
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// WithS3DisableContentMD5Validation sets a config
|
||||||
|
// S3DisableContentMD5Validation value returning a Config pointer for chaining.
|
||||||
|
func (c *Config) WithS3DisableContentMD5Validation(enable bool) *Config {
|
||||||
|
c.S3DisableContentMD5Validation = &enable
|
||||||
|
return c
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithUseDualStack sets a config UseDualStack value returning a Config
|
// WithUseDualStack sets a config UseDualStack value returning a Config
|
||||||
|
@ -435,6 +453,10 @@ func mergeInConfig(dst *Config, other *Config) {
|
||||||
dst.S3UseAccelerate = other.S3UseAccelerate
|
dst.S3UseAccelerate = other.S3UseAccelerate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if other.S3DisableContentMD5Validation != nil {
|
||||||
|
dst.S3DisableContentMD5Validation = other.S3DisableContentMD5Validation
|
||||||
|
}
|
||||||
|
|
||||||
if other.UseDualStack != nil {
|
if other.UseDualStack != nil {
|
||||||
dst.UseDualStack = other.UseDualStack
|
dst.UseDualStack = other.UseDualStack
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ go_library(
|
||||||
srcs = [
|
srcs = [
|
||||||
"handlers.go",
|
"handlers.go",
|
||||||
"param_validator.go",
|
"param_validator.go",
|
||||||
|
"user_agent.go",
|
||||||
],
|
],
|
||||||
importmap = "k8s.io/kubernetes/vendor/github.com/aws/aws-sdk-go/aws/corehandlers",
|
importmap = "k8s.io/kubernetes/vendor/github.com/aws/aws-sdk-go/aws/corehandlers",
|
||||||
importpath = "github.com/aws/aws-sdk-go/aws/corehandlers",
|
importpath = "github.com/aws/aws-sdk-go/aws/corehandlers",
|
||||||
|
|
|
@ -3,12 +3,10 @@ package corehandlers
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
@ -36,18 +34,13 @@ var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLen
|
||||||
if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" {
|
if slength := r.HTTPRequest.Header.Get("Content-Length"); slength != "" {
|
||||||
length, _ = strconv.ParseInt(slength, 10, 64)
|
length, _ = strconv.ParseInt(slength, 10, 64)
|
||||||
} else {
|
} else {
|
||||||
switch body := r.Body.(type) {
|
if r.Body != nil {
|
||||||
case nil:
|
var err error
|
||||||
length = 0
|
length, err = aws.SeekerLen(r.Body)
|
||||||
case lener:
|
if err != nil {
|
||||||
length = int64(body.Len())
|
r.Error = awserr.New(request.ErrCodeSerialization, "failed to get request body's length", err)
|
||||||
case io.Seeker:
|
return
|
||||||
r.BodyStart, _ = body.Seek(0, 1)
|
}
|
||||||
end, _ := body.Seek(0, 2)
|
|
||||||
body.Seek(r.BodyStart, 0) // make sure to seek back to original location
|
|
||||||
length = end - r.BodyStart
|
|
||||||
default:
|
|
||||||
panic("Cannot get length of body, must provide `ContentLength`")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,13 +53,6 @@ var BuildContentLengthHandler = request.NamedHandler{Name: "core.BuildContentLen
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
// SDKVersionUserAgentHandler is a request handler for adding the SDK Version to the user agent.
|
|
||||||
var SDKVersionUserAgentHandler = request.NamedHandler{
|
|
||||||
Name: "core.SDKVersionUserAgentHandler",
|
|
||||||
Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion,
|
|
||||||
runtime.Version(), runtime.GOOS, runtime.GOARCH),
|
|
||||||
}
|
|
||||||
|
|
||||||
var reStatusCode = regexp.MustCompile(`^(\d{3})`)
|
var reStatusCode = regexp.MustCompile(`^(\d{3})`)
|
||||||
|
|
||||||
// ValidateReqSigHandler is a request handler to ensure that the request's
|
// ValidateReqSigHandler is a request handler to ensure that the request's
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
package corehandlers
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SDKVersionUserAgentHandler is a request handler for adding the SDK Version
|
||||||
|
// to the user agent.
|
||||||
|
var SDKVersionUserAgentHandler = request.NamedHandler{
|
||||||
|
Name: "core.SDKVersionUserAgentHandler",
|
||||||
|
Fn: request.MakeAddToUserAgentHandler(aws.SDKName, aws.SDKVersion,
|
||||||
|
runtime.Version(), runtime.GOOS, runtime.GOARCH),
|
||||||
|
}
|
||||||
|
|
||||||
|
const execEnvVar = `AWS_EXECUTION_ENV`
|
||||||
|
const execEnvUAKey = `exec_env`
|
||||||
|
|
||||||
|
// AddHostExecEnvUserAgentHander is a request handler appending the SDK's
|
||||||
|
// execution environment to the user agent.
|
||||||
|
//
|
||||||
|
// If the environment variable AWS_EXECUTION_ENV is set, its value will be
|
||||||
|
// appended to the user agent string.
|
||||||
|
var AddHostExecEnvUserAgentHander = request.NamedHandler{
|
||||||
|
Name: "core.AddHostExecEnvUserAgentHander",
|
||||||
|
Fn: func(r *request.Request) {
|
||||||
|
v := os.Getenv(execEnvVar)
|
||||||
|
if len(v) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
request.AddToUserAgent(r, execEnvUAKey+"/"+v)
|
||||||
|
},
|
||||||
|
}
|
|
@ -178,7 +178,8 @@ func (e *Expiry) IsExpired() bool {
|
||||||
type Credentials struct {
|
type Credentials struct {
|
||||||
creds Value
|
creds Value
|
||||||
forceRefresh bool
|
forceRefresh bool
|
||||||
m sync.Mutex
|
|
||||||
|
m sync.RWMutex
|
||||||
|
|
||||||
provider Provider
|
provider Provider
|
||||||
}
|
}
|
||||||
|
@ -201,6 +202,17 @@ func NewCredentials(provider Provider) *Credentials {
|
||||||
// If Credentials.Expire() was called the credentials Value will be force
|
// If Credentials.Expire() was called the credentials Value will be force
|
||||||
// expired, and the next call to Get() will cause them to be refreshed.
|
// expired, and the next call to Get() will cause them to be refreshed.
|
||||||
func (c *Credentials) Get() (Value, error) {
|
func (c *Credentials) Get() (Value, error) {
|
||||||
|
// Check the cached credentials first with just the read lock.
|
||||||
|
c.m.RLock()
|
||||||
|
if !c.isExpired() {
|
||||||
|
creds := c.creds
|
||||||
|
c.m.RUnlock()
|
||||||
|
return creds, nil
|
||||||
|
}
|
||||||
|
c.m.RUnlock()
|
||||||
|
|
||||||
|
// Credentials are expired need to retrieve the credentials taking the full
|
||||||
|
// lock.
|
||||||
c.m.Lock()
|
c.m.Lock()
|
||||||
defer c.m.Unlock()
|
defer c.m.Unlock()
|
||||||
|
|
||||||
|
@ -234,8 +246,8 @@ func (c *Credentials) Expire() {
|
||||||
// If the Credentials were forced to be expired with Expire() this will
|
// If the Credentials were forced to be expired with Expire() this will
|
||||||
// reflect that override.
|
// reflect that override.
|
||||||
func (c *Credentials) IsExpired() bool {
|
func (c *Credentials) IsExpired() bool {
|
||||||
c.m.Lock()
|
c.m.RLock()
|
||||||
defer c.m.Unlock()
|
defer c.m.RUnlock()
|
||||||
|
|
||||||
return c.isExpired()
|
return c.isExpired()
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = [
|
||||||
|
"doc.go",
|
||||||
|
"enable.go",
|
||||||
|
"metric.go",
|
||||||
|
"metricChan.go",
|
||||||
|
"reporter.go",
|
||||||
|
],
|
||||||
|
importmap = "k8s.io/kubernetes/vendor/github.com/aws/aws-sdk-go/aws/csm",
|
||||||
|
importpath = "github.com/aws/aws-sdk-go/aws/csm",
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
deps = [
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
||||||
|
],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "package-srcs",
|
||||||
|
srcs = glob(["**"]),
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "all-srcs",
|
||||||
|
srcs = [":package-srcs"],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
|
@ -0,0 +1,46 @@
|
||||||
|
// Package csm provides Client Side Monitoring (CSM) which enables sending metrics
|
||||||
|
// via UDP connection. Using the Start function will enable the reporting of
|
||||||
|
// metrics on a given port. If Start is called, with different parameters, again,
|
||||||
|
// a panic will occur.
|
||||||
|
//
|
||||||
|
// Pause can be called to pause any metrics publishing on a given port. Sessions
|
||||||
|
// that have had their handlers modified via InjectHandlers may still be used.
|
||||||
|
// However, the handlers will act as a no-op meaning no metrics will be published.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
// r, err := csm.Start("clientID", ":31000")
|
||||||
|
// if err != nil {
|
||||||
|
// panic(fmt.Errorf("failed starting CSM: %v", err))
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// sess, err := session.NewSession(&aws.Config{})
|
||||||
|
// if err != nil {
|
||||||
|
// panic(fmt.Errorf("failed loading session: %v", err))
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// r.InjectHandlers(&sess.Handlers)
|
||||||
|
//
|
||||||
|
// client := s3.New(sess)
|
||||||
|
// resp, err := client.GetObject(&s3.GetObjectInput{
|
||||||
|
// Bucket: aws.String("bucket"),
|
||||||
|
// Key: aws.String("key"),
|
||||||
|
// })
|
||||||
|
//
|
||||||
|
// // Will pause monitoring
|
||||||
|
// r.Pause()
|
||||||
|
// resp, err = client.GetObject(&s3.GetObjectInput{
|
||||||
|
// Bucket: aws.String("bucket"),
|
||||||
|
// Key: aws.String("key"),
|
||||||
|
// })
|
||||||
|
//
|
||||||
|
// // Resume monitoring
|
||||||
|
// r.Continue()
|
||||||
|
//
|
||||||
|
// Start returns a Reporter that is used to enable or disable monitoring. If
|
||||||
|
// access to the Reporter is required later, calling Get will return the Reporter
|
||||||
|
// singleton.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
// r := csm.Get()
|
||||||
|
// r.Continue()
|
||||||
|
package csm
|
|
@ -0,0 +1,67 @@
|
||||||
|
package csm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
lock sync.Mutex
|
||||||
|
)
|
||||||
|
|
||||||
|
// Client side metric handler names
|
||||||
|
const (
|
||||||
|
APICallMetricHandlerName = "awscsm.SendAPICallMetric"
|
||||||
|
APICallAttemptMetricHandlerName = "awscsm.SendAPICallAttemptMetric"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Start will start the a long running go routine to capture
|
||||||
|
// client side metrics. Calling start multiple time will only
|
||||||
|
// start the metric listener once and will panic if a different
|
||||||
|
// client ID or port is passed in.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
// r, err := csm.Start("clientID", "127.0.0.1:8094")
|
||||||
|
// if err != nil {
|
||||||
|
// panic(fmt.Errorf("expected no error, but received %v", err))
|
||||||
|
// }
|
||||||
|
// sess := session.NewSession()
|
||||||
|
// r.InjectHandlers(sess.Handlers)
|
||||||
|
//
|
||||||
|
// svc := s3.New(sess)
|
||||||
|
// out, err := svc.GetObject(&s3.GetObjectInput{
|
||||||
|
// Bucket: aws.String("bucket"),
|
||||||
|
// Key: aws.String("key"),
|
||||||
|
// })
|
||||||
|
func Start(clientID string, url string) (*Reporter, error) {
|
||||||
|
lock.Lock()
|
||||||
|
defer lock.Unlock()
|
||||||
|
|
||||||
|
if sender == nil {
|
||||||
|
sender = newReporter(clientID, url)
|
||||||
|
} else {
|
||||||
|
if sender.clientID != clientID {
|
||||||
|
panic(fmt.Errorf("inconsistent client IDs. %q was expected, but received %q", sender.clientID, clientID))
|
||||||
|
}
|
||||||
|
|
||||||
|
if sender.url != url {
|
||||||
|
panic(fmt.Errorf("inconsistent URLs. %q was expected, but received %q", sender.url, url))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := connect(url); err != nil {
|
||||||
|
sender = nil
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return sender, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get will return a reporter if one exists, if one does not exist, nil will
|
||||||
|
// be returned.
|
||||||
|
func Get() *Reporter {
|
||||||
|
lock.Lock()
|
||||||
|
defer lock.Unlock()
|
||||||
|
|
||||||
|
return sender
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package csm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strconv"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
type metricTime time.Time
|
||||||
|
|
||||||
|
func (t metricTime) MarshalJSON() ([]byte, error) {
|
||||||
|
ns := time.Duration(time.Time(t).UnixNano())
|
||||||
|
return []byte(strconv.FormatInt(int64(ns/time.Millisecond), 10)), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type metric struct {
|
||||||
|
ClientID *string `json:"ClientId,omitempty"`
|
||||||
|
API *string `json:"Api,omitempty"`
|
||||||
|
Service *string `json:"Service,omitempty"`
|
||||||
|
Timestamp *metricTime `json:"Timestamp,omitempty"`
|
||||||
|
Type *string `json:"Type,omitempty"`
|
||||||
|
Version *int `json:"Version,omitempty"`
|
||||||
|
|
||||||
|
AttemptCount *int `json:"AttemptCount,omitempty"`
|
||||||
|
Latency *int `json:"Latency,omitempty"`
|
||||||
|
|
||||||
|
Fqdn *string `json:"Fqdn,omitempty"`
|
||||||
|
UserAgent *string `json:"UserAgent,omitempty"`
|
||||||
|
AttemptLatency *int `json:"AttemptLatency,omitempty"`
|
||||||
|
|
||||||
|
SessionToken *string `json:"SessionToken,omitempty"`
|
||||||
|
Region *string `json:"Region,omitempty"`
|
||||||
|
AccessKey *string `json:"AccessKey,omitempty"`
|
||||||
|
HTTPStatusCode *int `json:"HttpStatusCode,omitempty"`
|
||||||
|
XAmzID2 *string `json:"XAmzId2,omitempty"`
|
||||||
|
XAmzRequestID *string `json:"XAmznRequestId,omitempty"`
|
||||||
|
|
||||||
|
AWSException *string `json:"AwsException,omitempty"`
|
||||||
|
AWSExceptionMessage *string `json:"AwsExceptionMessage,omitempty"`
|
||||||
|
SDKException *string `json:"SdkException,omitempty"`
|
||||||
|
SDKExceptionMessage *string `json:"SdkExceptionMessage,omitempty"`
|
||||||
|
|
||||||
|
DestinationIP *string `json:"DestinationIp,omitempty"`
|
||||||
|
ConnectionReused *int `json:"ConnectionReused,omitempty"`
|
||||||
|
|
||||||
|
AcquireConnectionLatency *int `json:"AcquireConnectionLatency,omitempty"`
|
||||||
|
ConnectLatency *int `json:"ConnectLatency,omitempty"`
|
||||||
|
RequestLatency *int `json:"RequestLatency,omitempty"`
|
||||||
|
DNSLatency *int `json:"DnsLatency,omitempty"`
|
||||||
|
TCPLatency *int `json:"TcpLatency,omitempty"`
|
||||||
|
SSLLatency *int `json:"SslLatency,omitempty"`
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package csm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"sync/atomic"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
runningEnum = iota
|
||||||
|
pausedEnum
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
// MetricsChannelSize of metrics to hold in the channel
|
||||||
|
MetricsChannelSize = 100
|
||||||
|
)
|
||||||
|
|
||||||
|
type metricChan struct {
|
||||||
|
ch chan metric
|
||||||
|
paused int64
|
||||||
|
}
|
||||||
|
|
||||||
|
func newMetricChan(size int) metricChan {
|
||||||
|
return metricChan{
|
||||||
|
ch: make(chan metric, size),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ch *metricChan) Pause() {
|
||||||
|
atomic.StoreInt64(&ch.paused, pausedEnum)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ch *metricChan) Continue() {
|
||||||
|
atomic.StoreInt64(&ch.paused, runningEnum)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (ch *metricChan) IsPaused() bool {
|
||||||
|
v := atomic.LoadInt64(&ch.paused)
|
||||||
|
return v == pausedEnum
|
||||||
|
}
|
||||||
|
|
||||||
|
// Push will push metrics to the metric channel if the channel
|
||||||
|
// is not paused
|
||||||
|
func (ch *metricChan) Push(m metric) bool {
|
||||||
|
if ch.IsPaused() {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
select {
|
||||||
|
case ch.ch <- m:
|
||||||
|
return true
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,230 @@
|
||||||
|
package csm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"net"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
|
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||||
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// DefaultPort is used when no port is specified
|
||||||
|
DefaultPort = "31000"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Reporter will gather metrics of API requests made and
|
||||||
|
// send those metrics to the CSM endpoint.
|
||||||
|
type Reporter struct {
|
||||||
|
clientID string
|
||||||
|
url string
|
||||||
|
conn net.Conn
|
||||||
|
metricsCh metricChan
|
||||||
|
done chan struct{}
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
sender *Reporter
|
||||||
|
)
|
||||||
|
|
||||||
|
func connect(url string) error {
|
||||||
|
const network = "udp"
|
||||||
|
if err := sender.connect(network, url); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if sender.done == nil {
|
||||||
|
sender.done = make(chan struct{})
|
||||||
|
go sender.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func newReporter(clientID, url string) *Reporter {
|
||||||
|
return &Reporter{
|
||||||
|
clientID: clientID,
|
||||||
|
url: url,
|
||||||
|
metricsCh: newMetricChan(MetricsChannelSize),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rep *Reporter) sendAPICallAttemptMetric(r *request.Request) {
|
||||||
|
if rep == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
now := time.Now()
|
||||||
|
creds, _ := r.Config.Credentials.Get()
|
||||||
|
|
||||||
|
m := metric{
|
||||||
|
ClientID: aws.String(rep.clientID),
|
||||||
|
API: aws.String(r.Operation.Name),
|
||||||
|
Service: aws.String(r.ClientInfo.ServiceID),
|
||||||
|
Timestamp: (*metricTime)(&now),
|
||||||
|
UserAgent: aws.String(r.HTTPRequest.Header.Get("User-Agent")),
|
||||||
|
Region: r.Config.Region,
|
||||||
|
Type: aws.String("ApiCallAttempt"),
|
||||||
|
Version: aws.Int(1),
|
||||||
|
|
||||||
|
XAmzRequestID: aws.String(r.RequestID),
|
||||||
|
|
||||||
|
AttemptCount: aws.Int(r.RetryCount + 1),
|
||||||
|
AttemptLatency: aws.Int(int(now.Sub(r.AttemptTime).Nanoseconds() / int64(time.Millisecond))),
|
||||||
|
AccessKey: aws.String(creds.AccessKeyID),
|
||||||
|
}
|
||||||
|
|
||||||
|
if r.HTTPResponse != nil {
|
||||||
|
m.HTTPStatusCode = aws.Int(r.HTTPResponse.StatusCode)
|
||||||
|
}
|
||||||
|
|
||||||
|
if r.Error != nil {
|
||||||
|
if awserr, ok := r.Error.(awserr.Error); ok {
|
||||||
|
setError(&m, awserr)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rep.metricsCh.Push(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func setError(m *metric, err awserr.Error) {
|
||||||
|
msg := err.Message()
|
||||||
|
code := err.Code()
|
||||||
|
|
||||||
|
switch code {
|
||||||
|
case "RequestError",
|
||||||
|
"SerializationError",
|
||||||
|
request.CanceledErrorCode:
|
||||||
|
|
||||||
|
m.SDKException = &code
|
||||||
|
m.SDKExceptionMessage = &msg
|
||||||
|
default:
|
||||||
|
m.AWSException = &code
|
||||||
|
m.AWSExceptionMessage = &msg
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rep *Reporter) sendAPICallMetric(r *request.Request) {
|
||||||
|
if rep == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
now := time.Now()
|
||||||
|
m := metric{
|
||||||
|
ClientID: aws.String(rep.clientID),
|
||||||
|
API: aws.String(r.Operation.Name),
|
||||||
|
Service: aws.String(r.ClientInfo.ServiceID),
|
||||||
|
Timestamp: (*metricTime)(&now),
|
||||||
|
Type: aws.String("ApiCall"),
|
||||||
|
AttemptCount: aws.Int(r.RetryCount + 1),
|
||||||
|
Latency: aws.Int(int(time.Now().Sub(r.Time) / time.Millisecond)),
|
||||||
|
XAmzRequestID: aws.String(r.RequestID),
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Probably want to figure something out for logging dropped
|
||||||
|
// metrics
|
||||||
|
rep.metricsCh.Push(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rep *Reporter) connect(network, url string) error {
|
||||||
|
if rep.conn != nil {
|
||||||
|
rep.conn.Close()
|
||||||
|
}
|
||||||
|
|
||||||
|
conn, err := net.Dial(network, url)
|
||||||
|
if err != nil {
|
||||||
|
return awserr.New("UDPError", "Could not connect", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
rep.conn = conn
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rep *Reporter) close() {
|
||||||
|
if rep.done != nil {
|
||||||
|
close(rep.done)
|
||||||
|
}
|
||||||
|
|
||||||
|
rep.metricsCh.Pause()
|
||||||
|
}
|
||||||
|
|
||||||
|
func (rep *Reporter) start() {
|
||||||
|
defer func() {
|
||||||
|
rep.metricsCh.Pause()
|
||||||
|
}()
|
||||||
|
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case <-rep.done:
|
||||||
|
rep.done = nil
|
||||||
|
return
|
||||||
|
case m := <-rep.metricsCh.ch:
|
||||||
|
// TODO: What to do with this error? Probably should just log
|
||||||
|
b, err := json.Marshal(m)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
rep.conn.Write(b)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Pause will pause the metric channel preventing any new metrics from
|
||||||
|
// being added.
|
||||||
|
func (rep *Reporter) Pause() {
|
||||||
|
lock.Lock()
|
||||||
|
defer lock.Unlock()
|
||||||
|
|
||||||
|
if rep == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
rep.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Continue will reopen the metric channel and allow for monitoring
|
||||||
|
// to be resumed.
|
||||||
|
func (rep *Reporter) Continue() {
|
||||||
|
lock.Lock()
|
||||||
|
defer lock.Unlock()
|
||||||
|
if rep == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if !rep.metricsCh.IsPaused() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
rep.metricsCh.Continue()
|
||||||
|
}
|
||||||
|
|
||||||
|
// InjectHandlers will will enable client side metrics and inject the proper
|
||||||
|
// handlers to handle how metrics are sent.
|
||||||
|
//
|
||||||
|
// Example:
|
||||||
|
// // Start must be called in order to inject the correct handlers
|
||||||
|
// r, err := csm.Start("clientID", "127.0.0.1:8094")
|
||||||
|
// if err != nil {
|
||||||
|
// panic(fmt.Errorf("expected no error, but received %v", err))
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// sess := session.NewSession()
|
||||||
|
// r.InjectHandlers(&sess.Handlers)
|
||||||
|
//
|
||||||
|
// // create a new service client with our client side metric session
|
||||||
|
// svc := s3.New(sess)
|
||||||
|
func (rep *Reporter) InjectHandlers(handlers *request.Handlers) {
|
||||||
|
if rep == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
apiCallHandler := request.NamedHandler{Name: APICallMetricHandlerName, Fn: rep.sendAPICallMetric}
|
||||||
|
handlers.Complete.PushFrontNamed(apiCallHandler)
|
||||||
|
|
||||||
|
apiCallAttemptHandler := request.NamedHandler{Name: APICallAttemptMetricHandlerName, Fn: rep.sendAPICallAttemptMetric}
|
||||||
|
handlers.AfterRetry.PushFrontNamed(apiCallAttemptHandler)
|
||||||
|
}
|
|
@ -9,6 +9,7 @@ package defaults
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
|
@ -72,6 +73,7 @@ func Handlers() request.Handlers {
|
||||||
handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
|
handlers.Validate.PushBackNamed(corehandlers.ValidateEndpointHandler)
|
||||||
handlers.Validate.AfterEachFn = request.HandlerListStopOnError
|
handlers.Validate.AfterEachFn = request.HandlerListStopOnError
|
||||||
handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler)
|
handlers.Build.PushBackNamed(corehandlers.SDKVersionUserAgentHandler)
|
||||||
|
handlers.Build.PushBackNamed(corehandlers.AddHostExecEnvUserAgentHander)
|
||||||
handlers.Build.AfterEachFn = request.HandlerListStopOnError
|
handlers.Build.AfterEachFn = request.HandlerListStopOnError
|
||||||
handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)
|
handlers.Sign.PushBackNamed(corehandlers.BuildContentLengthHandler)
|
||||||
handlers.Send.PushBackNamed(corehandlers.ValidateReqSigHandler)
|
handlers.Send.PushBackNamed(corehandlers.ValidateReqSigHandler)
|
||||||
|
@ -118,14 +120,43 @@ func RemoteCredProvider(cfg aws.Config, handlers request.Handlers) credentials.P
|
||||||
return ec2RoleProvider(cfg, handlers)
|
return ec2RoleProvider(cfg, handlers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var lookupHostFn = net.LookupHost
|
||||||
|
|
||||||
|
func isLoopbackHost(host string) (bool, error) {
|
||||||
|
ip := net.ParseIP(host)
|
||||||
|
if ip != nil {
|
||||||
|
return ip.IsLoopback(), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Host is not an ip, perform lookup
|
||||||
|
addrs, err := lookupHostFn(host)
|
||||||
|
if err != nil {
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
for _, addr := range addrs {
|
||||||
|
if !net.ParseIP(addr).IsLoopback() {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
|
||||||
func localHTTPCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider {
|
func localHTTPCredProvider(cfg aws.Config, handlers request.Handlers, u string) credentials.Provider {
|
||||||
var errMsg string
|
var errMsg string
|
||||||
|
|
||||||
parsed, err := url.Parse(u)
|
parsed, err := url.Parse(u)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errMsg = fmt.Sprintf("invalid URL, %v", err)
|
errMsg = fmt.Sprintf("invalid URL, %v", err)
|
||||||
} else if host := aws.URLHostname(parsed); !(host == "localhost" || host == "127.0.0.1") {
|
} else {
|
||||||
errMsg = fmt.Sprintf("invalid host address, %q, only localhost and 127.0.0.1 are valid.", host)
|
host := aws.URLHostname(parsed)
|
||||||
|
if len(host) == 0 {
|
||||||
|
errMsg = "unable to parse host from local HTTP cred provider URL"
|
||||||
|
} else if isLoopback, loopbackErr := isLoopbackHost(host); loopbackErr != nil {
|
||||||
|
errMsg = fmt.Sprintf("failed to resolve host %q, %v", host, loopbackErr)
|
||||||
|
} else if !isLoopback {
|
||||||
|
errMsg = fmt.Sprintf("invalid endpoint host, %q, only loopback hosts are allowed.", host)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(errMsg) > 0 {
|
if len(errMsg) > 0 {
|
||||||
|
|
|
@ -14,6 +14,7 @@ go_library(
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/client:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/aws/corehandlers:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
// Package ec2metadata provides the client for making API calls to the
|
// Package ec2metadata provides the client for making API calls to the
|
||||||
// EC2 Metadata service.
|
// EC2 Metadata service.
|
||||||
|
//
|
||||||
|
// This package's client can be disabled completely by setting the environment
|
||||||
|
// variable "AWS_EC2_METADATA_DISABLED=true". This environment variable set to
|
||||||
|
// true instructs the SDK to disable the EC2 Metadata client. The client cannot
|
||||||
|
// be used while the environemnt variable is set to true, (case insensitive).
|
||||||
package ec2metadata
|
package ec2metadata
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -7,17 +12,21 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||||
"github.com/aws/aws-sdk-go/aws/client"
|
"github.com/aws/aws-sdk-go/aws/client"
|
||||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||||
|
"github.com/aws/aws-sdk-go/aws/corehandlers"
|
||||||
"github.com/aws/aws-sdk-go/aws/request"
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ServiceName is the name of the service.
|
// ServiceName is the name of the service.
|
||||||
const ServiceName = "ec2metadata"
|
const ServiceName = "ec2metadata"
|
||||||
|
const disableServiceEnvVar = "AWS_EC2_METADATA_DISABLED"
|
||||||
|
|
||||||
// A EC2Metadata is an EC2 Metadata service Client.
|
// A EC2Metadata is an EC2 Metadata service Client.
|
||||||
type EC2Metadata struct {
|
type EC2Metadata struct {
|
||||||
|
@ -75,6 +84,21 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
|
||||||
svc.Handlers.Validate.Clear()
|
svc.Handlers.Validate.Clear()
|
||||||
svc.Handlers.Validate.PushBack(validateEndpointHandler)
|
svc.Handlers.Validate.PushBack(validateEndpointHandler)
|
||||||
|
|
||||||
|
// Disable the EC2 Metadata service if the environment variable is set.
|
||||||
|
// This shortcirctes the service's functionality to always fail to send
|
||||||
|
// requests.
|
||||||
|
if strings.ToLower(os.Getenv(disableServiceEnvVar)) == "true" {
|
||||||
|
svc.Handlers.Send.SwapNamed(request.NamedHandler{
|
||||||
|
Name: corehandlers.SendHandler.Name,
|
||||||
|
Fn: func(r *request.Request) {
|
||||||
|
r.Error = awserr.New(
|
||||||
|
request.CanceledErrorCode,
|
||||||
|
"EC2 IMDS access disabled via "+disableServiceEnvVar+" env var",
|
||||||
|
nil)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Add additional options to the service config
|
// Add additional options to the service config
|
||||||
for _, option := range opts {
|
for _, option := range opts {
|
||||||
option(svc.Client)
|
option(svc.Client)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -206,10 +206,11 @@ func (p Partition) EndpointFor(service, region string, opts ...func(*Options)) (
|
||||||
// enumerating over the regions in a partition.
|
// enumerating over the regions in a partition.
|
||||||
func (p Partition) Regions() map[string]Region {
|
func (p Partition) Regions() map[string]Region {
|
||||||
rs := map[string]Region{}
|
rs := map[string]Region{}
|
||||||
for id := range p.p.Regions {
|
for id, r := range p.p.Regions {
|
||||||
rs[id] = Region{
|
rs[id] = Region{
|
||||||
id: id,
|
id: id,
|
||||||
p: p.p,
|
desc: r.Description,
|
||||||
|
p: p.p,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,6 +241,10 @@ type Region struct {
|
||||||
// ID returns the region's identifier.
|
// ID returns the region's identifier.
|
||||||
func (r Region) ID() string { return r.id }
|
func (r Region) ID() string { return r.id }
|
||||||
|
|
||||||
|
// Description returns the region's description. The region description
|
||||||
|
// is free text, it can be empty, and it may change between SDK releases.
|
||||||
|
func (r Region) Description() string { return r.desc }
|
||||||
|
|
||||||
// ResolveEndpoint resolves an endpoint from the context of the region given
|
// ResolveEndpoint resolves an endpoint from the context of the region given
|
||||||
// a service. See Partition.EndpointFor for usage and errors that can be returned.
|
// a service. See Partition.EndpointFor for usage and errors that can be returned.
|
||||||
func (r Region) ResolveEndpoint(service string, opts ...func(*Options)) (ResolvedEndpoint, error) {
|
func (r Region) ResolveEndpoint(service string, opts ...func(*Options)) (ResolvedEndpoint, error) {
|
||||||
|
@ -284,10 +289,11 @@ func (s Service) ResolveEndpoint(region string, opts ...func(*Options)) (Resolve
|
||||||
func (s Service) Regions() map[string]Region {
|
func (s Service) Regions() map[string]Region {
|
||||||
rs := map[string]Region{}
|
rs := map[string]Region{}
|
||||||
for id := range s.p.Services[s.id].Endpoints {
|
for id := range s.p.Services[s.id].Endpoints {
|
||||||
if _, ok := s.p.Regions[id]; ok {
|
if r, ok := s.p.Regions[id]; ok {
|
||||||
rs[id] = Region{
|
rs[id] = Region{
|
||||||
id: id,
|
id: id,
|
||||||
p: s.p,
|
desc: r.Description,
|
||||||
|
p: s.p,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -347,6 +353,10 @@ type ResolvedEndpoint struct {
|
||||||
// The service name that should be used for signing requests.
|
// The service name that should be used for signing requests.
|
||||||
SigningName string
|
SigningName string
|
||||||
|
|
||||||
|
// States that the signing name for this endpoint was derived from metadata
|
||||||
|
// passed in, but was not explicitly modeled.
|
||||||
|
SigningNameDerived bool
|
||||||
|
|
||||||
// The signing method that should be used for signing requests.
|
// The signing method that should be used for signing requests.
|
||||||
SigningMethod string
|
SigningMethod string
|
||||||
}
|
}
|
||||||
|
|
|
@ -226,16 +226,20 @@ func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, op
|
||||||
if len(signingRegion) == 0 {
|
if len(signingRegion) == 0 {
|
||||||
signingRegion = region
|
signingRegion = region
|
||||||
}
|
}
|
||||||
|
|
||||||
signingName := e.CredentialScope.Service
|
signingName := e.CredentialScope.Service
|
||||||
|
var signingNameDerived bool
|
||||||
if len(signingName) == 0 {
|
if len(signingName) == 0 {
|
||||||
signingName = service
|
signingName = service
|
||||||
|
signingNameDerived = true
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResolvedEndpoint{
|
return ResolvedEndpoint{
|
||||||
URL: u,
|
URL: u,
|
||||||
SigningRegion: signingRegion,
|
SigningRegion: signingRegion,
|
||||||
SigningName: signingName,
|
SigningName: signingName,
|
||||||
SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner),
|
SigningNameDerived: signingNameDerived,
|
||||||
|
SigningMethod: getByPriority(e.SignatureVersions, signerPriority, defaultSigner),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,12 @@ const (
|
||||||
// LogDebugWithRequestErrors states the SDK should log when service requests fail
|
// LogDebugWithRequestErrors states the SDK should log when service requests fail
|
||||||
// to build, send, validate, or unmarshal.
|
// to build, send, validate, or unmarshal.
|
||||||
LogDebugWithRequestErrors
|
LogDebugWithRequestErrors
|
||||||
|
|
||||||
|
// LogDebugWithEventStreamBody states the SDK should log EventStream
|
||||||
|
// request and response bodys. This should be used to log the EventStream
|
||||||
|
// wire unmarshaled message content of requests and responses made while
|
||||||
|
// using the SDK Will also enable LogDebug.
|
||||||
|
LogDebugWithEventStreamBody
|
||||||
)
|
)
|
||||||
|
|
||||||
// A Logger is a minimalistic interface for the SDK to log messages to. Should
|
// A Logger is a minimalistic interface for the SDK to log messages to. Should
|
||||||
|
|
|
@ -27,6 +27,7 @@ go_library(
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/awsutil:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/internal/sdkio:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ type Handlers struct {
|
||||||
Send HandlerList
|
Send HandlerList
|
||||||
ValidateResponse HandlerList
|
ValidateResponse HandlerList
|
||||||
Unmarshal HandlerList
|
Unmarshal HandlerList
|
||||||
|
UnmarshalStream HandlerList
|
||||||
UnmarshalMeta HandlerList
|
UnmarshalMeta HandlerList
|
||||||
UnmarshalError HandlerList
|
UnmarshalError HandlerList
|
||||||
Retry HandlerList
|
Retry HandlerList
|
||||||
|
@ -30,6 +31,7 @@ func (h *Handlers) Copy() Handlers {
|
||||||
Send: h.Send.copy(),
|
Send: h.Send.copy(),
|
||||||
ValidateResponse: h.ValidateResponse.copy(),
|
ValidateResponse: h.ValidateResponse.copy(),
|
||||||
Unmarshal: h.Unmarshal.copy(),
|
Unmarshal: h.Unmarshal.copy(),
|
||||||
|
UnmarshalStream: h.UnmarshalStream.copy(),
|
||||||
UnmarshalError: h.UnmarshalError.copy(),
|
UnmarshalError: h.UnmarshalError.copy(),
|
||||||
UnmarshalMeta: h.UnmarshalMeta.copy(),
|
UnmarshalMeta: h.UnmarshalMeta.copy(),
|
||||||
Retry: h.Retry.copy(),
|
Retry: h.Retry.copy(),
|
||||||
|
@ -45,6 +47,7 @@ func (h *Handlers) Clear() {
|
||||||
h.Send.Clear()
|
h.Send.Clear()
|
||||||
h.Sign.Clear()
|
h.Sign.Clear()
|
||||||
h.Unmarshal.Clear()
|
h.Unmarshal.Clear()
|
||||||
|
h.UnmarshalStream.Clear()
|
||||||
h.UnmarshalMeta.Clear()
|
h.UnmarshalMeta.Clear()
|
||||||
h.UnmarshalError.Clear()
|
h.UnmarshalError.Clear()
|
||||||
h.ValidateResponse.Clear()
|
h.ValidateResponse.Clear()
|
||||||
|
@ -172,6 +175,21 @@ func (l *HandlerList) SwapNamed(n NamedHandler) (swapped bool) {
|
||||||
return swapped
|
return swapped
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Swap will swap out all handlers matching the name passed in. The matched
|
||||||
|
// handlers will be swapped in. True is returned if the handlers were swapped.
|
||||||
|
func (l *HandlerList) Swap(name string, replace NamedHandler) bool {
|
||||||
|
var swapped bool
|
||||||
|
|
||||||
|
for i := 0; i < len(l.list); i++ {
|
||||||
|
if l.list[i].Name == name {
|
||||||
|
l.list[i] = replace
|
||||||
|
swapped = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return swapped
|
||||||
|
}
|
||||||
|
|
||||||
// SetBackNamed will replace the named handler if it exists in the handler list.
|
// SetBackNamed will replace the named handler if it exists in the handler list.
|
||||||
// If the handler does not exist the handler will be added to the end of the list.
|
// If the handler does not exist the handler will be added to the end of the list.
|
||||||
func (l *HandlerList) SetBackNamed(n NamedHandler) {
|
func (l *HandlerList) SetBackNamed(n NamedHandler) {
|
||||||
|
|
|
@ -3,6 +3,8 @@ package request
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/aws/aws-sdk-go/internal/sdkio"
|
||||||
)
|
)
|
||||||
|
|
||||||
// offsetReader is a thread-safe io.ReadCloser to prevent racing
|
// offsetReader is a thread-safe io.ReadCloser to prevent racing
|
||||||
|
@ -15,7 +17,7 @@ type offsetReader struct {
|
||||||
|
|
||||||
func newOffsetReader(buf io.ReadSeeker, offset int64) *offsetReader {
|
func newOffsetReader(buf io.ReadSeeker, offset int64) *offsetReader {
|
||||||
reader := &offsetReader{}
|
reader := &offsetReader{}
|
||||||
buf.Seek(offset, 0)
|
buf.Seek(offset, sdkio.SeekStart)
|
||||||
|
|
||||||
reader.buf = buf
|
reader.buf = buf
|
||||||
return reader
|
return reader
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||||
|
"github.com/aws/aws-sdk-go/internal/sdkio"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -28,6 +29,10 @@ const (
|
||||||
// during body reads.
|
// during body reads.
|
||||||
ErrCodeResponseTimeout = "ResponseTimeout"
|
ErrCodeResponseTimeout = "ResponseTimeout"
|
||||||
|
|
||||||
|
// ErrCodeInvalidPresignExpire is returned when the expire time provided to
|
||||||
|
// presign is invalid
|
||||||
|
ErrCodeInvalidPresignExpire = "InvalidPresignExpireError"
|
||||||
|
|
||||||
// CanceledErrorCode is the error code that will be returned by an
|
// CanceledErrorCode is the error code that will be returned by an
|
||||||
// API request that was canceled. Requests given a aws.Context may
|
// API request that was canceled. Requests given a aws.Context may
|
||||||
// return this error when canceled.
|
// return this error when canceled.
|
||||||
|
@ -41,8 +46,8 @@ type Request struct {
|
||||||
Handlers Handlers
|
Handlers Handlers
|
||||||
|
|
||||||
Retryer
|
Retryer
|
||||||
|
AttemptTime time.Time
|
||||||
Time time.Time
|
Time time.Time
|
||||||
ExpireTime time.Duration
|
|
||||||
Operation *Operation
|
Operation *Operation
|
||||||
HTTPRequest *http.Request
|
HTTPRequest *http.Request
|
||||||
HTTPResponse *http.Response
|
HTTPResponse *http.Response
|
||||||
|
@ -60,6 +65,11 @@ type Request struct {
|
||||||
LastSignedAt time.Time
|
LastSignedAt time.Time
|
||||||
DisableFollowRedirects bool
|
DisableFollowRedirects bool
|
||||||
|
|
||||||
|
// A value greater than 0 instructs the request to be signed as Presigned URL
|
||||||
|
// You should not set this field directly. Instead use Request's
|
||||||
|
// Presign or PresignRequest methods.
|
||||||
|
ExpireTime time.Duration
|
||||||
|
|
||||||
context aws.Context
|
context aws.Context
|
||||||
|
|
||||||
built bool
|
built bool
|
||||||
|
@ -104,12 +114,15 @@ func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers,
|
||||||
err = awserr.New("InvalidEndpointURL", "invalid endpoint uri", err)
|
err = awserr.New("InvalidEndpointURL", "invalid endpoint uri", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SanitizeHostForHeader(httpReq)
|
||||||
|
|
||||||
r := &Request{
|
r := &Request{
|
||||||
Config: cfg,
|
Config: cfg,
|
||||||
ClientInfo: clientInfo,
|
ClientInfo: clientInfo,
|
||||||
Handlers: handlers.Copy(),
|
Handlers: handlers.Copy(),
|
||||||
|
|
||||||
Retryer: retryer,
|
Retryer: retryer,
|
||||||
|
AttemptTime: time.Now(),
|
||||||
Time: time.Now(),
|
Time: time.Now(),
|
||||||
ExpireTime: 0,
|
ExpireTime: 0,
|
||||||
Operation: operation,
|
Operation: operation,
|
||||||
|
@ -214,6 +227,9 @@ func (r *Request) SetContext(ctx aws.Context) {
|
||||||
|
|
||||||
// WillRetry returns if the request's can be retried.
|
// WillRetry returns if the request's can be retried.
|
||||||
func (r *Request) WillRetry() bool {
|
func (r *Request) WillRetry() bool {
|
||||||
|
if !aws.IsReaderSeekable(r.Body) && r.HTTPRequest.Body != NoBody {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries()
|
return r.Error != nil && aws.BoolValue(r.Retryable) && r.RetryCount < r.MaxRetries()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,45 +261,70 @@ func (r *Request) SetStringBody(s string) {
|
||||||
// SetReaderBody will set the request's body reader.
|
// SetReaderBody will set the request's body reader.
|
||||||
func (r *Request) SetReaderBody(reader io.ReadSeeker) {
|
func (r *Request) SetReaderBody(reader io.ReadSeeker) {
|
||||||
r.Body = reader
|
r.Body = reader
|
||||||
|
r.BodyStart, _ = reader.Seek(0, sdkio.SeekCurrent) // Get the Bodies current offset.
|
||||||
r.ResetBody()
|
r.ResetBody()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Presign returns the request's signed URL. Error will be returned
|
// Presign returns the request's signed URL. Error will be returned
|
||||||
// if the signing fails.
|
// if the signing fails.
|
||||||
func (r *Request) Presign(expireTime time.Duration) (string, error) {
|
//
|
||||||
r.ExpireTime = expireTime
|
// It is invalid to create a presigned URL with a expire duration 0 or less. An
|
||||||
|
// error is returned if expire duration is 0 or less.
|
||||||
|
func (r *Request) Presign(expire time.Duration) (string, error) {
|
||||||
|
r = r.copy()
|
||||||
|
|
||||||
|
// Presign requires all headers be hoisted. There is no way to retrieve
|
||||||
|
// the signed headers not hoisted without this. Making the presigned URL
|
||||||
|
// useless.
|
||||||
r.NotHoist = false
|
r.NotHoist = false
|
||||||
|
|
||||||
if r.Operation.BeforePresignFn != nil {
|
u, _, err := getPresignedURL(r, expire)
|
||||||
r = r.copy()
|
return u, err
|
||||||
err := r.Operation.BeforePresignFn(r)
|
|
||||||
if err != nil {
|
|
||||||
return "", err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
r.Sign()
|
|
||||||
if r.Error != nil {
|
|
||||||
return "", r.Error
|
|
||||||
}
|
|
||||||
return r.HTTPRequest.URL.String(), nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// PresignRequest behaves just like presign, with the addition of returning a
|
// PresignRequest behaves just like presign, with the addition of returning a
|
||||||
// set of headers that were signed.
|
// set of headers that were signed.
|
||||||
//
|
//
|
||||||
|
// It is invalid to create a presigned URL with a expire duration 0 or less. An
|
||||||
|
// error is returned if expire duration is 0 or less.
|
||||||
|
//
|
||||||
// Returns the URL string for the API operation with signature in the query string,
|
// Returns the URL string for the API operation with signature in the query string,
|
||||||
// and the HTTP headers that were included in the signature. These headers must
|
// and the HTTP headers that were included in the signature. These headers must
|
||||||
// be included in any HTTP request made with the presigned URL.
|
// be included in any HTTP request made with the presigned URL.
|
||||||
//
|
//
|
||||||
// To prevent hoisting any headers to the query string set NotHoist to true on
|
// To prevent hoisting any headers to the query string set NotHoist to true on
|
||||||
// this Request value prior to calling PresignRequest.
|
// this Request value prior to calling PresignRequest.
|
||||||
func (r *Request) PresignRequest(expireTime time.Duration) (string, http.Header, error) {
|
func (r *Request) PresignRequest(expire time.Duration) (string, http.Header, error) {
|
||||||
r.ExpireTime = expireTime
|
r = r.copy()
|
||||||
r.Sign()
|
return getPresignedURL(r, expire)
|
||||||
if r.Error != nil {
|
}
|
||||||
return "", nil, r.Error
|
|
||||||
|
// IsPresigned returns true if the request represents a presigned API url.
|
||||||
|
func (r *Request) IsPresigned() bool {
|
||||||
|
return r.ExpireTime != 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func getPresignedURL(r *Request, expire time.Duration) (string, http.Header, error) {
|
||||||
|
if expire <= 0 {
|
||||||
|
return "", nil, awserr.New(
|
||||||
|
ErrCodeInvalidPresignExpire,
|
||||||
|
"presigned URL requires an expire duration greater than 0",
|
||||||
|
nil,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r.ExpireTime = expire
|
||||||
|
|
||||||
|
if r.Operation.BeforePresignFn != nil {
|
||||||
|
if err := r.Operation.BeforePresignFn(r); err != nil {
|
||||||
|
return "", nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := r.Sign(); err != nil {
|
||||||
|
return "", nil, err
|
||||||
|
}
|
||||||
|
|
||||||
return r.HTTPRequest.URL.String(), r.SignedHeaderVals, nil
|
return r.HTTPRequest.URL.String(), r.SignedHeaderVals, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -303,7 +344,7 @@ func debugLogReqError(r *Request, stage string, retrying bool, err error) {
|
||||||
|
|
||||||
// Build will build the request's object so it can be signed and sent
|
// Build will build the request's object so it can be signed and sent
|
||||||
// to the service. Build will also validate all the request's parameters.
|
// to the service. Build will also validate all the request's parameters.
|
||||||
// Anny additional build Handlers set on this request will be run
|
// Any additional build Handlers set on this request will be run
|
||||||
// in the order they were set.
|
// in the order they were set.
|
||||||
//
|
//
|
||||||
// The request will only be built once. Multiple calls to build will have
|
// The request will only be built once. Multiple calls to build will have
|
||||||
|
@ -329,9 +370,9 @@ func (r *Request) Build() error {
|
||||||
return r.Error
|
return r.Error
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sign will sign the request returning error if errors are encountered.
|
// Sign will sign the request, returning error if errors are encountered.
|
||||||
//
|
//
|
||||||
// Send will build the request prior to signing. All Sign Handlers will
|
// Sign will build the request prior to signing. All Sign Handlers will
|
||||||
// be executed in the order they were set.
|
// be executed in the order they were set.
|
||||||
func (r *Request) Sign() error {
|
func (r *Request) Sign() error {
|
||||||
r.Build()
|
r.Build()
|
||||||
|
@ -364,7 +405,7 @@ func (r *Request) getNextRequestBody() (io.ReadCloser, error) {
|
||||||
// of the SDK if they used that field.
|
// of the SDK if they used that field.
|
||||||
//
|
//
|
||||||
// Related golang/go#18257
|
// Related golang/go#18257
|
||||||
l, err := computeBodyLength(r.Body)
|
l, err := aws.SeekerLen(r.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, awserr.New(ErrCodeSerialization, "failed to compute request body size", err)
|
return nil, awserr.New(ErrCodeSerialization, "failed to compute request body size", err)
|
||||||
}
|
}
|
||||||
|
@ -382,7 +423,8 @@ func (r *Request) getNextRequestBody() (io.ReadCloser, error) {
|
||||||
// Transfer-Encoding: chunked bodies for these methods.
|
// Transfer-Encoding: chunked bodies for these methods.
|
||||||
//
|
//
|
||||||
// This would only happen if a aws.ReaderSeekerCloser was used with
|
// This would only happen if a aws.ReaderSeekerCloser was used with
|
||||||
// a io.Reader that was not also an io.Seeker.
|
// a io.Reader that was not also an io.Seeker, or did not implement
|
||||||
|
// Len() method.
|
||||||
switch r.Operation.HTTPMethod {
|
switch r.Operation.HTTPMethod {
|
||||||
case "GET", "HEAD", "DELETE":
|
case "GET", "HEAD", "DELETE":
|
||||||
body = NoBody
|
body = NoBody
|
||||||
|
@ -394,49 +436,13 @@ func (r *Request) getNextRequestBody() (io.ReadCloser, error) {
|
||||||
return body, nil
|
return body, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attempts to compute the length of the body of the reader using the
|
|
||||||
// io.Seeker interface. If the value is not seekable because of being
|
|
||||||
// a ReaderSeekerCloser without an unerlying Seeker -1 will be returned.
|
|
||||||
// If no error occurs the length of the body will be returned.
|
|
||||||
func computeBodyLength(r io.ReadSeeker) (int64, error) {
|
|
||||||
seekable := true
|
|
||||||
// Determine if the seeker is actually seekable. ReaderSeekerCloser
|
|
||||||
// hides the fact that a io.Readers might not actually be seekable.
|
|
||||||
switch v := r.(type) {
|
|
||||||
case aws.ReaderSeekerCloser:
|
|
||||||
seekable = v.IsSeeker()
|
|
||||||
case *aws.ReaderSeekerCloser:
|
|
||||||
seekable = v.IsSeeker()
|
|
||||||
}
|
|
||||||
if !seekable {
|
|
||||||
return -1, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
curOffset, err := r.Seek(0, 1)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
endOffset, err := r.Seek(0, 2)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
_, err = r.Seek(curOffset, 0)
|
|
||||||
if err != nil {
|
|
||||||
return 0, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return endOffset - curOffset, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBody will return an io.ReadSeeker of the Request's underlying
|
// GetBody will return an io.ReadSeeker of the Request's underlying
|
||||||
// input body with a concurrency safe wrapper.
|
// input body with a concurrency safe wrapper.
|
||||||
func (r *Request) GetBody() io.ReadSeeker {
|
func (r *Request) GetBody() io.ReadSeeker {
|
||||||
return r.safeBody
|
return r.safeBody
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send will send the request returning error if errors are encountered.
|
// Send will send the request, returning error if errors are encountered.
|
||||||
//
|
//
|
||||||
// Send will sign the request prior to sending. All Send Handlers will
|
// Send will sign the request prior to sending. All Send Handlers will
|
||||||
// be executed in the order they were set.
|
// be executed in the order they were set.
|
||||||
|
@ -457,6 +463,7 @@ func (r *Request) Send() error {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
r.AttemptTime = time.Now()
|
||||||
if aws.BoolValue(r.Retryable) {
|
if aws.BoolValue(r.Retryable) {
|
||||||
if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
|
if r.Config.LogLevel.Matches(aws.LogDebugWithRequestRetries) {
|
||||||
r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",
|
r.Config.Logger.Log(fmt.Sprintf("DEBUG: Retrying Request %s/%s, attempt %d",
|
||||||
|
@ -579,3 +586,72 @@ func shouldRetryCancel(r *Request) bool {
|
||||||
errStr != "net/http: request canceled while waiting for connection")
|
errStr != "net/http: request canceled while waiting for connection")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SanitizeHostForHeader removes default port from host and updates request.Host
|
||||||
|
func SanitizeHostForHeader(r *http.Request) {
|
||||||
|
host := getHost(r)
|
||||||
|
port := portOnly(host)
|
||||||
|
if port != "" && isDefaultPort(r.URL.Scheme, port) {
|
||||||
|
r.Host = stripPort(host)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns host from request
|
||||||
|
func getHost(r *http.Request) string {
|
||||||
|
if r.Host != "" {
|
||||||
|
return r.Host
|
||||||
|
}
|
||||||
|
|
||||||
|
return r.URL.Host
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hostname returns u.Host, without any port number.
|
||||||
|
//
|
||||||
|
// If Host is an IPv6 literal with a port number, Hostname returns the
|
||||||
|
// IPv6 literal without the square brackets. IPv6 literals may include
|
||||||
|
// a zone identifier.
|
||||||
|
//
|
||||||
|
// Copied from the Go 1.8 standard library (net/url)
|
||||||
|
func stripPort(hostport string) string {
|
||||||
|
colon := strings.IndexByte(hostport, ':')
|
||||||
|
if colon == -1 {
|
||||||
|
return hostport
|
||||||
|
}
|
||||||
|
if i := strings.IndexByte(hostport, ']'); i != -1 {
|
||||||
|
return strings.TrimPrefix(hostport[:i], "[")
|
||||||
|
}
|
||||||
|
return hostport[:colon]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Port returns the port part of u.Host, without the leading colon.
|
||||||
|
// If u.Host doesn't contain a port, Port returns an empty string.
|
||||||
|
//
|
||||||
|
// Copied from the Go 1.8 standard library (net/url)
|
||||||
|
func portOnly(hostport string) string {
|
||||||
|
colon := strings.IndexByte(hostport, ':')
|
||||||
|
if colon == -1 {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
if i := strings.Index(hostport, "]:"); i != -1 {
|
||||||
|
return hostport[i+len("]:"):]
|
||||||
|
}
|
||||||
|
if strings.Contains(hostport, "]") {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return hostport[colon+len(":"):]
|
||||||
|
}
|
||||||
|
|
||||||
|
// Returns true if the specified URI is using the standard port
|
||||||
|
// (i.e. port 80 for HTTP URIs or 443 for HTTPS URIs)
|
||||||
|
func isDefaultPort(scheme, port string) bool {
|
||||||
|
if port == "" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
lowerCaseScheme := strings.ToLower(scheme)
|
||||||
|
if (lowerCaseScheme == "http" && port == "80") || (lowerCaseScheme == "https" && port == "443") {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ func (noBody) WriteTo(io.Writer) (int64, error) { return 0, nil }
|
||||||
var NoBody = noBody{}
|
var NoBody = noBody{}
|
||||||
|
|
||||||
// ResetBody rewinds the request body back to its starting position, and
|
// ResetBody rewinds the request body back to its starting position, and
|
||||||
// set's the HTTP Request body reference. When the body is read prior
|
// sets the HTTP Request body reference. When the body is read prior
|
||||||
// to being sent in the HTTP request it will need to be rewound.
|
// to being sent in the HTTP request it will need to be rewound.
|
||||||
//
|
//
|
||||||
// ResetBody will automatically be called by the SDK's build handler, but if
|
// ResetBody will automatically be called by the SDK's build handler, but if
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
var NoBody = http.NoBody
|
var NoBody = http.NoBody
|
||||||
|
|
||||||
// ResetBody rewinds the request body back to its starting position, and
|
// ResetBody rewinds the request body back to its starting position, and
|
||||||
// set's the HTTP Request body reference. When the body is read prior
|
// sets the HTTP Request body reference. When the body is read prior
|
||||||
// to being sent in the HTTP request it will need to be rewound.
|
// to being sent in the HTTP request it will need to be rewound.
|
||||||
//
|
//
|
||||||
// ResetBody will automatically be called by the SDK's build handler, but if
|
// ResetBody will automatically be called by the SDK's build handler, but if
|
||||||
|
|
|
@ -35,8 +35,12 @@ type Pagination struct {
|
||||||
// NewRequest should always be built from the same API operations. It is
|
// NewRequest should always be built from the same API operations. It is
|
||||||
// undefined if different API operations are returned on subsequent calls.
|
// undefined if different API operations are returned on subsequent calls.
|
||||||
NewRequest func() (*Request, error)
|
NewRequest func() (*Request, error)
|
||||||
|
// EndPageOnSameToken, when enabled, will allow the paginator to stop on
|
||||||
|
// token that are the same as its previous tokens.
|
||||||
|
EndPageOnSameToken bool
|
||||||
|
|
||||||
started bool
|
started bool
|
||||||
|
prevTokens []interface{}
|
||||||
nextTokens []interface{}
|
nextTokens []interface{}
|
||||||
|
|
||||||
err error
|
err error
|
||||||
|
@ -49,7 +53,15 @@ type Pagination struct {
|
||||||
//
|
//
|
||||||
// Will always return true if Next has not been called yet.
|
// Will always return true if Next has not been called yet.
|
||||||
func (p *Pagination) HasNextPage() bool {
|
func (p *Pagination) HasNextPage() bool {
|
||||||
return !(p.started && len(p.nextTokens) == 0)
|
if !p.started {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
hasNextPage := len(p.nextTokens) != 0
|
||||||
|
if p.EndPageOnSameToken {
|
||||||
|
return hasNextPage && !awsutil.DeepEqual(p.nextTokens, p.prevTokens)
|
||||||
|
}
|
||||||
|
return hasNextPage
|
||||||
}
|
}
|
||||||
|
|
||||||
// Err returns the error Pagination encountered when retrieving the next page.
|
// Err returns the error Pagination encountered when retrieving the next page.
|
||||||
|
@ -96,6 +108,7 @@ func (p *Pagination) Next() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.prevTokens = p.nextTokens
|
||||||
p.nextTokens = req.nextPageTokens()
|
p.nextTokens = req.nextPageTokens()
|
||||||
p.curPage = req.Data
|
p.curPage = req.Data
|
||||||
|
|
||||||
|
@ -142,13 +155,28 @@ func (r *Request) nextPageTokens() []interface{} {
|
||||||
tokens := []interface{}{}
|
tokens := []interface{}{}
|
||||||
tokenAdded := false
|
tokenAdded := false
|
||||||
for _, outToken := range r.Operation.OutputTokens {
|
for _, outToken := range r.Operation.OutputTokens {
|
||||||
v, _ := awsutil.ValuesAtPath(r.Data, outToken)
|
vs, _ := awsutil.ValuesAtPath(r.Data, outToken)
|
||||||
if len(v) > 0 {
|
if len(vs) == 0 {
|
||||||
tokens = append(tokens, v[0])
|
|
||||||
tokenAdded = true
|
|
||||||
} else {
|
|
||||||
tokens = append(tokens, nil)
|
tokens = append(tokens, nil)
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
v := vs[0]
|
||||||
|
|
||||||
|
switch tv := v.(type) {
|
||||||
|
case *string:
|
||||||
|
if len(aws.StringValue(tv)) == 0 {
|
||||||
|
tokens = append(tokens, nil)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
case string:
|
||||||
|
if len(tv) == 0 {
|
||||||
|
tokens = append(tokens, nil)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tokenAdded = true
|
||||||
|
tokens = append(tokens, v)
|
||||||
}
|
}
|
||||||
if !tokenAdded {
|
if !tokenAdded {
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -18,6 +18,7 @@ go_library(
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/corehandlers:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/corehandlers:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/credentials:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/credentials:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/aws/csm:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/defaults:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/defaults:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/endpoints:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/endpoints:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||||
|
"github.com/aws/aws-sdk-go/aws/defaults"
|
||||||
)
|
)
|
||||||
|
|
||||||
// EnvProviderName provides a name of the provider when config is loaded from environment.
|
// EnvProviderName provides a name of the provider when config is loaded from environment.
|
||||||
|
@ -95,9 +96,23 @@ type envConfig struct {
|
||||||
//
|
//
|
||||||
// AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle
|
// AWS_CA_BUNDLE=$HOME/my_custom_ca_bundle
|
||||||
CustomCABundle string
|
CustomCABundle string
|
||||||
|
|
||||||
|
csmEnabled string
|
||||||
|
CSMEnabled bool
|
||||||
|
CSMPort string
|
||||||
|
CSMClientID string
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
csmEnabledEnvKey = []string{
|
||||||
|
"AWS_CSM_ENABLED",
|
||||||
|
}
|
||||||
|
csmPortEnvKey = []string{
|
||||||
|
"AWS_CSM_PORT",
|
||||||
|
}
|
||||||
|
csmClientIDEnvKey = []string{
|
||||||
|
"AWS_CSM_CLIENT_ID",
|
||||||
|
}
|
||||||
credAccessEnvKey = []string{
|
credAccessEnvKey = []string{
|
||||||
"AWS_ACCESS_KEY_ID",
|
"AWS_ACCESS_KEY_ID",
|
||||||
"AWS_ACCESS_KEY",
|
"AWS_ACCESS_KEY",
|
||||||
|
@ -156,6 +171,12 @@ func envConfigLoad(enableSharedConfig bool) envConfig {
|
||||||
setFromEnvVal(&cfg.Creds.SecretAccessKey, credSecretEnvKey)
|
setFromEnvVal(&cfg.Creds.SecretAccessKey, credSecretEnvKey)
|
||||||
setFromEnvVal(&cfg.Creds.SessionToken, credSessionEnvKey)
|
setFromEnvVal(&cfg.Creds.SessionToken, credSessionEnvKey)
|
||||||
|
|
||||||
|
// CSM environment variables
|
||||||
|
setFromEnvVal(&cfg.csmEnabled, csmEnabledEnvKey)
|
||||||
|
setFromEnvVal(&cfg.CSMPort, csmPortEnvKey)
|
||||||
|
setFromEnvVal(&cfg.CSMClientID, csmClientIDEnvKey)
|
||||||
|
cfg.CSMEnabled = len(cfg.csmEnabled) > 0
|
||||||
|
|
||||||
// Require logical grouping of credentials
|
// Require logical grouping of credentials
|
||||||
if len(cfg.Creds.AccessKeyID) == 0 || len(cfg.Creds.SecretAccessKey) == 0 {
|
if len(cfg.Creds.AccessKeyID) == 0 || len(cfg.Creds.SecretAccessKey) == 0 {
|
||||||
cfg.Creds = credentials.Value{}
|
cfg.Creds = credentials.Value{}
|
||||||
|
@ -176,6 +197,13 @@ func envConfigLoad(enableSharedConfig bool) envConfig {
|
||||||
setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey)
|
setFromEnvVal(&cfg.SharedCredentialsFile, sharedCredsFileEnvKey)
|
||||||
setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey)
|
setFromEnvVal(&cfg.SharedConfigFile, sharedConfigFileEnvKey)
|
||||||
|
|
||||||
|
if len(cfg.SharedCredentialsFile) == 0 {
|
||||||
|
cfg.SharedCredentialsFile = defaults.SharedCredentialsFilename()
|
||||||
|
}
|
||||||
|
if len(cfg.SharedConfigFile) == 0 {
|
||||||
|
cfg.SharedConfigFile = defaults.SharedConfigFilename()
|
||||||
|
}
|
||||||
|
|
||||||
cfg.CustomCABundle = os.Getenv("AWS_CA_BUNDLE")
|
cfg.CustomCABundle = os.Getenv("AWS_CA_BUNDLE")
|
||||||
|
|
||||||
return cfg
|
return cfg
|
||||||
|
|
|
@ -15,6 +15,7 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws/corehandlers"
|
"github.com/aws/aws-sdk-go/aws/corehandlers"
|
||||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||||
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
|
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
|
||||||
|
"github.com/aws/aws-sdk-go/aws/csm"
|
||||||
"github.com/aws/aws-sdk-go/aws/defaults"
|
"github.com/aws/aws-sdk-go/aws/defaults"
|
||||||
"github.com/aws/aws-sdk-go/aws/endpoints"
|
"github.com/aws/aws-sdk-go/aws/endpoints"
|
||||||
"github.com/aws/aws-sdk-go/aws/request"
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
|
@ -26,7 +27,7 @@ import (
|
||||||
// Sessions are safe to create service clients concurrently, but it is not safe
|
// Sessions are safe to create service clients concurrently, but it is not safe
|
||||||
// to mutate the Session concurrently.
|
// to mutate the Session concurrently.
|
||||||
//
|
//
|
||||||
// The Session satisfies the service client's client.ClientConfigProvider.
|
// The Session satisfies the service client's client.ConfigProvider.
|
||||||
type Session struct {
|
type Session struct {
|
||||||
Config *aws.Config
|
Config *aws.Config
|
||||||
Handlers request.Handlers
|
Handlers request.Handlers
|
||||||
|
@ -58,7 +59,12 @@ func New(cfgs ...*aws.Config) *Session {
|
||||||
envCfg := loadEnvConfig()
|
envCfg := loadEnvConfig()
|
||||||
|
|
||||||
if envCfg.EnableSharedConfig {
|
if envCfg.EnableSharedConfig {
|
||||||
s, err := newSession(Options{}, envCfg, cfgs...)
|
var cfg aws.Config
|
||||||
|
cfg.MergeIn(cfgs...)
|
||||||
|
s, err := NewSessionWithOptions(Options{
|
||||||
|
Config: cfg,
|
||||||
|
SharedConfigState: SharedConfigEnable,
|
||||||
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Old session.New expected all errors to be discovered when
|
// Old session.New expected all errors to be discovered when
|
||||||
// a request is made, and would report the errors then. This
|
// a request is made, and would report the errors then. This
|
||||||
|
@ -76,10 +82,16 @@ func New(cfgs ...*aws.Config) *Session {
|
||||||
r.Error = err
|
r.Error = err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
return deprecatedNewSession(cfgs...)
|
s := deprecatedNewSession(cfgs...)
|
||||||
|
if envCfg.CSMEnabled {
|
||||||
|
enableCSM(&s.Handlers, envCfg.CSMClientID, envCfg.CSMPort, s.Config.Logger)
|
||||||
|
}
|
||||||
|
|
||||||
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewSession returns a new Session created from SDK defaults, config files,
|
// NewSession returns a new Session created from SDK defaults, config files,
|
||||||
|
@ -243,13 +255,6 @@ func NewSessionWithOptions(opts Options) (*Session, error) {
|
||||||
envCfg.EnableSharedConfig = true
|
envCfg.EnableSharedConfig = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(envCfg.SharedCredentialsFile) == 0 {
|
|
||||||
envCfg.SharedCredentialsFile = defaults.SharedCredentialsFilename()
|
|
||||||
}
|
|
||||||
if len(envCfg.SharedConfigFile) == 0 {
|
|
||||||
envCfg.SharedConfigFile = defaults.SharedConfigFilename()
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only use AWS_CA_BUNDLE if session option is not provided.
|
// Only use AWS_CA_BUNDLE if session option is not provided.
|
||||||
if len(envCfg.CustomCABundle) != 0 && opts.CustomCABundle == nil {
|
if len(envCfg.CustomCABundle) != 0 && opts.CustomCABundle == nil {
|
||||||
f, err := os.Open(envCfg.CustomCABundle)
|
f, err := os.Open(envCfg.CustomCABundle)
|
||||||
|
@ -302,10 +307,22 @@ func deprecatedNewSession(cfgs ...*aws.Config) *Session {
|
||||||
}
|
}
|
||||||
|
|
||||||
initHandlers(s)
|
initHandlers(s)
|
||||||
|
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func enableCSM(handlers *request.Handlers, clientID string, port string, logger aws.Logger) {
|
||||||
|
logger.Log("Enabling CSM")
|
||||||
|
if len(port) == 0 {
|
||||||
|
port = csm.DefaultPort
|
||||||
|
}
|
||||||
|
|
||||||
|
r, err := csm.Start(clientID, "127.0.0.1:"+port)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
r.InjectHandlers(handlers)
|
||||||
|
}
|
||||||
|
|
||||||
func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
|
func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session, error) {
|
||||||
cfg := defaults.Config()
|
cfg := defaults.Config()
|
||||||
handlers := defaults.Handlers()
|
handlers := defaults.Handlers()
|
||||||
|
@ -345,6 +362,9 @@ func newSession(opts Options, envCfg envConfig, cfgs ...*aws.Config) (*Session,
|
||||||
}
|
}
|
||||||
|
|
||||||
initHandlers(s)
|
initHandlers(s)
|
||||||
|
if envCfg.CSMEnabled {
|
||||||
|
enableCSM(&s.Handlers, envCfg.CSMClientID, envCfg.CSMPort, s.Config.Logger)
|
||||||
|
}
|
||||||
|
|
||||||
// Setup HTTP client with custom cert bundle if enabled
|
// Setup HTTP client with custom cert bundle if enabled
|
||||||
if opts.CustomCABundle != nil {
|
if opts.CustomCABundle != nil {
|
||||||
|
@ -573,11 +593,12 @@ func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) (
|
||||||
}
|
}
|
||||||
|
|
||||||
return client.Config{
|
return client.Config{
|
||||||
Config: s.Config,
|
Config: s.Config,
|
||||||
Handlers: s.Handlers,
|
Handlers: s.Handlers,
|
||||||
Endpoint: resolved.URL,
|
Endpoint: resolved.URL,
|
||||||
SigningRegion: resolved.SigningRegion,
|
SigningRegion: resolved.SigningRegion,
|
||||||
SigningName: resolved.SigningName,
|
SigningNameDerived: resolved.SigningNameDerived,
|
||||||
|
SigningName: resolved.SigningName,
|
||||||
}, err
|
}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,10 +618,11 @@ func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Conf
|
||||||
}
|
}
|
||||||
|
|
||||||
return client.Config{
|
return client.Config{
|
||||||
Config: s.Config,
|
Config: s.Config,
|
||||||
Handlers: s.Handlers,
|
Handlers: s.Handlers,
|
||||||
Endpoint: resolved.URL,
|
Endpoint: resolved.URL,
|
||||||
SigningRegion: resolved.SigningRegion,
|
SigningRegion: resolved.SigningRegion,
|
||||||
SigningName: resolved.SigningName,
|
SigningNameDerived: resolved.SigningNameDerived,
|
||||||
|
SigningName: resolved.SigningName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@ go_library(
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/credentials:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/credentials:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/internal/sdkio:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/private/protocol/rest:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/private/protocol/rest:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -71,6 +71,7 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||||
"github.com/aws/aws-sdk-go/aws/request"
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
|
"github.com/aws/aws-sdk-go/internal/sdkio"
|
||||||
"github.com/aws/aws-sdk-go/private/protocol/rest"
|
"github.com/aws/aws-sdk-go/private/protocol/rest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -134,6 +135,7 @@ var requiredSignedHeaders = rules{
|
||||||
"X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{},
|
"X-Amz-Server-Side-Encryption-Customer-Key-Md5": struct{}{},
|
||||||
"X-Amz-Storage-Class": struct{}{},
|
"X-Amz-Storage-Class": struct{}{},
|
||||||
"X-Amz-Website-Redirect-Location": struct{}{},
|
"X-Amz-Website-Redirect-Location": struct{}{},
|
||||||
|
"X-Amz-Content-Sha256": struct{}{},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
patterns{"X-Amz-Meta-"},
|
patterns{"X-Amz-Meta-"},
|
||||||
|
@ -268,7 +270,7 @@ type signingCtx struct {
|
||||||
// "X-Amz-Content-Sha256" header with a precomputed value. The signer will
|
// "X-Amz-Content-Sha256" header with a precomputed value. The signer will
|
||||||
// only compute the hash if the request header value is empty.
|
// 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) {
|
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)
|
return v4.signWithBody(r, body, service, region, 0, false, signTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Presign signs AWS v4 requests with the provided body, service name, region
|
// Presign signs AWS v4 requests with the provided body, service name, region
|
||||||
|
@ -302,10 +304,10 @@ func (v4 Signer) Sign(r *http.Request, body io.ReadSeeker, service, region strin
|
||||||
// presigned request's signature you can set the "X-Amz-Content-Sha256"
|
// presigned request's signature you can set the "X-Amz-Content-Sha256"
|
||||||
// HTTP header and that will be included in the request's signature.
|
// 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) {
|
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)
|
return v4.signWithBody(r, body, service, region, exp, true, signTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, signTime time.Time) (http.Header, error) {
|
func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, region string, exp time.Duration, isPresign bool, signTime time.Time) (http.Header, error) {
|
||||||
currentTimeFn := v4.currentTimeFn
|
currentTimeFn := v4.currentTimeFn
|
||||||
if currentTimeFn == nil {
|
if currentTimeFn == nil {
|
||||||
currentTimeFn = time.Now
|
currentTimeFn = time.Now
|
||||||
|
@ -317,7 +319,7 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi
|
||||||
Query: r.URL.Query(),
|
Query: r.URL.Query(),
|
||||||
Time: signTime,
|
Time: signTime,
|
||||||
ExpireTime: exp,
|
ExpireTime: exp,
|
||||||
isPresign: exp != 0,
|
isPresign: isPresign,
|
||||||
ServiceName: service,
|
ServiceName: service,
|
||||||
Region: region,
|
Region: region,
|
||||||
DisableURIPathEscaping: v4.DisableURIPathEscaping,
|
DisableURIPathEscaping: v4.DisableURIPathEscaping,
|
||||||
|
@ -339,8 +341,11 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi
|
||||||
return http.Header{}, err
|
return http.Header{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx.sanitizeHostForHeader()
|
||||||
ctx.assignAmzQueryValues()
|
ctx.assignAmzQueryValues()
|
||||||
ctx.build(v4.DisableHeaderHoisting)
|
if err := ctx.build(v4.DisableHeaderHoisting); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// If the request is not presigned the body should be attached to it. This
|
// If the request is not presigned the body should be attached to it. This
|
||||||
// prevents the confusion of wanting to send a signed request without
|
// prevents the confusion of wanting to send a signed request without
|
||||||
|
@ -363,6 +368,10 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi
|
||||||
return ctx.SignedHeaderVals, nil
|
return ctx.SignedHeaderVals, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (ctx *signingCtx) sanitizeHostForHeader() {
|
||||||
|
request.SanitizeHostForHeader(ctx.Request)
|
||||||
|
}
|
||||||
|
|
||||||
func (ctx *signingCtx) handlePresignRemoval() {
|
func (ctx *signingCtx) handlePresignRemoval() {
|
||||||
if !ctx.isPresign {
|
if !ctx.isPresign {
|
||||||
return
|
return
|
||||||
|
@ -467,7 +476,7 @@ func signSDKRequestWithCurrTime(req *request.Request, curTimeFn func() time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.GetBody(),
|
signedHeaders, err := v4.signWithBody(req.HTTPRequest, req.GetBody(),
|
||||||
name, region, req.ExpireTime, signingTime,
|
name, region, req.ExpireTime, req.ExpireTime > 0, signingTime,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
req.Error = err
|
req.Error = err
|
||||||
|
@ -498,11 +507,13 @@ func (v4 *Signer) logSigningInfo(ctx *signingCtx) {
|
||||||
v4.Logger.Log(msg)
|
v4.Logger.Log(msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *signingCtx) build(disableHeaderHoisting bool) {
|
func (ctx *signingCtx) build(disableHeaderHoisting bool) error {
|
||||||
ctx.buildTime() // no depends
|
ctx.buildTime() // no depends
|
||||||
ctx.buildCredentialString() // no depends
|
ctx.buildCredentialString() // no depends
|
||||||
|
|
||||||
ctx.buildBodyDigest()
|
if err := ctx.buildBodyDigest(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
unsignedHeaders := ctx.Request.Header
|
unsignedHeaders := ctx.Request.Header
|
||||||
if ctx.isPresign {
|
if ctx.isPresign {
|
||||||
|
@ -530,6 +541,8 @@ func (ctx *signingCtx) build(disableHeaderHoisting bool) {
|
||||||
}
|
}
|
||||||
ctx.Request.Header.Set("Authorization", strings.Join(parts, ", "))
|
ctx.Request.Header.Set("Authorization", strings.Join(parts, ", "))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *signingCtx) buildTime() {
|
func (ctx *signingCtx) buildTime() {
|
||||||
|
@ -656,21 +669,34 @@ func (ctx *signingCtx) buildSignature() {
|
||||||
ctx.signature = hex.EncodeToString(signature)
|
ctx.signature = hex.EncodeToString(signature)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ctx *signingCtx) buildBodyDigest() {
|
func (ctx *signingCtx) buildBodyDigest() error {
|
||||||
hash := ctx.Request.Header.Get("X-Amz-Content-Sha256")
|
hash := ctx.Request.Header.Get("X-Amz-Content-Sha256")
|
||||||
if hash == "" {
|
if hash == "" {
|
||||||
if ctx.unsignedPayload || (ctx.isPresign && ctx.ServiceName == "s3") {
|
includeSHA256Header := ctx.unsignedPayload ||
|
||||||
|
ctx.ServiceName == "s3" ||
|
||||||
|
ctx.ServiceName == "glacier"
|
||||||
|
|
||||||
|
s3Presign := ctx.isPresign && ctx.ServiceName == "s3"
|
||||||
|
|
||||||
|
if ctx.unsignedPayload || s3Presign {
|
||||||
hash = "UNSIGNED-PAYLOAD"
|
hash = "UNSIGNED-PAYLOAD"
|
||||||
|
includeSHA256Header = !s3Presign
|
||||||
} else if ctx.Body == nil {
|
} else if ctx.Body == nil {
|
||||||
hash = emptyStringSHA256
|
hash = emptyStringSHA256
|
||||||
} else {
|
} else {
|
||||||
|
if !aws.IsReaderSeekable(ctx.Body) {
|
||||||
|
return fmt.Errorf("cannot use unseekable request body %T, for signed request with body", ctx.Body)
|
||||||
|
}
|
||||||
hash = hex.EncodeToString(makeSha256Reader(ctx.Body))
|
hash = hex.EncodeToString(makeSha256Reader(ctx.Body))
|
||||||
}
|
}
|
||||||
if ctx.unsignedPayload || ctx.ServiceName == "s3" || ctx.ServiceName == "glacier" {
|
|
||||||
|
if includeSHA256Header {
|
||||||
ctx.Request.Header.Set("X-Amz-Content-Sha256", hash)
|
ctx.Request.Header.Set("X-Amz-Content-Sha256", hash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx.bodyDigest = hash
|
ctx.bodyDigest = hash
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// isRequestSigned returns if the request is currently signed or presigned
|
// isRequestSigned returns if the request is currently signed or presigned
|
||||||
|
@ -710,8 +736,8 @@ func makeSha256(data []byte) []byte {
|
||||||
|
|
||||||
func makeSha256Reader(reader io.ReadSeeker) []byte {
|
func makeSha256Reader(reader io.ReadSeeker) []byte {
|
||||||
hash := sha256.New()
|
hash := sha256.New()
|
||||||
start, _ := reader.Seek(0, 1)
|
start, _ := reader.Seek(0, sdkio.SeekCurrent)
|
||||||
defer reader.Seek(start, 0)
|
defer reader.Seek(start, sdkio.SeekStart)
|
||||||
|
|
||||||
io.Copy(hash, reader)
|
io.Copy(hash, reader)
|
||||||
return hash.Sum(nil)
|
return hash.Sum(nil)
|
||||||
|
|
|
@ -3,6 +3,8 @@ package aws
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
|
"github.com/aws/aws-sdk-go/internal/sdkio"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Should
|
// ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Should
|
||||||
|
@ -22,6 +24,22 @@ type ReaderSeekerCloser struct {
|
||||||
r io.Reader
|
r io.Reader
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsReaderSeekable returns if the underlying reader type can be seeked. A
|
||||||
|
// io.Reader might not actually be seekable if it is the ReaderSeekerCloser
|
||||||
|
// type.
|
||||||
|
func IsReaderSeekable(r io.Reader) bool {
|
||||||
|
switch v := r.(type) {
|
||||||
|
case ReaderSeekerCloser:
|
||||||
|
return v.IsSeeker()
|
||||||
|
case *ReaderSeekerCloser:
|
||||||
|
return v.IsSeeker()
|
||||||
|
case io.ReadSeeker:
|
||||||
|
return true
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Read reads from the reader up to size of p. The number of bytes read, and
|
// Read reads from the reader up to size of p. The number of bytes read, and
|
||||||
// error if it occurred will be returned.
|
// error if it occurred will be returned.
|
||||||
//
|
//
|
||||||
|
@ -56,6 +74,71 @@ func (r ReaderSeekerCloser) IsSeeker() bool {
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HasLen returns the length of the underlying reader if the value implements
|
||||||
|
// the Len() int method.
|
||||||
|
func (r ReaderSeekerCloser) HasLen() (int, bool) {
|
||||||
|
type lenner interface {
|
||||||
|
Len() int
|
||||||
|
}
|
||||||
|
|
||||||
|
if lr, ok := r.r.(lenner); ok {
|
||||||
|
return lr.Len(), true
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0, false
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetLen returns the length of the bytes remaining in the underlying reader.
|
||||||
|
// Checks first for Len(), then io.Seeker to determine the size of the
|
||||||
|
// underlying reader.
|
||||||
|
//
|
||||||
|
// Will return -1 if the length cannot be determined.
|
||||||
|
func (r ReaderSeekerCloser) GetLen() (int64, error) {
|
||||||
|
if l, ok := r.HasLen(); ok {
|
||||||
|
return int64(l), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if s, ok := r.r.(io.Seeker); ok {
|
||||||
|
return seekerLen(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// SeekerLen attempts to get the number of bytes remaining at the seeker's
|
||||||
|
// current position. Returns the number of bytes remaining or error.
|
||||||
|
func SeekerLen(s io.Seeker) (int64, error) {
|
||||||
|
// Determine if the seeker is actually seekable. ReaderSeekerCloser
|
||||||
|
// hides the fact that a io.Readers might not actually be seekable.
|
||||||
|
switch v := s.(type) {
|
||||||
|
case ReaderSeekerCloser:
|
||||||
|
return v.GetLen()
|
||||||
|
case *ReaderSeekerCloser:
|
||||||
|
return v.GetLen()
|
||||||
|
}
|
||||||
|
|
||||||
|
return seekerLen(s)
|
||||||
|
}
|
||||||
|
|
||||||
|
func seekerLen(s io.Seeker) (int64, error) {
|
||||||
|
curOffset, err := s.Seek(0, sdkio.SeekCurrent)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
endOffset, err := s.Seek(0, sdkio.SeekEnd)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
_, err = s.Seek(curOffset, sdkio.SeekStart)
|
||||||
|
if err != nil {
|
||||||
|
return 0, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return endOffset - curOffset, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Close closes the ReaderSeekerCloser.
|
// Close closes the ReaderSeekerCloser.
|
||||||
//
|
//
|
||||||
// If the ReaderSeekerCloser is not an io.Closer nothing will be done.
|
// If the ReaderSeekerCloser is not an io.Closer nothing will be done.
|
||||||
|
|
|
@ -5,4 +5,4 @@ package aws
|
||||||
const SDKName = "aws-sdk-go"
|
const SDKName = "aws-sdk-go"
|
||||||
|
|
||||||
// SDKVersion is the version of this SDK
|
// SDKVersion is the version of this SDK
|
||||||
const SDKVersion = "1.12.7"
|
const SDKVersion = "1.14.12"
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = [
|
||||||
|
"io_go1.6.go",
|
||||||
|
"io_go1.7.go",
|
||||||
|
],
|
||||||
|
importmap = "k8s.io/kubernetes/vendor/github.com/aws/aws-sdk-go/internal/sdkio",
|
||||||
|
importpath = "github.com/aws/aws-sdk-go/internal/sdkio",
|
||||||
|
visibility = ["//vendor/github.com/aws/aws-sdk-go:__subpackages__"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "package-srcs",
|
||||||
|
srcs = glob(["**"]),
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "all-srcs",
|
||||||
|
srcs = [":package-srcs"],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
|
@ -0,0 +1,10 @@
|
||||||
|
// +build !go1.7
|
||||||
|
|
||||||
|
package sdkio
|
||||||
|
|
||||||
|
// Copy of Go 1.7 io package's Seeker constants.
|
||||||
|
const (
|
||||||
|
SeekStart = 0 // seek relative to the origin of the file
|
||||||
|
SeekCurrent = 1 // seek relative to the current offset
|
||||||
|
SeekEnd = 2 // seek relative to the end
|
||||||
|
)
|
|
@ -0,0 +1,12 @@
|
||||||
|
// +build go1.7
|
||||||
|
|
||||||
|
package sdkio
|
||||||
|
|
||||||
|
import "io"
|
||||||
|
|
||||||
|
// Alias for Go 1.7 io package Seeker constants
|
||||||
|
const (
|
||||||
|
SeekStart = io.SeekStart // seek relative to the origin of the file
|
||||||
|
SeekCurrent = io.SeekCurrent // seek relative to the current offset
|
||||||
|
SeekEnd = io.SeekEnd // seek relative to the end
|
||||||
|
)
|
|
@ -0,0 +1,23 @@
|
||||||
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||||||
|
|
||||||
|
go_library(
|
||||||
|
name = "go_default_library",
|
||||||
|
srcs = ["locked_source.go"],
|
||||||
|
importmap = "k8s.io/kubernetes/vendor/github.com/aws/aws-sdk-go/internal/sdkrand",
|
||||||
|
importpath = "github.com/aws/aws-sdk-go/internal/sdkrand",
|
||||||
|
visibility = ["//vendor/github.com/aws/aws-sdk-go:__subpackages__"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "package-srcs",
|
||||||
|
srcs = glob(["**"]),
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:private"],
|
||||||
|
)
|
||||||
|
|
||||||
|
filegroup(
|
||||||
|
name = "all-srcs",
|
||||||
|
srcs = [":package-srcs"],
|
||||||
|
tags = ["automanaged"],
|
||||||
|
visibility = ["//visibility:public"],
|
||||||
|
)
|
29
vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go
generated
vendored
Normal file
29
vendor/github.com/aws/aws-sdk-go/internal/sdkrand/locked_source.go
generated
vendored
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
package sdkrand
|
||||||
|
|
||||||
|
import (
|
||||||
|
"math/rand"
|
||||||
|
"sync"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// lockedSource is a thread-safe implementation of rand.Source
|
||||||
|
type lockedSource struct {
|
||||||
|
lk sync.Mutex
|
||||||
|
src rand.Source
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *lockedSource) Int63() (n int64) {
|
||||||
|
r.lk.Lock()
|
||||||
|
n = r.src.Int63()
|
||||||
|
r.lk.Unlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *lockedSource) Seed(seed int64) {
|
||||||
|
r.lk.Lock()
|
||||||
|
r.src.Seed(seed)
|
||||||
|
r.lk.Unlock()
|
||||||
|
}
|
||||||
|
|
||||||
|
// SeededRand is a new RNG using a thread safe implementation of rand.Source
|
||||||
|
var SeededRand = rand.New(&lockedSource{src: rand.NewSource(time.Now().UnixNano())})
|
|
@ -4,12 +4,18 @@ go_library(
|
||||||
name = "go_default_library",
|
name = "go_default_library",
|
||||||
srcs = [
|
srcs = [
|
||||||
"idempotency.go",
|
"idempotency.go",
|
||||||
|
"jsonvalue.go",
|
||||||
|
"payload.go",
|
||||||
"unmarshal.go",
|
"unmarshal.go",
|
||||||
],
|
],
|
||||||
importmap = "k8s.io/kubernetes/vendor/github.com/aws/aws-sdk-go/private/protocol",
|
importmap = "k8s.io/kubernetes/vendor/github.com/aws/aws-sdk-go/private/protocol",
|
||||||
importpath = "github.com/aws/aws-sdk-go/private/protocol",
|
importpath = "github.com/aws/aws-sdk-go/private/protocol",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = ["//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library"],
|
deps = [
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/aws/client/metadata:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
|
|
|
@ -24,7 +24,7 @@ func Build(r *request.Request) {
|
||||||
r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err)
|
r.Error = awserr.New("SerializationError", "failed encoding EC2 Query request", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.ExpireTime == 0 {
|
if !r.IsPresigned() {
|
||||||
r.HTTPRequest.Method = "POST"
|
r.HTTPRequest.Method = "POST"
|
||||||
r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
|
r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
|
||||||
r.SetBufferBody([]byte(body.Encode()))
|
r.SetBufferBody([]byte(body.Encode()))
|
||||||
|
|
|
@ -9,7 +9,10 @@ go_library(
|
||||||
importmap = "k8s.io/kubernetes/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil",
|
importmap = "k8s.io/kubernetes/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil",
|
||||||
importpath = "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil",
|
importpath = "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = ["//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library"],
|
deps = [
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library",
|
||||||
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
filegroup(
|
filegroup(
|
||||||
|
|
|
@ -12,6 +12,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/private/protocol"
|
"github.com/aws/aws-sdk-go/private/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -49,7 +50,10 @@ func buildAny(value reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) err
|
||||||
t = "list"
|
t = "list"
|
||||||
}
|
}
|
||||||
case reflect.Map:
|
case reflect.Map:
|
||||||
t = "map"
|
// cannot be a JSONValue map
|
||||||
|
if _, ok := value.Interface().(aws.JSONValue); !ok {
|
||||||
|
t = "map"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,14 +214,11 @@ func buildScalar(v reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) erro
|
||||||
}
|
}
|
||||||
buf.Write(strconv.AppendFloat(scratch[:0], f, 'f', -1, 64))
|
buf.Write(strconv.AppendFloat(scratch[:0], f, 'f', -1, 64))
|
||||||
default:
|
default:
|
||||||
switch value.Type() {
|
switch converted := value.Interface().(type) {
|
||||||
case timeType:
|
case time.Time:
|
||||||
converted := v.Interface().(*time.Time)
|
|
||||||
|
|
||||||
buf.Write(strconv.AppendInt(scratch[:0], converted.UTC().Unix(), 10))
|
buf.Write(strconv.AppendInt(scratch[:0], converted.UTC().Unix(), 10))
|
||||||
case byteSliceType:
|
case []byte:
|
||||||
if !value.IsNil() {
|
if !value.IsNil() {
|
||||||
converted := value.Interface().([]byte)
|
|
||||||
buf.WriteByte('"')
|
buf.WriteByte('"')
|
||||||
if len(converted) < 1024 {
|
if len(converted) < 1024 {
|
||||||
// for small buffers, using Encode directly is much faster.
|
// for small buffers, using Encode directly is much faster.
|
||||||
|
@ -233,6 +234,12 @@ func buildScalar(v reflect.Value, buf *bytes.Buffer, tag reflect.StructTag) erro
|
||||||
}
|
}
|
||||||
buf.WriteByte('"')
|
buf.WriteByte('"')
|
||||||
}
|
}
|
||||||
|
case aws.JSONValue:
|
||||||
|
str, err := protocol.EncodeJSONValue(converted, protocol.QuotedEscape)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("unable to encode JSONValue, %v", err)
|
||||||
|
}
|
||||||
|
buf.WriteString(str)
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unsupported JSON value %v (%s)", value.Interface(), value.Type())
|
return fmt.Errorf("unsupported JSON value %v (%s)", value.Interface(), value.Type())
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,9 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"reflect"
|
"reflect"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
|
"github.com/aws/aws-sdk-go/private/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UnmarshalJSON reads a stream and unmarshals the results in object v.
|
// UnmarshalJSON reads a stream and unmarshals the results in object v.
|
||||||
|
@ -50,7 +53,10 @@ func unmarshalAny(value reflect.Value, data interface{}, tag reflect.StructTag)
|
||||||
t = "list"
|
t = "list"
|
||||||
}
|
}
|
||||||
case reflect.Map:
|
case reflect.Map:
|
||||||
t = "map"
|
// cannot be a JSONValue map
|
||||||
|
if _, ok := value.Interface().(aws.JSONValue); !ok {
|
||||||
|
t = "map"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,6 +189,13 @@ func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTa
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
value.Set(reflect.ValueOf(b))
|
value.Set(reflect.ValueOf(b))
|
||||||
|
case aws.JSONValue:
|
||||||
|
// No need to use escaping as the value is a non-quoted string.
|
||||||
|
v, err := protocol.DecodeJSONValue(d, protocol.NoEscape)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
value.Set(reflect.ValueOf(v))
|
||||||
default:
|
default:
|
||||||
return errf()
|
return errf()
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,76 @@
|
||||||
|
package protocol
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/base64"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
|
)
|
||||||
|
|
||||||
|
// EscapeMode is the mode that should be use for escaping a value
|
||||||
|
type EscapeMode uint
|
||||||
|
|
||||||
|
// The modes for escaping a value before it is marshaled, and unmarshaled.
|
||||||
|
const (
|
||||||
|
NoEscape EscapeMode = iota
|
||||||
|
Base64Escape
|
||||||
|
QuotedEscape
|
||||||
|
)
|
||||||
|
|
||||||
|
// EncodeJSONValue marshals the value into a JSON string, and optionally base64
|
||||||
|
// encodes the string before returning it.
|
||||||
|
//
|
||||||
|
// Will panic if the escape mode is unknown.
|
||||||
|
func EncodeJSONValue(v aws.JSONValue, escape EscapeMode) (string, error) {
|
||||||
|
b, err := json.Marshal(v)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
switch escape {
|
||||||
|
case NoEscape:
|
||||||
|
return string(b), nil
|
||||||
|
case Base64Escape:
|
||||||
|
return base64.StdEncoding.EncodeToString(b), nil
|
||||||
|
case QuotedEscape:
|
||||||
|
return strconv.Quote(string(b)), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
panic(fmt.Sprintf("EncodeJSONValue called with unknown EscapeMode, %v", escape))
|
||||||
|
}
|
||||||
|
|
||||||
|
// DecodeJSONValue will attempt to decode the string input as a JSONValue.
|
||||||
|
// Optionally decoding base64 the value first before JSON unmarshaling.
|
||||||
|
//
|
||||||
|
// Will panic if the escape mode is unknown.
|
||||||
|
func DecodeJSONValue(v string, escape EscapeMode) (aws.JSONValue, error) {
|
||||||
|
var b []byte
|
||||||
|
var err error
|
||||||
|
|
||||||
|
switch escape {
|
||||||
|
case NoEscape:
|
||||||
|
b = []byte(v)
|
||||||
|
case Base64Escape:
|
||||||
|
b, err = base64.StdEncoding.DecodeString(v)
|
||||||
|
case QuotedEscape:
|
||||||
|
var u string
|
||||||
|
u, err = strconv.Unquote(v)
|
||||||
|
b = []byte(u)
|
||||||
|
default:
|
||||||
|
panic(fmt.Sprintf("DecodeJSONValue called with unknown EscapeMode, %v", escape))
|
||||||
|
}
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
m := aws.JSONValue{}
|
||||||
|
err = json.Unmarshal(b, &m)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return m, nil
|
||||||
|
}
|
|
@ -0,0 +1,81 @@
|
||||||
|
package protocol
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
|
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||||
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
|
)
|
||||||
|
|
||||||
|
// PayloadUnmarshaler provides the interface for unmarshaling a payload's
|
||||||
|
// reader into a SDK shape.
|
||||||
|
type PayloadUnmarshaler interface {
|
||||||
|
UnmarshalPayload(io.Reader, interface{}) error
|
||||||
|
}
|
||||||
|
|
||||||
|
// HandlerPayloadUnmarshal implements the PayloadUnmarshaler from a
|
||||||
|
// HandlerList. This provides the support for unmarshaling a payload reader to
|
||||||
|
// a shape without needing a SDK request first.
|
||||||
|
type HandlerPayloadUnmarshal struct {
|
||||||
|
Unmarshalers request.HandlerList
|
||||||
|
}
|
||||||
|
|
||||||
|
// UnmarshalPayload unmarshals the io.Reader payload into the SDK shape using
|
||||||
|
// the Unmarshalers HandlerList provided. Returns an error if unable
|
||||||
|
// unmarshaling fails.
|
||||||
|
func (h HandlerPayloadUnmarshal) UnmarshalPayload(r io.Reader, v interface{}) error {
|
||||||
|
req := &request.Request{
|
||||||
|
HTTPRequest: &http.Request{},
|
||||||
|
HTTPResponse: &http.Response{
|
||||||
|
StatusCode: 200,
|
||||||
|
Header: http.Header{},
|
||||||
|
Body: ioutil.NopCloser(r),
|
||||||
|
},
|
||||||
|
Data: v,
|
||||||
|
}
|
||||||
|
|
||||||
|
h.Unmarshalers.Run(req)
|
||||||
|
|
||||||
|
return req.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
// PayloadMarshaler provides the interface for marshaling a SDK shape into and
|
||||||
|
// io.Writer.
|
||||||
|
type PayloadMarshaler interface {
|
||||||
|
MarshalPayload(io.Writer, interface{}) error
|
||||||
|
}
|
||||||
|
|
||||||
|
// HandlerPayloadMarshal implements the PayloadMarshaler from a HandlerList.
|
||||||
|
// This provides support for marshaling a SDK shape into an io.Writer without
|
||||||
|
// needing a SDK request first.
|
||||||
|
type HandlerPayloadMarshal struct {
|
||||||
|
Marshalers request.HandlerList
|
||||||
|
}
|
||||||
|
|
||||||
|
// MarshalPayload marshals the SDK shape into the io.Writer using the
|
||||||
|
// Marshalers HandlerList provided. Returns an error if unable if marshal
|
||||||
|
// fails.
|
||||||
|
func (h HandlerPayloadMarshal) MarshalPayload(w io.Writer, v interface{}) error {
|
||||||
|
req := request.New(
|
||||||
|
aws.Config{},
|
||||||
|
metadata.ClientInfo{},
|
||||||
|
request.Handlers{},
|
||||||
|
nil,
|
||||||
|
&request.Operation{HTTPMethod: "GET"},
|
||||||
|
v,
|
||||||
|
nil,
|
||||||
|
)
|
||||||
|
|
||||||
|
h.Marshalers.Run(req)
|
||||||
|
|
||||||
|
if req.Error != nil {
|
||||||
|
return req.Error
|
||||||
|
}
|
||||||
|
|
||||||
|
io.Copy(w, req.GetBody())
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
|
@ -25,7 +25,7 @@ func Build(r *request.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.ExpireTime == 0 {
|
if !r.IsPresigned() {
|
||||||
r.HTTPRequest.Method = "POST"
|
r.HTTPRequest.Method = "POST"
|
||||||
r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
|
r.HTTPRequest.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=utf-8")
|
||||||
r.SetBufferBody([]byte(body.Encode()))
|
r.SetBufferBody([]byte(body.Encode()))
|
||||||
|
|
|
@ -14,6 +14,7 @@ go_library(
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/awserr:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ package rest
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -18,10 +17,13 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||||
"github.com/aws/aws-sdk-go/aws/request"
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
|
"github.com/aws/aws-sdk-go/private/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
// RFC822 returns an RFC822 formatted timestamp for AWS protocols
|
// RFC1123GMT is a RFC1123 (RFC822) formated timestame. This format is not
|
||||||
const RFC822 = "Mon, 2 Jan 2006 15:04:05 GMT"
|
// using the standard library's time.RFC1123 due to the desire to always use
|
||||||
|
// GMT as the timezone.
|
||||||
|
const RFC1123GMT = "Mon, 2 Jan 2006 15:04:05 GMT"
|
||||||
|
|
||||||
// Whether the byte value can be sent without escaping in AWS URLs
|
// Whether the byte value can be sent without escaping in AWS URLs
|
||||||
var noEscape [256]bool
|
var noEscape [256]bool
|
||||||
|
@ -252,13 +254,12 @@ func EscapePath(path string, encodeSep bool) string {
|
||||||
return buf.String()
|
return buf.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
func convertType(v reflect.Value, tag reflect.StructTag) (string, error) {
|
func convertType(v reflect.Value, tag reflect.StructTag) (str string, err error) {
|
||||||
v = reflect.Indirect(v)
|
v = reflect.Indirect(v)
|
||||||
if !v.IsValid() {
|
if !v.IsValid() {
|
||||||
return "", errValueNotSet
|
return "", errValueNotSet
|
||||||
}
|
}
|
||||||
|
|
||||||
var str string
|
|
||||||
switch value := v.Interface().(type) {
|
switch value := v.Interface().(type) {
|
||||||
case string:
|
case string:
|
||||||
str = value
|
str = value
|
||||||
|
@ -271,19 +272,21 @@ func convertType(v reflect.Value, tag reflect.StructTag) (string, error) {
|
||||||
case float64:
|
case float64:
|
||||||
str = strconv.FormatFloat(value, 'f', -1, 64)
|
str = strconv.FormatFloat(value, 'f', -1, 64)
|
||||||
case time.Time:
|
case time.Time:
|
||||||
str = value.UTC().Format(RFC822)
|
str = value.UTC().Format(RFC1123GMT)
|
||||||
case aws.JSONValue:
|
case aws.JSONValue:
|
||||||
b, err := json.Marshal(value)
|
if len(value) == 0 {
|
||||||
if err != nil {
|
return "", errValueNotSet
|
||||||
return "", err
|
|
||||||
}
|
}
|
||||||
|
escaping := protocol.NoEscape
|
||||||
if tag.Get("location") == "header" {
|
if tag.Get("location") == "header" {
|
||||||
str = base64.StdEncoding.EncodeToString(b)
|
escaping = protocol.Base64Escape
|
||||||
} else {
|
}
|
||||||
str = string(b)
|
str, err = protocol.EncodeJSONValue(value, escaping)
|
||||||
|
if err != nil {
|
||||||
|
return "", fmt.Errorf("unable to encode JSONValue, %v", err)
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
err := fmt.Errorf("Unsupported value for param %v (%s)", v.Interface(), v.Type())
|
err := fmt.Errorf("unsupported value for param %v (%s)", v.Interface(), v.Type())
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return str, nil
|
return str, nil
|
||||||
|
|
|
@ -3,7 +3,6 @@ package rest
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/json"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
@ -16,6 +15,7 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/awserr"
|
"github.com/aws/aws-sdk-go/aws/awserr"
|
||||||
"github.com/aws/aws-sdk-go/aws/request"
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
|
"github.com/aws/aws-sdk-go/private/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UnmarshalHandler is a named request handler for unmarshaling rest protocol requests
|
// UnmarshalHandler is a named request handler for unmarshaling rest protocol requests
|
||||||
|
@ -198,23 +198,17 @@ func unmarshalHeader(v reflect.Value, header string, tag reflect.StructTag) erro
|
||||||
}
|
}
|
||||||
v.Set(reflect.ValueOf(&f))
|
v.Set(reflect.ValueOf(&f))
|
||||||
case *time.Time:
|
case *time.Time:
|
||||||
t, err := time.Parse(RFC822, header)
|
t, err := time.Parse(time.RFC1123, header)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
v.Set(reflect.ValueOf(&t))
|
v.Set(reflect.ValueOf(&t))
|
||||||
case aws.JSONValue:
|
case aws.JSONValue:
|
||||||
b := []byte(header)
|
escaping := protocol.NoEscape
|
||||||
var err error
|
|
||||||
if tag.Get("location") == "header" {
|
if tag.Get("location") == "header" {
|
||||||
b, err = base64.StdEncoding.DecodeString(header)
|
escaping = protocol.Base64Escape
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
m, err := protocol.DecodeJSONValue(header, escaping)
|
||||||
m := aws.JSONValue{}
|
|
||||||
err = json.Unmarshal(b, &m)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,9 +52,15 @@ func parse(r reflect.Value, node *XMLNode, tag reflect.StructTag) error {
|
||||||
if t == "" {
|
if t == "" {
|
||||||
switch rtype.Kind() {
|
switch rtype.Kind() {
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
t = "structure"
|
// also it can't be a time object
|
||||||
|
if _, ok := r.Interface().(*time.Time); !ok {
|
||||||
|
t = "structure"
|
||||||
|
}
|
||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
t = "list"
|
// also it can't be a byte slice
|
||||||
|
if _, ok := r.Interface().([]byte); !ok {
|
||||||
|
t = "list"
|
||||||
|
}
|
||||||
case reflect.Map:
|
case reflect.Map:
|
||||||
t = "map"
|
t = "map"
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,9 +3,10 @@
|
||||||
// Package autoscaling provides the client and types for making API
|
// Package autoscaling provides the client and types for making API
|
||||||
// requests to Auto Scaling.
|
// requests to Auto Scaling.
|
||||||
//
|
//
|
||||||
// Auto Scaling is designed to automatically launch or terminate EC2 instances
|
// Amazon EC2 Auto Scaling is designed to automatically launch or terminate
|
||||||
// based on user-defined policies, schedules, and health checks. Use this service
|
// EC2 instances based on user-defined policies, schedules, and health checks.
|
||||||
// in conjunction with the Amazon CloudWatch and Elastic Load Balancing services.
|
// Use this service in conjunction with the AWS Auto Scaling, Amazon CloudWatch,
|
||||||
|
// and Elastic Load Balancing services.
|
||||||
//
|
//
|
||||||
// See https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01 for more information on this service.
|
// See https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01 for more information on this service.
|
||||||
//
|
//
|
||||||
|
@ -14,7 +15,7 @@
|
||||||
//
|
//
|
||||||
// Using the Client
|
// Using the Client
|
||||||
//
|
//
|
||||||
// To Auto Scaling with the SDK use the New function to create
|
// To contact Auto Scaling with the SDK use the New function to create
|
||||||
// a new service client. With that client you can make API requests to the service.
|
// a new service client. With that client you can make API requests to the service.
|
||||||
// These clients are safe to use concurrently.
|
// These clients are safe to use concurrently.
|
||||||
//
|
//
|
||||||
|
|
|
@ -44,4 +44,10 @@ const (
|
||||||
// The operation can't be performed because there are scaling activities in
|
// The operation can't be performed because there are scaling activities in
|
||||||
// progress.
|
// progress.
|
||||||
ErrCodeScalingActivityInProgressFault = "ScalingActivityInProgress"
|
ErrCodeScalingActivityInProgressFault = "ScalingActivityInProgress"
|
||||||
|
|
||||||
|
// ErrCodeServiceLinkedRoleFailure for service response error code
|
||||||
|
// "ServiceLinkedRoleFailure".
|
||||||
|
//
|
||||||
|
// The service-linked role is not yet ready for use.
|
||||||
|
ErrCodeServiceLinkedRoleFailure = "ServiceLinkedRoleFailure"
|
||||||
)
|
)
|
||||||
|
|
|
@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||||
|
|
||||||
// Service information constants
|
// Service information constants
|
||||||
const (
|
const (
|
||||||
ServiceName = "autoscaling" // Service endpoint prefix API calls made to.
|
ServiceName = "autoscaling" // Name of service.
|
||||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||||
|
ServiceID = "Auto Scaling" // ServiceID is a unique identifer of a specific service.
|
||||||
)
|
)
|
||||||
|
|
||||||
// New creates a new instance of the AutoScaling client with a session.
|
// New creates a new instance of the AutoScaling client with a session.
|
||||||
|
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
|
||||||
cfg,
|
cfg,
|
||||||
metadata.ClientInfo{
|
metadata.ClientInfo{
|
||||||
ServiceName: ServiceName,
|
ServiceName: ServiceName,
|
||||||
|
ServiceID: ServiceID,
|
||||||
SigningName: signingName,
|
SigningName: signingName,
|
||||||
SigningRegion: signingRegion,
|
SigningRegion: signingRegion,
|
||||||
Endpoint: endpoint,
|
Endpoint: endpoint,
|
||||||
|
|
|
@ -21,6 +21,7 @@ go_library(
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/endpoints:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/endpoints:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/request:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/aws/signer/v4:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/aws/signer/v4:go_default_library",
|
||||||
|
"//vendor/github.com/aws/aws-sdk-go/internal/sdkrand:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/private/protocol:go_default_library",
|
||||||
"//vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query:go_default_library",
|
"//vendor/github.com/aws/aws-sdk-go/private/protocol/ec2query:go_default_library",
|
||||||
],
|
],
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,11 +5,64 @@ import (
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go/aws"
|
"github.com/aws/aws-sdk-go/aws"
|
||||||
"github.com/aws/aws-sdk-go/aws/awsutil"
|
"github.com/aws/aws-sdk-go/aws/awsutil"
|
||||||
|
"github.com/aws/aws-sdk-go/aws/client"
|
||||||
"github.com/aws/aws-sdk-go/aws/endpoints"
|
"github.com/aws/aws-sdk-go/aws/endpoints"
|
||||||
"github.com/aws/aws-sdk-go/aws/request"
|
"github.com/aws/aws-sdk-go/aws/request"
|
||||||
|
"github.com/aws/aws-sdk-go/internal/sdkrand"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type retryer struct {
|
||||||
|
client.DefaultRetryer
|
||||||
|
}
|
||||||
|
|
||||||
|
func (d retryer) RetryRules(r *request.Request) time.Duration {
|
||||||
|
switch r.Operation.Name {
|
||||||
|
case opModifyNetworkInterfaceAttribute:
|
||||||
|
fallthrough
|
||||||
|
case opAssignPrivateIpAddresses:
|
||||||
|
return customRetryRule(r)
|
||||||
|
default:
|
||||||
|
return d.DefaultRetryer.RetryRules(r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func customRetryRule(r *request.Request) time.Duration {
|
||||||
|
retryTimes := []time.Duration{
|
||||||
|
time.Second,
|
||||||
|
3 * time.Second,
|
||||||
|
5 * time.Second,
|
||||||
|
}
|
||||||
|
|
||||||
|
count := r.RetryCount
|
||||||
|
if count >= len(retryTimes) {
|
||||||
|
count = len(retryTimes) - 1
|
||||||
|
}
|
||||||
|
|
||||||
|
minTime := int(retryTimes[count])
|
||||||
|
return time.Duration(sdkrand.SeededRand.Intn(minTime) + minTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
func setCustomRetryer(c *client.Client) {
|
||||||
|
maxRetries := aws.IntValue(c.Config.MaxRetries)
|
||||||
|
if c.Config.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries {
|
||||||
|
maxRetries = 3
|
||||||
|
}
|
||||||
|
|
||||||
|
c.Retryer = retryer{
|
||||||
|
DefaultRetryer: client.DefaultRetryer{
|
||||||
|
NumMaxRetries: maxRetries,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
initClient = func(c *client.Client) {
|
||||||
|
if c.Config.Retryer == nil {
|
||||||
|
// Only override the retryer with a custom one if the config
|
||||||
|
// does not already contain a retryer
|
||||||
|
setCustomRetryer(c)
|
||||||
|
}
|
||||||
|
}
|
||||||
initRequest = func(r *request.Request) {
|
initRequest = func(r *request.Request) {
|
||||||
if r.Operation.Name == opCopySnapshot { // fill the PresignedURL parameter
|
if r.Operation.Name == opCopySnapshot { // fill the PresignedURL parameter
|
||||||
r.Handlers.Build.PushFront(fillPresignedURL)
|
r.Handlers.Build.PushFront(fillPresignedURL)
|
||||||
|
|
|
@ -4,9 +4,8 @@
|
||||||
// requests to Amazon Elastic Compute Cloud.
|
// requests to Amazon Elastic Compute Cloud.
|
||||||
//
|
//
|
||||||
// Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity
|
// Amazon Elastic Compute Cloud (Amazon EC2) provides resizable computing capacity
|
||||||
// in the Amazon Web Services (AWS) cloud. Using Amazon EC2 eliminates your
|
// in the AWS Cloud. Using Amazon EC2 eliminates the need to invest in hardware
|
||||||
// need to invest in hardware up front, so you can develop and deploy applications
|
// up front, so you can develop and deploy applications faster.
|
||||||
// faster.
|
|
||||||
//
|
//
|
||||||
// See https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15 for more information on this service.
|
// See https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15 for more information on this service.
|
||||||
//
|
//
|
||||||
|
@ -15,7 +14,7 @@
|
||||||
//
|
//
|
||||||
// Using the Client
|
// Using the Client
|
||||||
//
|
//
|
||||||
// To Amazon Elastic Compute Cloud with the SDK use the New function to create
|
// To contact Amazon Elastic Compute Cloud with the SDK use the New function to create
|
||||||
// a new service client. With that client you can make API requests to the service.
|
// a new service client. With that client you can make API requests to the service.
|
||||||
// These clients are safe to use concurrently.
|
// These clients are safe to use concurrently.
|
||||||
//
|
//
|
||||||
|
|
|
@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||||
|
|
||||||
// Service information constants
|
// Service information constants
|
||||||
const (
|
const (
|
||||||
ServiceName = "ec2" // Service endpoint prefix API calls made to.
|
ServiceName = "ec2" // Name of service.
|
||||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||||
|
ServiceID = "EC2" // ServiceID is a unique identifer of a specific service.
|
||||||
)
|
)
|
||||||
|
|
||||||
// New creates a new instance of the EC2 client with a session.
|
// New creates a new instance of the EC2 client with a session.
|
||||||
|
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
|
||||||
cfg,
|
cfg,
|
||||||
metadata.ClientInfo{
|
metadata.ClientInfo{
|
||||||
ServiceName: ServiceName,
|
ServiceName: ServiceName,
|
||||||
|
ServiceID: ServiceID,
|
||||||
SigningName: signingName,
|
SigningName: signingName,
|
||||||
SigningRegion: signingRegion,
|
SigningRegion: signingRegion,
|
||||||
Endpoint: endpoint,
|
Endpoint: endpoint,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,11 +3,11 @@
|
||||||
// Package ecr provides the client and types for making API
|
// Package ecr provides the client and types for making API
|
||||||
// requests to Amazon EC2 Container Registry.
|
// requests to Amazon EC2 Container Registry.
|
||||||
//
|
//
|
||||||
// Amazon EC2 Container Registry (Amazon ECR) is a managed AWS Docker registry
|
// Amazon Elastic Container Registry (Amazon ECR) is a managed Docker registry
|
||||||
// service. Customers can use the familiar Docker CLI to push, pull, and manage
|
// service. Customers can use the familiar Docker CLI to push, pull, and manage
|
||||||
// images. Amazon ECR provides a secure, scalable, and reliable registry. Amazon
|
// images. Amazon ECR provides a secure, scalable, and reliable registry. Amazon
|
||||||
// ECR supports private Docker repositories with resource-based permissions
|
// ECR supports private Docker repositories with resource-based permissions
|
||||||
// using AWS IAM so that specific users or Amazon EC2 instances can access repositories
|
// using IAM so that specific users or Amazon EC2 instances can access repositories
|
||||||
// and images. Developers can use the Docker CLI to author and manage images.
|
// and images. Developers can use the Docker CLI to author and manage images.
|
||||||
//
|
//
|
||||||
// See https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21 for more information on this service.
|
// See https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21 for more information on this service.
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
//
|
//
|
||||||
// Using the Client
|
// Using the Client
|
||||||
//
|
//
|
||||||
// To Amazon EC2 Container Registry with the SDK use the New function to create
|
// To contact Amazon EC2 Container Registry with the SDK use the New function to create
|
||||||
// a new service client. With that client you can make API requests to the service.
|
// a new service client. With that client you can make API requests to the service.
|
||||||
// These clients are safe to use concurrently.
|
// These clients are safe to use concurrently.
|
||||||
//
|
//
|
||||||
|
|
|
@ -13,8 +13,8 @@ const (
|
||||||
// ErrCodeImageAlreadyExistsException for service response error code
|
// ErrCodeImageAlreadyExistsException for service response error code
|
||||||
// "ImageAlreadyExistsException".
|
// "ImageAlreadyExistsException".
|
||||||
//
|
//
|
||||||
// The specified image has already been pushed, and there are no changes to
|
// The specified image has already been pushed, and there were no changes to
|
||||||
// the manifest or image tag since the last push.
|
// the manifest or image tag after the last push.
|
||||||
ErrCodeImageAlreadyExistsException = "ImageAlreadyExistsException"
|
ErrCodeImageAlreadyExistsException = "ImageAlreadyExistsException"
|
||||||
|
|
||||||
// ErrCodeImageNotFoundException for service response error code
|
// ErrCodeImageNotFoundException for service response error code
|
||||||
|
@ -70,13 +70,32 @@ const (
|
||||||
// for this repository.
|
// for this repository.
|
||||||
ErrCodeLayersNotFoundException = "LayersNotFoundException"
|
ErrCodeLayersNotFoundException = "LayersNotFoundException"
|
||||||
|
|
||||||
|
// ErrCodeLifecyclePolicyNotFoundException for service response error code
|
||||||
|
// "LifecyclePolicyNotFoundException".
|
||||||
|
//
|
||||||
|
// The lifecycle policy could not be found, and no policy is set to the repository.
|
||||||
|
ErrCodeLifecyclePolicyNotFoundException = "LifecyclePolicyNotFoundException"
|
||||||
|
|
||||||
|
// ErrCodeLifecyclePolicyPreviewInProgressException for service response error code
|
||||||
|
// "LifecyclePolicyPreviewInProgressException".
|
||||||
|
//
|
||||||
|
// The previous lifecycle policy preview request has not completed. Please try
|
||||||
|
// again later.
|
||||||
|
ErrCodeLifecyclePolicyPreviewInProgressException = "LifecyclePolicyPreviewInProgressException"
|
||||||
|
|
||||||
|
// ErrCodeLifecyclePolicyPreviewNotFoundException for service response error code
|
||||||
|
// "LifecyclePolicyPreviewNotFoundException".
|
||||||
|
//
|
||||||
|
// There is no dry run for this repository.
|
||||||
|
ErrCodeLifecyclePolicyPreviewNotFoundException = "LifecyclePolicyPreviewNotFoundException"
|
||||||
|
|
||||||
// ErrCodeLimitExceededException for service response error code
|
// ErrCodeLimitExceededException for service response error code
|
||||||
// "LimitExceededException".
|
// "LimitExceededException".
|
||||||
//
|
//
|
||||||
// The operation did not succeed because it would have exceeded a service limit
|
// The operation did not succeed because it would have exceeded a service limit
|
||||||
// for your account. For more information, see Amazon ECR Default Service Limits
|
// for your account. For more information, see Amazon ECR Default Service Limits
|
||||||
// (http://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html)
|
// (http://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html)
|
||||||
// in the Amazon EC2 Container Registry User Guide.
|
// in the Amazon Elastic Container Registry User Guide.
|
||||||
ErrCodeLimitExceededException = "LimitExceededException"
|
ErrCodeLimitExceededException = "LimitExceededException"
|
||||||
|
|
||||||
// ErrCodeRepositoryAlreadyExistsException for service response error code
|
// ErrCodeRepositoryAlreadyExistsException for service response error code
|
||||||
|
|
|
@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||||
|
|
||||||
// Service information constants
|
// Service information constants
|
||||||
const (
|
const (
|
||||||
ServiceName = "ecr" // Service endpoint prefix API calls made to.
|
ServiceName = "ecr" // Name of service.
|
||||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||||
|
ServiceID = "ECR" // ServiceID is a unique identifer of a specific service.
|
||||||
)
|
)
|
||||||
|
|
||||||
// New creates a new instance of the ECR client with a session.
|
// New creates a new instance of the ECR client with a session.
|
||||||
|
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
|
||||||
cfg,
|
cfg,
|
||||||
metadata.ClientInfo{
|
metadata.ClientInfo{
|
||||||
ServiceName: ServiceName,
|
ServiceName: ServiceName,
|
||||||
|
ServiceID: ServiceID,
|
||||||
SigningName: signingName,
|
SigningName: signingName,
|
||||||
SigningRegion: signingRegion,
|
SigningRegion: signingRegion,
|
||||||
Endpoint: endpoint,
|
Endpoint: endpoint,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,27 +3,22 @@
|
||||||
// Package elb provides the client and types for making API
|
// Package elb provides the client and types for making API
|
||||||
// requests to Elastic Load Balancing.
|
// requests to Elastic Load Balancing.
|
||||||
//
|
//
|
||||||
// A load balancer distributes incoming traffic across your EC2 instances. This
|
// A load balancer can distribute incoming traffic across your EC2 instances.
|
||||||
// enables you to increase the availability of your application. The load balancer
|
// This enables you to increase the availability of your application. The load
|
||||||
// also monitors the health of its registered instances and ensures that it
|
// balancer also monitors the health of its registered instances and ensures
|
||||||
// routes traffic only to healthy instances. You configure your load balancer
|
// that it routes traffic only to healthy instances. You configure your load
|
||||||
// to accept incoming traffic by specifying one or more listeners, which are
|
// balancer to accept incoming traffic by specifying one or more listeners,
|
||||||
// configured with a protocol and port number for connections from clients to
|
// which are configured with a protocol and port number for connections from
|
||||||
// the load balancer and a protocol and port number for connections from the
|
// clients to the load balancer and a protocol and port number for connections
|
||||||
// load balancer to the instances.
|
// from the load balancer to the instances.
|
||||||
//
|
//
|
||||||
// Elastic Load Balancing supports two types of load balancers: Classic Load
|
// Elastic Load Balancing supports three types of load balancers: Application
|
||||||
// Balancers and Application Load Balancers (new). A Classic Load Balancer makes
|
// Load Balancers, Network Load Balancers, and Classic Load Balancers. You can
|
||||||
// routing and load balancing decisions either at the transport layer (TCP/SSL)
|
// select a load balancer based on your application needs. For more information,
|
||||||
// or the application layer (HTTP/HTTPS), and supports either EC2-Classic or
|
// see the Elastic Load Balancing User Guide (http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/).
|
||||||
// a VPC. An Application Load Balancer makes routing and load balancing decisions
|
|
||||||
// at the application layer (HTTP/HTTPS), supports path-based routing, and can
|
|
||||||
// route requests to one or more ports on each EC2 instance or container instance
|
|
||||||
// in your virtual private cloud (VPC). For more information, see the Elastic
|
|
||||||
// Load Balancing User Guide (http://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/what-is-load-balancing.html).
|
|
||||||
//
|
//
|
||||||
// This reference covers the 2012-06-01 API, which supports Classic Load Balancers.
|
// This reference covers the 2012-06-01 API, which supports Classic Load Balancers.
|
||||||
// The 2015-12-01 API supports Application Load Balancers.
|
// The 2015-12-01 API supports Application Load Balancers and Network Load Balancers.
|
||||||
//
|
//
|
||||||
// To get started, create a load balancer with one or more listeners using CreateLoadBalancer.
|
// To get started, create a load balancer with one or more listeners using CreateLoadBalancer.
|
||||||
// Register your instances with the load balancer using RegisterInstancesWithLoadBalancer.
|
// Register your instances with the load balancer using RegisterInstancesWithLoadBalancer.
|
||||||
|
@ -39,7 +34,7 @@
|
||||||
//
|
//
|
||||||
// Using the Client
|
// Using the Client
|
||||||
//
|
//
|
||||||
// To Elastic Load Balancing with the SDK use the New function to create
|
// To contact Elastic Load Balancing with the SDK use the New function to create
|
||||||
// a new service client. With that client you can make API requests to the service.
|
// a new service client. With that client you can make API requests to the service.
|
||||||
// These clients are safe to use concurrently.
|
// These clients are safe to use concurrently.
|
||||||
//
|
//
|
||||||
|
|
|
@ -91,6 +91,12 @@ const (
|
||||||
// The specified load balancer attribute does not exist.
|
// The specified load balancer attribute does not exist.
|
||||||
ErrCodeLoadBalancerAttributeNotFoundException = "LoadBalancerAttributeNotFound"
|
ErrCodeLoadBalancerAttributeNotFoundException = "LoadBalancerAttributeNotFound"
|
||||||
|
|
||||||
|
// ErrCodeOperationNotPermittedException for service response error code
|
||||||
|
// "OperationNotPermitted".
|
||||||
|
//
|
||||||
|
// This operation is not allowed.
|
||||||
|
ErrCodeOperationNotPermittedException = "OperationNotPermitted"
|
||||||
|
|
||||||
// ErrCodePolicyNotFoundException for service response error code
|
// ErrCodePolicyNotFoundException for service response error code
|
||||||
// "PolicyNotFound".
|
// "PolicyNotFound".
|
||||||
//
|
//
|
||||||
|
|
|
@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||||
|
|
||||||
// Service information constants
|
// Service information constants
|
||||||
const (
|
const (
|
||||||
ServiceName = "elasticloadbalancing" // Service endpoint prefix API calls made to.
|
ServiceName = "elasticloadbalancing" // Name of service.
|
||||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||||
|
ServiceID = "Elastic Load Balancing" // ServiceID is a unique identifer of a specific service.
|
||||||
)
|
)
|
||||||
|
|
||||||
// New creates a new instance of the ELB client with a session.
|
// New creates a new instance of the ELB client with a session.
|
||||||
|
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
|
||||||
cfg,
|
cfg,
|
||||||
metadata.ClientInfo{
|
metadata.ClientInfo{
|
||||||
ServiceName: ServiceName,
|
ServiceName: ServiceName,
|
||||||
|
ServiceID: ServiceID,
|
||||||
SigningName: signingName,
|
SigningName: signingName,
|
||||||
SigningRegion: signingRegion,
|
SigningRegion: signingRegion,
|
||||||
Endpoint: endpoint,
|
Endpoint: endpoint,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -60,7 +60,7 @@
|
||||||
//
|
//
|
||||||
// Using the Client
|
// Using the Client
|
||||||
//
|
//
|
||||||
// To Elastic Load Balancing with the SDK use the New function to create
|
// To contact Elastic Load Balancing with the SDK use the New function to create
|
||||||
// a new service client. With that client you can make API requests to the service.
|
// a new service client. With that client you can make API requests to the service.
|
||||||
// These clients are safe to use concurrently.
|
// These clients are safe to use concurrently.
|
||||||
//
|
//
|
||||||
|
|
|
@ -65,6 +65,12 @@ const (
|
||||||
// The requested configuration is not valid.
|
// The requested configuration is not valid.
|
||||||
ErrCodeInvalidConfigurationRequestException = "InvalidConfigurationRequest"
|
ErrCodeInvalidConfigurationRequestException = "InvalidConfigurationRequest"
|
||||||
|
|
||||||
|
// ErrCodeInvalidLoadBalancerActionException for service response error code
|
||||||
|
// "InvalidLoadBalancerAction".
|
||||||
|
//
|
||||||
|
// The requested action is not valid.
|
||||||
|
ErrCodeInvalidLoadBalancerActionException = "InvalidLoadBalancerAction"
|
||||||
|
|
||||||
// ErrCodeInvalidSchemeException for service response error code
|
// ErrCodeInvalidSchemeException for service response error code
|
||||||
// "InvalidScheme".
|
// "InvalidScheme".
|
||||||
//
|
//
|
||||||
|
@ -86,8 +92,8 @@ const (
|
||||||
// ErrCodeInvalidTargetException for service response error code
|
// ErrCodeInvalidTargetException for service response error code
|
||||||
// "InvalidTarget".
|
// "InvalidTarget".
|
||||||
//
|
//
|
||||||
// The specified target does not exist or is not in the same VPC as the target
|
// The specified target does not exist, is not in the same VPC as the target
|
||||||
// group.
|
// group, or has an unsupported instance type.
|
||||||
ErrCodeInvalidTargetException = "InvalidTarget"
|
ErrCodeInvalidTargetException = "InvalidTarget"
|
||||||
|
|
||||||
// ErrCodeListenerNotFoundException for service response error code
|
// ErrCodeListenerNotFoundException for service response error code
|
||||||
|
@ -150,10 +156,16 @@ const (
|
||||||
// The specified target group does not exist.
|
// The specified target group does not exist.
|
||||||
ErrCodeTargetGroupNotFoundException = "TargetGroupNotFound"
|
ErrCodeTargetGroupNotFoundException = "TargetGroupNotFound"
|
||||||
|
|
||||||
|
// ErrCodeTooManyActionsException for service response error code
|
||||||
|
// "TooManyActions".
|
||||||
|
//
|
||||||
|
// You've reached the limit on the number of actions per rule.
|
||||||
|
ErrCodeTooManyActionsException = "TooManyActions"
|
||||||
|
|
||||||
// ErrCodeTooManyCertificatesException for service response error code
|
// ErrCodeTooManyCertificatesException for service response error code
|
||||||
// "TooManyCertificates".
|
// "TooManyCertificates".
|
||||||
//
|
//
|
||||||
// You've reached the limit on the number of certificates per listener.
|
// You've reached the limit on the number of certificates per load balancer.
|
||||||
ErrCodeTooManyCertificatesException = "TooManyCertificates"
|
ErrCodeTooManyCertificatesException = "TooManyCertificates"
|
||||||
|
|
||||||
// ErrCodeTooManyListenersException for service response error code
|
// ErrCodeTooManyListenersException for service response error code
|
||||||
|
|
|
@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||||
|
|
||||||
// Service information constants
|
// Service information constants
|
||||||
const (
|
const (
|
||||||
ServiceName = "elasticloadbalancing" // Service endpoint prefix API calls made to.
|
ServiceName = "elasticloadbalancing" // Name of service.
|
||||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||||
|
ServiceID = "Elastic Load Balancing v2" // ServiceID is a unique identifer of a specific service.
|
||||||
)
|
)
|
||||||
|
|
||||||
// New creates a new instance of the ELBV2 client with a session.
|
// New creates a new instance of the ELBV2 client with a session.
|
||||||
|
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
|
||||||
cfg,
|
cfg,
|
||||||
metadata.ClientInfo{
|
metadata.ClientInfo{
|
||||||
ServiceName: ServiceName,
|
ServiceName: ServiceName,
|
||||||
|
ServiceID: ServiceID,
|
||||||
SigningName: signingName,
|
SigningName: signingName,
|
||||||
SigningRegion: signingRegion,
|
SigningRegion: signingRegion,
|
||||||
Endpoint: endpoint,
|
Endpoint: endpoint,
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -82,7 +82,7 @@
|
||||||
//
|
//
|
||||||
// Using the Client
|
// Using the Client
|
||||||
//
|
//
|
||||||
// To AWS Key Management Service with the SDK use the New function to create
|
// To contact AWS Key Management Service with the SDK use the New function to create
|
||||||
// a new service client. With that client you can make API requests to the service.
|
// a new service client. With that client you can make API requests to the service.
|
||||||
// These clients are safe to use concurrently.
|
// These clients are safe to use concurrently.
|
||||||
//
|
//
|
||||||
|
|
|
@ -28,9 +28,8 @@ const (
|
||||||
// "ExpiredImportTokenException".
|
// "ExpiredImportTokenException".
|
||||||
//
|
//
|
||||||
// The request was rejected because the provided import token is expired. Use
|
// The request was rejected because the provided import token is expired. Use
|
||||||
// GetParametersForImport to retrieve a new import token and public key, use
|
// GetParametersForImport to get a new import token and public key, use the
|
||||||
// the new public key to encrypt the key material, and then try the request
|
// new public key to encrypt the key material, and then try the request again.
|
||||||
// again.
|
|
||||||
ErrCodeExpiredImportTokenException = "ExpiredImportTokenException"
|
ErrCodeExpiredImportTokenException = "ExpiredImportTokenException"
|
||||||
|
|
||||||
// ErrCodeIncorrectKeyMaterialException for service response error code
|
// ErrCodeIncorrectKeyMaterialException for service response error code
|
||||||
|
@ -42,11 +41,11 @@ const (
|
||||||
ErrCodeIncorrectKeyMaterialException = "IncorrectKeyMaterialException"
|
ErrCodeIncorrectKeyMaterialException = "IncorrectKeyMaterialException"
|
||||||
|
|
||||||
// ErrCodeInternalException for service response error code
|
// ErrCodeInternalException for service response error code
|
||||||
// "InternalException".
|
// "KMSInternalException".
|
||||||
//
|
//
|
||||||
// The request was rejected because an internal exception occurred. The request
|
// The request was rejected because an internal exception occurred. The request
|
||||||
// can be retried.
|
// can be retried.
|
||||||
ErrCodeInternalException = "InternalException"
|
ErrCodeInternalException = "KMSInternalException"
|
||||||
|
|
||||||
// ErrCodeInvalidAliasNameException for service response error code
|
// ErrCodeInvalidAliasNameException for service response error code
|
||||||
// "InvalidAliasNameException".
|
// "InvalidAliasNameException".
|
||||||
|
@ -63,8 +62,9 @@ const (
|
||||||
// ErrCodeInvalidCiphertextException for service response error code
|
// ErrCodeInvalidCiphertextException for service response error code
|
||||||
// "InvalidCiphertextException".
|
// "InvalidCiphertextException".
|
||||||
//
|
//
|
||||||
// The request was rejected because the specified ciphertext has been corrupted
|
// The request was rejected because the specified ciphertext, or additional
|
||||||
// or is otherwise invalid.
|
// authenticated data incorporated into the ciphertext, such as the encryption
|
||||||
|
// context, is corrupted, missing, or otherwise invalid.
|
||||||
ErrCodeInvalidCiphertextException = "InvalidCiphertextException"
|
ErrCodeInvalidCiphertextException = "InvalidCiphertextException"
|
||||||
|
|
||||||
// ErrCodeInvalidGrantIdException for service response error code
|
// ErrCodeInvalidGrantIdException for service response error code
|
||||||
|
@ -100,7 +100,7 @@ const (
|
||||||
ErrCodeInvalidMarkerException = "InvalidMarkerException"
|
ErrCodeInvalidMarkerException = "InvalidMarkerException"
|
||||||
|
|
||||||
// ErrCodeInvalidStateException for service response error code
|
// ErrCodeInvalidStateException for service response error code
|
||||||
// "InvalidStateException".
|
// "KMSInvalidStateException".
|
||||||
//
|
//
|
||||||
// The request was rejected because the state of the specified resource is not
|
// The request was rejected because the state of the specified resource is not
|
||||||
// valid for this request.
|
// valid for this request.
|
||||||
|
@ -108,7 +108,7 @@ const (
|
||||||
// For more information about how key state affects the use of a CMK, see How
|
// For more information about how key state affects the use of a CMK, see How
|
||||||
// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
|
// Key State Affects Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html)
|
||||||
// in the AWS Key Management Service Developer Guide.
|
// in the AWS Key Management Service Developer Guide.
|
||||||
ErrCodeInvalidStateException = "InvalidStateException"
|
ErrCodeInvalidStateException = "KMSInvalidStateException"
|
||||||
|
|
||||||
// ErrCodeKeyUnavailableException for service response error code
|
// ErrCodeKeyUnavailableException for service response error code
|
||||||
// "KeyUnavailableException".
|
// "KeyUnavailableException".
|
||||||
|
|
|
@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||||
|
|
||||||
// Service information constants
|
// Service information constants
|
||||||
const (
|
const (
|
||||||
ServiceName = "kms" // Service endpoint prefix API calls made to.
|
ServiceName = "kms" // Name of service.
|
||||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||||
|
ServiceID = "KMS" // ServiceID is a unique identifer of a specific service.
|
||||||
)
|
)
|
||||||
|
|
||||||
// New creates a new instance of the KMS client with a session.
|
// New creates a new instance of the KMS client with a session.
|
||||||
|
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
|
||||||
cfg,
|
cfg,
|
||||||
metadata.ClientInfo{
|
metadata.ClientInfo{
|
||||||
ServiceName: ServiceName,
|
ServiceName: ServiceName,
|
||||||
|
ServiceID: ServiceID,
|
||||||
SigningName: signingName,
|
SigningName: signingName,
|
||||||
SigningRegion: signingRegion,
|
SigningRegion: signingRegion,
|
||||||
Endpoint: endpoint,
|
Endpoint: endpoint,
|
||||||
|
|
|
@ -14,7 +14,7 @@ const opAssumeRole = "AssumeRole"
|
||||||
|
|
||||||
// AssumeRoleRequest generates a "aws/request.Request" representing the
|
// AssumeRoleRequest generates a "aws/request.Request" representing the
|
||||||
// client's request for the AssumeRole operation. The "output" return
|
// client's request for the AssumeRole operation. The "output" return
|
||||||
// value will be populated with the request's response once the request complets
|
// value will be populated with the request's response once the request completes
|
||||||
// successfuly.
|
// successfuly.
|
||||||
//
|
//
|
||||||
// Use "Send" method on the returned Request to send the API call to the service.
|
// Use "Send" method on the returned Request to send the API call to the service.
|
||||||
|
@ -35,7 +35,7 @@ const opAssumeRole = "AssumeRole"
|
||||||
// fmt.Println(resp)
|
// fmt.Println(resp)
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole
|
||||||
func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput) {
|
func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, output *AssumeRoleOutput) {
|
||||||
op := &request.Operation{
|
op := &request.Operation{
|
||||||
Name: opAssumeRole,
|
Name: opAssumeRole,
|
||||||
|
@ -88,9 +88,18 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
|
||||||
// Scenarios for Temporary Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html#sts-introduction)
|
// Scenarios for Temporary Credentials (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html#sts-introduction)
|
||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// The temporary security credentials are valid for the duration that you specified
|
// By default, the temporary security credentials created by AssumeRole last
|
||||||
// when calling AssumeRole, which can be from 900 seconds (15 minutes) to a
|
// for one hour. However, you can use the optional DurationSeconds parameter
|
||||||
// maximum of 3600 seconds (1 hour). The default is 1 hour.
|
// to specify the duration of your session. You can provide a value from 900
|
||||||
|
// seconds (15 minutes) up to the maximum session duration setting for the role.
|
||||||
|
// This setting can have a value from 1 hour to 12 hours. To learn how to view
|
||||||
|
// the maximum value for your role, see View the Maximum Session Duration Setting
|
||||||
|
// for a Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||||
|
// in the IAM User Guide. The maximum session duration limit applies when you
|
||||||
|
// use the AssumeRole* API operations or the assume-role* CLI operations but
|
||||||
|
// does not apply when you use those operations to create a console URL. For
|
||||||
|
// more information, see Using IAM Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
|
||||||
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// The temporary security credentials created by AssumeRole can be used to make
|
// The temporary security credentials created by AssumeRole can be used to make
|
||||||
// API calls to any AWS service with the following exception: you cannot call
|
// API calls to any AWS service with the following exception: you cannot call
|
||||||
|
@ -121,7 +130,12 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
|
||||||
// the user to call AssumeRole on the ARN of the role in the other account.
|
// the user to call AssumeRole on the ARN of the role in the other account.
|
||||||
// If the user is in the same account as the role, then you can either attach
|
// If the user is in the same account as the role, then you can either attach
|
||||||
// a policy to the user (identical to the previous different account user),
|
// a policy to the user (identical to the previous different account user),
|
||||||
// or you can add the user as a principal directly in the role's trust policy
|
// or you can add the user as a principal directly in the role's trust policy.
|
||||||
|
// In this case, the trust policy acts as the only resource-based policy in
|
||||||
|
// IAM, and users in the same account as the role do not need explicit permission
|
||||||
|
// to assume the role. For more information about trust policies and resource-based
|
||||||
|
// policies, see IAM Policies (http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
|
||||||
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// Using MFA with AssumeRole
|
// Using MFA with AssumeRole
|
||||||
//
|
//
|
||||||
|
@ -168,7 +182,7 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o
|
||||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRole
|
||||||
func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error) {
|
func (c *STS) AssumeRole(input *AssumeRoleInput) (*AssumeRoleOutput, error) {
|
||||||
req, out := c.AssumeRoleRequest(input)
|
req, out := c.AssumeRoleRequest(input)
|
||||||
return out, req.Send()
|
return out, req.Send()
|
||||||
|
@ -194,7 +208,7 @@ const opAssumeRoleWithSAML = "AssumeRoleWithSAML"
|
||||||
|
|
||||||
// AssumeRoleWithSAMLRequest generates a "aws/request.Request" representing the
|
// AssumeRoleWithSAMLRequest generates a "aws/request.Request" representing the
|
||||||
// client's request for the AssumeRoleWithSAML operation. The "output" return
|
// client's request for the AssumeRoleWithSAML operation. The "output" return
|
||||||
// value will be populated with the request's response once the request complets
|
// value will be populated with the request's response once the request completes
|
||||||
// successfuly.
|
// successfuly.
|
||||||
//
|
//
|
||||||
// Use "Send" method on the returned Request to send the API call to the service.
|
// Use "Send" method on the returned Request to send the API call to the service.
|
||||||
|
@ -215,7 +229,7 @@ const opAssumeRoleWithSAML = "AssumeRoleWithSAML"
|
||||||
// fmt.Println(resp)
|
// fmt.Println(resp)
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML
|
||||||
func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *request.Request, output *AssumeRoleWithSAMLOutput) {
|
func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *request.Request, output *AssumeRoleWithSAMLOutput) {
|
||||||
op := &request.Operation{
|
op := &request.Operation{
|
||||||
Name: opAssumeRoleWithSAML,
|
Name: opAssumeRoleWithSAML,
|
||||||
|
@ -247,11 +261,20 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
|
||||||
// an access key ID, a secret access key, and a security token. Applications
|
// an access key ID, a secret access key, and a security token. Applications
|
||||||
// can use these temporary security credentials to sign calls to AWS services.
|
// can use these temporary security credentials to sign calls to AWS services.
|
||||||
//
|
//
|
||||||
// The temporary security credentials are valid for the duration that you specified
|
// By default, the temporary security credentials created by AssumeRoleWithSAML
|
||||||
// when calling AssumeRole, or until the time specified in the SAML authentication
|
// last for one hour. However, you can use the optional DurationSeconds parameter
|
||||||
// response's SessionNotOnOrAfter value, whichever is shorter. The duration
|
// to specify the duration of your session. Your role session lasts for the
|
||||||
// can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour).
|
// duration that you specify, or until the time specified in the SAML authentication
|
||||||
// The default is 1 hour.
|
// response's SessionNotOnOrAfter value, whichever is shorter. You can provide
|
||||||
|
// a DurationSeconds value from 900 seconds (15 minutes) up to the maximum session
|
||||||
|
// duration setting for the role. This setting can have a value from 1 hour
|
||||||
|
// to 12 hours. To learn how to view the maximum value for your role, see View
|
||||||
|
// the Maximum Session Duration Setting for a Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||||
|
// in the IAM User Guide. The maximum session duration limit applies when you
|
||||||
|
// use the AssumeRole* API operations or the assume-role* CLI operations but
|
||||||
|
// does not apply when you use those operations to create a console URL. For
|
||||||
|
// more information, see Using IAM Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
|
||||||
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// The temporary security credentials created by AssumeRoleWithSAML can be used
|
// The temporary security credentials created by AssumeRoleWithSAML can be used
|
||||||
// to make API calls to any AWS service with the following exception: you cannot
|
// to make API calls to any AWS service with the following exception: you cannot
|
||||||
|
@ -341,7 +364,7 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re
|
||||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAML
|
||||||
func (c *STS) AssumeRoleWithSAML(input *AssumeRoleWithSAMLInput) (*AssumeRoleWithSAMLOutput, error) {
|
func (c *STS) AssumeRoleWithSAML(input *AssumeRoleWithSAMLInput) (*AssumeRoleWithSAMLOutput, error) {
|
||||||
req, out := c.AssumeRoleWithSAMLRequest(input)
|
req, out := c.AssumeRoleWithSAMLRequest(input)
|
||||||
return out, req.Send()
|
return out, req.Send()
|
||||||
|
@ -367,7 +390,7 @@ const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity"
|
||||||
|
|
||||||
// AssumeRoleWithWebIdentityRequest generates a "aws/request.Request" representing the
|
// AssumeRoleWithWebIdentityRequest generates a "aws/request.Request" representing the
|
||||||
// client's request for the AssumeRoleWithWebIdentity operation. The "output" return
|
// client's request for the AssumeRoleWithWebIdentity operation. The "output" return
|
||||||
// value will be populated with the request's response once the request complets
|
// value will be populated with the request's response once the request completes
|
||||||
// successfuly.
|
// successfuly.
|
||||||
//
|
//
|
||||||
// Use "Send" method on the returned Request to send the API call to the service.
|
// Use "Send" method on the returned Request to send the API call to the service.
|
||||||
|
@ -388,7 +411,7 @@ const opAssumeRoleWithWebIdentity = "AssumeRoleWithWebIdentity"
|
||||||
// fmt.Println(resp)
|
// fmt.Println(resp)
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity
|
||||||
func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityInput) (req *request.Request, output *AssumeRoleWithWebIdentityOutput) {
|
func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityInput) (req *request.Request, output *AssumeRoleWithWebIdentityOutput) {
|
||||||
op := &request.Operation{
|
op := &request.Operation{
|
||||||
Name: opAssumeRoleWithWebIdentity,
|
Name: opAssumeRoleWithWebIdentity,
|
||||||
|
@ -438,9 +461,18 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
|
||||||
// key ID, a secret access key, and a security token. Applications can use these
|
// key ID, a secret access key, and a security token. Applications can use these
|
||||||
// temporary security credentials to sign calls to AWS service APIs.
|
// temporary security credentials to sign calls to AWS service APIs.
|
||||||
//
|
//
|
||||||
// The credentials are valid for the duration that you specified when calling
|
// By default, the temporary security credentials created by AssumeRoleWithWebIdentity
|
||||||
// AssumeRoleWithWebIdentity, which can be from 900 seconds (15 minutes) to
|
// last for one hour. However, you can use the optional DurationSeconds parameter
|
||||||
// a maximum of 3600 seconds (1 hour). The default is 1 hour.
|
// to specify the duration of your session. You can provide a value from 900
|
||||||
|
// seconds (15 minutes) up to the maximum session duration setting for the role.
|
||||||
|
// This setting can have a value from 1 hour to 12 hours. To learn how to view
|
||||||
|
// the maximum value for your role, see View the Maximum Session Duration Setting
|
||||||
|
// for a Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||||
|
// in the IAM User Guide. The maximum session duration limit applies when you
|
||||||
|
// use the AssumeRole* API operations or the assume-role* CLI operations but
|
||||||
|
// does not apply when you use those operations to create a console URL. For
|
||||||
|
// more information, see Using IAM Roles (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
|
||||||
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// The temporary security credentials created by AssumeRoleWithWebIdentity can
|
// The temporary security credentials created by AssumeRoleWithWebIdentity can
|
||||||
// be used to make API calls to any AWS service with the following exception:
|
// be used to make API calls to any AWS service with the following exception:
|
||||||
|
@ -492,7 +524,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
|
||||||
// the information from these providers to get and use temporary security
|
// the information from these providers to get and use temporary security
|
||||||
// credentials.
|
// credentials.
|
||||||
//
|
//
|
||||||
// * Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/4617974389850313).
|
// * Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications).
|
||||||
// This article discusses web identity federation and shows an example of
|
// This article discusses web identity federation and shows an example of
|
||||||
// how to use web identity federation to get access to content in Amazon
|
// how to use web identity federation to get access to content in Amazon
|
||||||
// S3.
|
// S3.
|
||||||
|
@ -543,7 +575,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI
|
||||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentity
|
||||||
func (c *STS) AssumeRoleWithWebIdentity(input *AssumeRoleWithWebIdentityInput) (*AssumeRoleWithWebIdentityOutput, error) {
|
func (c *STS) AssumeRoleWithWebIdentity(input *AssumeRoleWithWebIdentityInput) (*AssumeRoleWithWebIdentityOutput, error) {
|
||||||
req, out := c.AssumeRoleWithWebIdentityRequest(input)
|
req, out := c.AssumeRoleWithWebIdentityRequest(input)
|
||||||
return out, req.Send()
|
return out, req.Send()
|
||||||
|
@ -569,7 +601,7 @@ const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage"
|
||||||
|
|
||||||
// DecodeAuthorizationMessageRequest generates a "aws/request.Request" representing the
|
// DecodeAuthorizationMessageRequest generates a "aws/request.Request" representing the
|
||||||
// client's request for the DecodeAuthorizationMessage operation. The "output" return
|
// client's request for the DecodeAuthorizationMessage operation. The "output" return
|
||||||
// value will be populated with the request's response once the request complets
|
// value will be populated with the request's response once the request completes
|
||||||
// successfuly.
|
// successfuly.
|
||||||
//
|
//
|
||||||
// Use "Send" method on the returned Request to send the API call to the service.
|
// Use "Send" method on the returned Request to send the API call to the service.
|
||||||
|
@ -590,7 +622,7 @@ const opDecodeAuthorizationMessage = "DecodeAuthorizationMessage"
|
||||||
// fmt.Println(resp)
|
// fmt.Println(resp)
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage
|
||||||
func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessageInput) (req *request.Request, output *DecodeAuthorizationMessageOutput) {
|
func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessageInput) (req *request.Request, output *DecodeAuthorizationMessageOutput) {
|
||||||
op := &request.Operation{
|
op := &request.Operation{
|
||||||
Name: opDecodeAuthorizationMessage,
|
Name: opDecodeAuthorizationMessage,
|
||||||
|
@ -655,7 +687,7 @@ func (c *STS) DecodeAuthorizationMessageRequest(input *DecodeAuthorizationMessag
|
||||||
// invalid. This can happen if the token contains invalid characters, such as
|
// invalid. This can happen if the token contains invalid characters, such as
|
||||||
// linebreaks.
|
// linebreaks.
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessage
|
||||||
func (c *STS) DecodeAuthorizationMessage(input *DecodeAuthorizationMessageInput) (*DecodeAuthorizationMessageOutput, error) {
|
func (c *STS) DecodeAuthorizationMessage(input *DecodeAuthorizationMessageInput) (*DecodeAuthorizationMessageOutput, error) {
|
||||||
req, out := c.DecodeAuthorizationMessageRequest(input)
|
req, out := c.DecodeAuthorizationMessageRequest(input)
|
||||||
return out, req.Send()
|
return out, req.Send()
|
||||||
|
@ -681,7 +713,7 @@ const opGetCallerIdentity = "GetCallerIdentity"
|
||||||
|
|
||||||
// GetCallerIdentityRequest generates a "aws/request.Request" representing the
|
// GetCallerIdentityRequest generates a "aws/request.Request" representing the
|
||||||
// client's request for the GetCallerIdentity operation. The "output" return
|
// client's request for the GetCallerIdentity operation. The "output" return
|
||||||
// value will be populated with the request's response once the request complets
|
// value will be populated with the request's response once the request completes
|
||||||
// successfuly.
|
// successfuly.
|
||||||
//
|
//
|
||||||
// Use "Send" method on the returned Request to send the API call to the service.
|
// Use "Send" method on the returned Request to send the API call to the service.
|
||||||
|
@ -702,7 +734,7 @@ const opGetCallerIdentity = "GetCallerIdentity"
|
||||||
// fmt.Println(resp)
|
// fmt.Println(resp)
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity
|
||||||
func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *request.Request, output *GetCallerIdentityOutput) {
|
func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *request.Request, output *GetCallerIdentityOutput) {
|
||||||
op := &request.Operation{
|
op := &request.Operation{
|
||||||
Name: opGetCallerIdentity,
|
Name: opGetCallerIdentity,
|
||||||
|
@ -730,7 +762,7 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ
|
||||||
//
|
//
|
||||||
// See the AWS API reference guide for AWS Security Token Service's
|
// See the AWS API reference guide for AWS Security Token Service's
|
||||||
// API operation GetCallerIdentity for usage and error information.
|
// API operation GetCallerIdentity for usage and error information.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentity
|
||||||
func (c *STS) GetCallerIdentity(input *GetCallerIdentityInput) (*GetCallerIdentityOutput, error) {
|
func (c *STS) GetCallerIdentity(input *GetCallerIdentityInput) (*GetCallerIdentityOutput, error) {
|
||||||
req, out := c.GetCallerIdentityRequest(input)
|
req, out := c.GetCallerIdentityRequest(input)
|
||||||
return out, req.Send()
|
return out, req.Send()
|
||||||
|
@ -756,7 +788,7 @@ const opGetFederationToken = "GetFederationToken"
|
||||||
|
|
||||||
// GetFederationTokenRequest generates a "aws/request.Request" representing the
|
// GetFederationTokenRequest generates a "aws/request.Request" representing the
|
||||||
// client's request for the GetFederationToken operation. The "output" return
|
// client's request for the GetFederationToken operation. The "output" return
|
||||||
// value will be populated with the request's response once the request complets
|
// value will be populated with the request's response once the request completes
|
||||||
// successfuly.
|
// successfuly.
|
||||||
//
|
//
|
||||||
// Use "Send" method on the returned Request to send the API call to the service.
|
// Use "Send" method on the returned Request to send the API call to the service.
|
||||||
|
@ -777,7 +809,7 @@ const opGetFederationToken = "GetFederationToken"
|
||||||
// fmt.Println(resp)
|
// fmt.Println(resp)
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken
|
||||||
func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *request.Request, output *GetFederationTokenOutput) {
|
func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *request.Request, output *GetFederationTokenOutput) {
|
||||||
op := &request.Operation{
|
op := &request.Operation{
|
||||||
Name: opGetFederationToken,
|
Name: opGetFederationToken,
|
||||||
|
@ -899,7 +931,7 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re
|
||||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationToken
|
||||||
func (c *STS) GetFederationToken(input *GetFederationTokenInput) (*GetFederationTokenOutput, error) {
|
func (c *STS) GetFederationToken(input *GetFederationTokenInput) (*GetFederationTokenOutput, error) {
|
||||||
req, out := c.GetFederationTokenRequest(input)
|
req, out := c.GetFederationTokenRequest(input)
|
||||||
return out, req.Send()
|
return out, req.Send()
|
||||||
|
@ -925,7 +957,7 @@ const opGetSessionToken = "GetSessionToken"
|
||||||
|
|
||||||
// GetSessionTokenRequest generates a "aws/request.Request" representing the
|
// GetSessionTokenRequest generates a "aws/request.Request" representing the
|
||||||
// client's request for the GetSessionToken operation. The "output" return
|
// client's request for the GetSessionToken operation. The "output" return
|
||||||
// value will be populated with the request's response once the request complets
|
// value will be populated with the request's response once the request completes
|
||||||
// successfuly.
|
// successfuly.
|
||||||
//
|
//
|
||||||
// Use "Send" method on the returned Request to send the API call to the service.
|
// Use "Send" method on the returned Request to send the API call to the service.
|
||||||
|
@ -946,7 +978,7 @@ const opGetSessionToken = "GetSessionToken"
|
||||||
// fmt.Println(resp)
|
// fmt.Println(resp)
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken
|
||||||
func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.Request, output *GetSessionTokenOutput) {
|
func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.Request, output *GetSessionTokenOutput) {
|
||||||
op := &request.Operation{
|
op := &request.Operation{
|
||||||
Name: opGetSessionToken,
|
Name: opGetSessionToken,
|
||||||
|
@ -1027,7 +1059,7 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request.
|
||||||
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
// and Deactivating AWS STS in an AWS Region (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken
|
// See also, https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionToken
|
||||||
func (c *STS) GetSessionToken(input *GetSessionTokenInput) (*GetSessionTokenOutput, error) {
|
func (c *STS) GetSessionToken(input *GetSessionTokenInput) (*GetSessionTokenOutput, error) {
|
||||||
req, out := c.GetSessionTokenRequest(input)
|
req, out := c.GetSessionTokenRequest(input)
|
||||||
return out, req.Send()
|
return out, req.Send()
|
||||||
|
@ -1049,20 +1081,27 @@ func (c *STS) GetSessionTokenWithContext(ctx aws.Context, input *GetSessionToken
|
||||||
return out, req.Send()
|
return out, req.Send()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleRequest
|
|
||||||
type AssumeRoleInput struct {
|
type AssumeRoleInput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
// The duration, in seconds, of the role session. The value can range from 900
|
// The duration, in seconds, of the role session. The value can range from 900
|
||||||
// seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set
|
// seconds (15 minutes) up to the maximum session duration setting for the role.
|
||||||
// to 3600 seconds.
|
// This setting can have a value from 1 hour to 12 hours. If you specify a value
|
||||||
|
// higher than this setting, the operation fails. For example, if you specify
|
||||||
|
// a session duration of 12 hours, but your administrator set the maximum session
|
||||||
|
// duration to 6 hours, your operation fails. To learn how to view the maximum
|
||||||
|
// value for your role, see View the Maximum Session Duration Setting for a
|
||||||
|
// Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||||
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// This is separate from the duration of a console session that you might request
|
// By default, the value is set to 3600 seconds.
|
||||||
// using the returned credentials. The request to the federation endpoint for
|
//
|
||||||
// a console sign-in token takes a SessionDuration parameter that specifies
|
// The DurationSeconds parameter is separate from the duration of a console
|
||||||
// the maximum length of the console session, separately from the DurationSeconds
|
// session that you might request using the returned credentials. The request
|
||||||
// parameter on this API. For more information, see Creating a URL that Enables
|
// to the federation endpoint for a console sign-in token takes a SessionDuration
|
||||||
// Federated Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
// parameter that specifies the maximum length of the console session. For more
|
||||||
|
// information, see Creating a URL that Enables Federated Users to Access the
|
||||||
|
// AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
DurationSeconds *int64 `min:"900" type:"integer"`
|
DurationSeconds *int64 `min:"900" type:"integer"`
|
||||||
|
|
||||||
|
@ -1241,7 +1280,6 @@ func (s *AssumeRoleInput) SetTokenCode(v string) *AssumeRoleInput {
|
||||||
|
|
||||||
// Contains the response to a successful AssumeRole request, including temporary
|
// Contains the response to a successful AssumeRole request, including temporary
|
||||||
// AWS credentials that can be used to make AWS requests.
|
// AWS credentials that can be used to make AWS requests.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleResponse
|
|
||||||
type AssumeRoleOutput struct {
|
type AssumeRoleOutput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -1295,22 +1333,30 @@ func (s *AssumeRoleOutput) SetPackedPolicySize(v int64) *AssumeRoleOutput {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAMLRequest
|
|
||||||
type AssumeRoleWithSAMLInput struct {
|
type AssumeRoleWithSAMLInput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
// The duration, in seconds, of the role session. The value can range from 900
|
// The duration, in seconds, of the role session. Your role session lasts for
|
||||||
// seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set
|
// the duration that you specify for the DurationSeconds parameter, or until
|
||||||
// to 3600 seconds. An expiration can also be specified in the SAML authentication
|
// the time specified in the SAML authentication response's SessionNotOnOrAfter
|
||||||
// response's SessionNotOnOrAfter value. The actual expiration time is whichever
|
// value, whichever is shorter. You can provide a DurationSeconds value from
|
||||||
// value is shorter.
|
// 900 seconds (15 minutes) up to the maximum session duration setting for the
|
||||||
|
// role. This setting can have a value from 1 hour to 12 hours. If you specify
|
||||||
|
// a value higher than this setting, the operation fails. For example, if you
|
||||||
|
// specify a session duration of 12 hours, but your administrator set the maximum
|
||||||
|
// session duration to 6 hours, your operation fails. To learn how to view the
|
||||||
|
// maximum value for your role, see View the Maximum Session Duration Setting
|
||||||
|
// for a Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||||
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// This is separate from the duration of a console session that you might request
|
// By default, the value is set to 3600 seconds.
|
||||||
// using the returned credentials. The request to the federation endpoint for
|
//
|
||||||
// a console sign-in token takes a SessionDuration parameter that specifies
|
// The DurationSeconds parameter is separate from the duration of a console
|
||||||
// the maximum length of the console session, separately from the DurationSeconds
|
// session that you might request using the returned credentials. The request
|
||||||
// parameter on this API. For more information, see Enabling SAML 2.0 Federated
|
// to the federation endpoint for a console sign-in token takes a SessionDuration
|
||||||
// Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html)
|
// parameter that specifies the maximum length of the console session. For more
|
||||||
|
// information, see Creating a URL that Enables Federated Users to Access the
|
||||||
|
// AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
DurationSeconds *int64 `min:"900" type:"integer"`
|
DurationSeconds *int64 `min:"900" type:"integer"`
|
||||||
|
|
||||||
|
@ -1436,7 +1482,6 @@ func (s *AssumeRoleWithSAMLInput) SetSAMLAssertion(v string) *AssumeRoleWithSAML
|
||||||
|
|
||||||
// Contains the response to a successful AssumeRoleWithSAML request, including
|
// Contains the response to a successful AssumeRoleWithSAML request, including
|
||||||
// temporary AWS credentials that can be used to make AWS requests.
|
// temporary AWS credentials that can be used to make AWS requests.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithSAMLResponse
|
|
||||||
type AssumeRoleWithSAMLOutput struct {
|
type AssumeRoleWithSAMLOutput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -1548,20 +1593,27 @@ func (s *AssumeRoleWithSAMLOutput) SetSubjectType(v string) *AssumeRoleWithSAMLO
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentityRequest
|
|
||||||
type AssumeRoleWithWebIdentityInput struct {
|
type AssumeRoleWithWebIdentityInput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
// The duration, in seconds, of the role session. The value can range from 900
|
// The duration, in seconds, of the role session. The value can range from 900
|
||||||
// seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set
|
// seconds (15 minutes) up to the maximum session duration setting for the role.
|
||||||
// to 3600 seconds.
|
// This setting can have a value from 1 hour to 12 hours. If you specify a value
|
||||||
|
// higher than this setting, the operation fails. For example, if you specify
|
||||||
|
// a session duration of 12 hours, but your administrator set the maximum session
|
||||||
|
// duration to 6 hours, your operation fails. To learn how to view the maximum
|
||||||
|
// value for your role, see View the Maximum Session Duration Setting for a
|
||||||
|
// Role (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||||
|
// in the IAM User Guide.
|
||||||
//
|
//
|
||||||
// This is separate from the duration of a console session that you might request
|
// By default, the value is set to 3600 seconds.
|
||||||
// using the returned credentials. The request to the federation endpoint for
|
//
|
||||||
// a console sign-in token takes a SessionDuration parameter that specifies
|
// The DurationSeconds parameter is separate from the duration of a console
|
||||||
// the maximum length of the console session, separately from the DurationSeconds
|
// session that you might request using the returned credentials. The request
|
||||||
// parameter on this API. For more information, see Creating a URL that Enables
|
// to the federation endpoint for a console sign-in token takes a SessionDuration
|
||||||
// Federated Users to Access the AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
// parameter that specifies the maximum length of the console session. For more
|
||||||
|
// information, see Creating a URL that Enables Federated Users to Access the
|
||||||
|
// AWS Management Console (http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||||
// in the IAM User Guide.
|
// in the IAM User Guide.
|
||||||
DurationSeconds *int64 `min:"900" type:"integer"`
|
DurationSeconds *int64 `min:"900" type:"integer"`
|
||||||
|
|
||||||
|
@ -1711,7 +1763,6 @@ func (s *AssumeRoleWithWebIdentityInput) SetWebIdentityToken(v string) *AssumeRo
|
||||||
|
|
||||||
// Contains the response to a successful AssumeRoleWithWebIdentity request,
|
// Contains the response to a successful AssumeRoleWithWebIdentity request,
|
||||||
// including temporary AWS credentials that can be used to make AWS requests.
|
// including temporary AWS credentials that can be used to make AWS requests.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumeRoleWithWebIdentityResponse
|
|
||||||
type AssumeRoleWithWebIdentityOutput struct {
|
type AssumeRoleWithWebIdentityOutput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -1804,7 +1855,6 @@ func (s *AssumeRoleWithWebIdentityOutput) SetSubjectFromWebIdentityToken(v strin
|
||||||
|
|
||||||
// The identifiers for the temporary security credentials that the operation
|
// The identifiers for the temporary security credentials that the operation
|
||||||
// returns.
|
// returns.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/AssumedRoleUser
|
|
||||||
type AssumedRoleUser struct {
|
type AssumedRoleUser struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -1847,7 +1897,6 @@ func (s *AssumedRoleUser) SetAssumedRoleId(v string) *AssumedRoleUser {
|
||||||
}
|
}
|
||||||
|
|
||||||
// AWS credentials for API authentication.
|
// AWS credentials for API authentication.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/Credentials
|
|
||||||
type Credentials struct {
|
type Credentials struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -1906,7 +1955,6 @@ func (s *Credentials) SetSessionToken(v string) *Credentials {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessageRequest
|
|
||||||
type DecodeAuthorizationMessageInput struct {
|
type DecodeAuthorizationMessageInput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -1951,7 +1999,6 @@ func (s *DecodeAuthorizationMessageInput) SetEncodedMessage(v string) *DecodeAut
|
||||||
// A document that contains additional information about the authorization status
|
// A document that contains additional information about the authorization status
|
||||||
// of a request from an encoded message that is returned in response to an AWS
|
// of a request from an encoded message that is returned in response to an AWS
|
||||||
// request.
|
// request.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/DecodeAuthorizationMessageResponse
|
|
||||||
type DecodeAuthorizationMessageOutput struct {
|
type DecodeAuthorizationMessageOutput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -1976,7 +2023,6 @@ func (s *DecodeAuthorizationMessageOutput) SetDecodedMessage(v string) *DecodeAu
|
||||||
}
|
}
|
||||||
|
|
||||||
// Identifiers for the federated user that is associated with the credentials.
|
// Identifiers for the federated user that is associated with the credentials.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/FederatedUser
|
|
||||||
type FederatedUser struct {
|
type FederatedUser struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -2017,7 +2063,6 @@ func (s *FederatedUser) SetFederatedUserId(v string) *FederatedUser {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentityRequest
|
|
||||||
type GetCallerIdentityInput struct {
|
type GetCallerIdentityInput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
}
|
}
|
||||||
|
@ -2034,7 +2079,6 @@ func (s GetCallerIdentityInput) GoString() string {
|
||||||
|
|
||||||
// Contains the response to a successful GetCallerIdentity request, including
|
// Contains the response to a successful GetCallerIdentity request, including
|
||||||
// information about the entity making the request.
|
// information about the entity making the request.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetCallerIdentityResponse
|
|
||||||
type GetCallerIdentityOutput struct {
|
type GetCallerIdentityOutput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -2080,7 +2124,6 @@ func (s *GetCallerIdentityOutput) SetUserId(v string) *GetCallerIdentityOutput {
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationTokenRequest
|
|
||||||
type GetFederationTokenInput struct {
|
type GetFederationTokenInput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -2189,7 +2232,6 @@ func (s *GetFederationTokenInput) SetPolicy(v string) *GetFederationTokenInput {
|
||||||
|
|
||||||
// Contains the response to a successful GetFederationToken request, including
|
// Contains the response to a successful GetFederationToken request, including
|
||||||
// temporary AWS credentials that can be used to make AWS requests.
|
// temporary AWS credentials that can be used to make AWS requests.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetFederationTokenResponse
|
|
||||||
type GetFederationTokenOutput struct {
|
type GetFederationTokenOutput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -2242,7 +2284,6 @@ func (s *GetFederationTokenOutput) SetPackedPolicySize(v int64) *GetFederationTo
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionTokenRequest
|
|
||||||
type GetSessionTokenInput struct {
|
type GetSessionTokenInput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
@ -2327,7 +2368,6 @@ func (s *GetSessionTokenInput) SetTokenCode(v string) *GetSessionTokenInput {
|
||||||
|
|
||||||
// Contains the response to a successful GetSessionToken request, including
|
// Contains the response to a successful GetSessionToken request, including
|
||||||
// temporary AWS credentials that can be used to make AWS requests.
|
// temporary AWS credentials that can be used to make AWS requests.
|
||||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/sts-2011-06-15/GetSessionTokenResponse
|
|
||||||
type GetSessionTokenOutput struct {
|
type GetSessionTokenOutput struct {
|
||||||
_ struct{} `type:"structure"`
|
_ struct{} `type:"structure"`
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
//
|
//
|
||||||
// Using the Client
|
// Using the Client
|
||||||
//
|
//
|
||||||
// To AWS Security Token Service with the SDK use the New function to create
|
// To contact AWS Security Token Service with the SDK use the New function to create
|
||||||
// a new service client. With that client you can make API requests to the service.
|
// a new service client. With that client you can make API requests to the service.
|
||||||
// These clients are safe to use concurrently.
|
// These clients are safe to use concurrently.
|
||||||
//
|
//
|
||||||
|
|
|
@ -29,8 +29,9 @@ var initRequest func(*request.Request)
|
||||||
|
|
||||||
// Service information constants
|
// Service information constants
|
||||||
const (
|
const (
|
||||||
ServiceName = "sts" // Service endpoint prefix API calls made to.
|
ServiceName = "sts" // Name of service.
|
||||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
EndpointsID = ServiceName // ID to lookup a service endpoint with.
|
||||||
|
ServiceID = "STS" // ServiceID is a unique identifer of a specific service.
|
||||||
)
|
)
|
||||||
|
|
||||||
// New creates a new instance of the STS client with a session.
|
// New creates a new instance of the STS client with a session.
|
||||||
|
@ -55,6 +56,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio
|
||||||
cfg,
|
cfg,
|
||||||
metadata.ClientInfo{
|
metadata.ClientInfo{
|
||||||
ServiceName: ServiceName,
|
ServiceName: ServiceName,
|
||||||
|
ServiceID: ServiceID,
|
||||||
SigningName: signingName,
|
SigningName: signingName,
|
||||||
SigningRegion: signingRegion,
|
SigningRegion: signingRegion,
|
||||||
Endpoint: endpoint,
|
Endpoint: endpoint,
|
||||||
|
|
Loading…
Reference in New Issue