mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
vendor: github.com/aws/aws-sdk-go-v2/config v1.26.6
vendor github.com/aws/aws-sdk-go-v2/config v1.26.6 and related dependencies. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
124
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md
generated
vendored
Normal file
124
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,124 @@
|
||||
# v1.10.4 (2023-12-07)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.10.3 (2023-11-30)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.10.2 (2023-11-29)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.10.1 (2023-11-15)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.10.0 (2023-10-31)
|
||||
|
||||
* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).
|
||||
|
||||
# v1.9.15 (2023-10-06)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.14 (2023-08-18)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.13 (2023-08-07)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.12 (2023-07-31)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.11 (2022-12-02)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.10 (2022-10-24)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.9 (2022-09-14)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.8 (2022-09-02)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.7 (2022-08-31)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.6 (2022-08-29)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.5 (2022-08-11)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.4 (2022-08-09)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.3 (2022-06-29)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.2 (2022-06-07)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.1 (2022-03-24)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.9.0 (2022-03-08)
|
||||
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
|
||||
# v1.8.0 (2022-02-24)
|
||||
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
|
||||
# v1.7.0 (2022-01-14)
|
||||
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
|
||||
# v1.6.0 (2022-01-07)
|
||||
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
|
||||
# v1.5.0 (2021-11-06)
|
||||
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
|
||||
# v1.4.0 (2021-10-21)
|
||||
|
||||
* **Feature**: Updated to latest version
|
||||
|
||||
# v1.3.0 (2021-08-27)
|
||||
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
|
||||
# v1.2.2 (2021-08-04)
|
||||
|
||||
* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.
|
||||
|
||||
# v1.2.1 (2021-07-15)
|
||||
|
||||
* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version
|
||||
|
||||
# v1.2.0 (2021-06-25)
|
||||
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
|
||||
# v1.1.0 (2021-05-14)
|
||||
|
||||
* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.
|
||||
|
202
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt
generated
vendored
Normal file
202
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/LICENSE.txt
generated
vendored
Normal file
@ -0,0 +1,202 @@
|
||||
|
||||
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.
|
176
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.go
generated
vendored
Normal file
176
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/accept_encoding_gzip.go
generated
vendored
Normal file
@ -0,0 +1,176 @@
|
||||
package acceptencoding
|
||||
|
||||
import (
|
||||
"compress/gzip"
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/aws/smithy-go"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
const acceptEncodingHeaderKey = "Accept-Encoding"
|
||||
const contentEncodingHeaderKey = "Content-Encoding"
|
||||
|
||||
// AddAcceptEncodingGzipOptions provides the options for the
|
||||
// AddAcceptEncodingGzip middleware setup.
|
||||
type AddAcceptEncodingGzipOptions struct {
|
||||
Enable bool
|
||||
}
|
||||
|
||||
// AddAcceptEncodingGzip explicitly adds handling for accept-encoding GZIP
|
||||
// middleware to the operation stack. This allows checksums to be correctly
|
||||
// computed without disabling GZIP support.
|
||||
func AddAcceptEncodingGzip(stack *middleware.Stack, options AddAcceptEncodingGzipOptions) error {
|
||||
if options.Enable {
|
||||
if err := stack.Finalize.Add(&EnableGzip{}, middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := stack.Deserialize.Insert(&DecompressGzip{}, "OperationDeserializer", middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
return stack.Finalize.Add(&DisableGzip{}, middleware.Before)
|
||||
}
|
||||
|
||||
// DisableGzip provides the middleware that will
|
||||
// disable the underlying http client automatically enabling for gzip
|
||||
// decompress content-encoding support.
|
||||
type DisableGzip struct{}
|
||||
|
||||
// ID returns the id for the middleware.
|
||||
func (*DisableGzip) ID() string {
|
||||
return "DisableAcceptEncodingGzip"
|
||||
}
|
||||
|
||||
// HandleFinalize implements the FinalizeMiddleware interface.
|
||||
func (*DisableGzip) HandleFinalize(
|
||||
ctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler,
|
||||
) (
|
||||
output middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
req, ok := input.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return output, metadata, &smithy.SerializationError{
|
||||
Err: fmt.Errorf("unknown request type %T", input.Request),
|
||||
}
|
||||
}
|
||||
|
||||
// Explicitly enable gzip support, this will prevent the http client from
|
||||
// auto extracting the zipped content.
|
||||
req.Header.Set(acceptEncodingHeaderKey, "identity")
|
||||
|
||||
return next.HandleFinalize(ctx, input)
|
||||
}
|
||||
|
||||
// EnableGzip provides a middleware to enable support for
|
||||
// gzip responses, with manual decompression. This prevents the underlying HTTP
|
||||
// client from performing the gzip decompression automatically.
|
||||
type EnableGzip struct{}
|
||||
|
||||
// ID returns the id for the middleware.
|
||||
func (*EnableGzip) ID() string {
|
||||
return "AcceptEncodingGzip"
|
||||
}
|
||||
|
||||
// HandleFinalize implements the FinalizeMiddleware interface.
|
||||
func (*EnableGzip) HandleFinalize(
|
||||
ctx context.Context, input middleware.FinalizeInput, next middleware.FinalizeHandler,
|
||||
) (
|
||||
output middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
req, ok := input.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return output, metadata, &smithy.SerializationError{
|
||||
Err: fmt.Errorf("unknown request type %T", input.Request),
|
||||
}
|
||||
}
|
||||
|
||||
// Explicitly enable gzip support, this will prevent the http client from
|
||||
// auto extracting the zipped content.
|
||||
req.Header.Set(acceptEncodingHeaderKey, "gzip")
|
||||
|
||||
return next.HandleFinalize(ctx, input)
|
||||
}
|
||||
|
||||
// DecompressGzip provides the middleware for decompressing a gzip
|
||||
// response from the service.
|
||||
type DecompressGzip struct{}
|
||||
|
||||
// ID returns the id for the middleware.
|
||||
func (*DecompressGzip) ID() string {
|
||||
return "DecompressGzip"
|
||||
}
|
||||
|
||||
// HandleDeserialize implements the DeserializeMiddlware interface.
|
||||
func (*DecompressGzip) HandleDeserialize(
|
||||
ctx context.Context, input middleware.DeserializeInput, next middleware.DeserializeHandler,
|
||||
) (
|
||||
output middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
output, metadata, err = next.HandleDeserialize(ctx, input)
|
||||
if err != nil {
|
||||
return output, metadata, err
|
||||
}
|
||||
|
||||
resp, ok := output.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return output, metadata, &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("unknown response type %T", output.RawResponse),
|
||||
}
|
||||
}
|
||||
if v := resp.Header.Get(contentEncodingHeaderKey); v != "gzip" {
|
||||
return output, metadata, err
|
||||
}
|
||||
|
||||
// Clear content length since it will no longer be valid once the response
|
||||
// body is decompressed.
|
||||
resp.Header.Del("Content-Length")
|
||||
resp.ContentLength = -1
|
||||
|
||||
resp.Body = wrapGzipReader(resp.Body)
|
||||
|
||||
return output, metadata, err
|
||||
}
|
||||
|
||||
type gzipReader struct {
|
||||
reader io.ReadCloser
|
||||
gzip *gzip.Reader
|
||||
}
|
||||
|
||||
func wrapGzipReader(reader io.ReadCloser) *gzipReader {
|
||||
return &gzipReader{
|
||||
reader: reader,
|
||||
}
|
||||
}
|
||||
|
||||
// Read wraps the gzip reader around the underlying io.Reader to extract the
|
||||
// response bytes on the fly.
|
||||
func (g *gzipReader) Read(b []byte) (n int, err error) {
|
||||
if g.gzip == nil {
|
||||
g.gzip, err = gzip.NewReader(g.reader)
|
||||
if err != nil {
|
||||
g.gzip = nil // ensure uninitialized gzip value isn't used in close.
|
||||
return 0, fmt.Errorf("failed to decompress gzip response, %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
return g.gzip.Read(b)
|
||||
}
|
||||
|
||||
func (g *gzipReader) Close() error {
|
||||
if g.gzip == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := g.gzip.Close(); err != nil {
|
||||
g.reader.Close()
|
||||
return fmt.Errorf("failed to decompress gzip response, %w", err)
|
||||
}
|
||||
|
||||
return g.reader.Close()
|
||||
}
|
22
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.go
generated
vendored
Normal file
22
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/doc.go
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
/*
|
||||
Package acceptencoding provides customizations associated with Accept Encoding Header.
|
||||
|
||||
# Accept encoding gzip
|
||||
|
||||
The Go HTTP client automatically supports accept-encoding and content-encoding
|
||||
gzip by default. This default behavior is not desired by the SDK, and prevents
|
||||
validating the response body's checksum. To prevent this the SDK must manually
|
||||
control usage of content-encoding gzip.
|
||||
|
||||
To control content-encoding, the SDK must always set the `Accept-Encoding`
|
||||
header to a value. This prevents the HTTP client from using gzip automatically.
|
||||
When gzip is enabled on the API client, the SDK's customization will control
|
||||
decompressing the gzip data in order to not break the checksum validation. When
|
||||
gzip is disabled, the API client will disable gzip, preventing the HTTP
|
||||
client's default behavior.
|
||||
|
||||
An `EnableAcceptEncodingGzip` option may or may not be present depending on the client using
|
||||
the below middleware. The option if present can be used to enable auto decompressing
|
||||
gzip by the SDK.
|
||||
*/
|
||||
package acceptencoding
|
6
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go
generated
vendored
Normal file
6
vendor/github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding/go_module_metadata.go
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
|
||||
|
||||
package acceptencoding
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.10.4"
|
97
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md
generated
vendored
97
vendor/github.com/aws/aws-sdk-go-v2/service/internal/presigned-url/CHANGELOG.md
generated
vendored
@ -1,3 +1,100 @@
|
||||
# v1.10.10 (2024-01-04)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.9 (2023-12-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.8 (2023-12-01)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.7 (2023-11-30)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.6 (2023-11-29)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.5 (2023-11-28.2)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.4 (2023-11-20)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.3 (2023-11-15)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.2 (2023-11-09)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.1 (2023-11-01)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.0 (2023-10-31)
|
||||
|
||||
* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.37 (2023-10-12)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.36 (2023-10-06)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.35 (2023-08-21)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.34 (2023-08-18)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.33 (2023-08-17)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.32 (2023-08-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.31 (2023-07-31)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.30 (2023-07-28)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.29 (2023-07-13)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.28 (2023-06-13)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.27 (2023-04-24)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.26 (2023-04-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.25 (2023-03-21)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.24 (2023-03-10)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
@ -3,4 +3,4 @@
|
||||
package presignedurl
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.9.24"
|
||||
const goModuleVersion = "1.10.10"
|
||||
|
151
vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md
generated
vendored
151
vendor/github.com/aws/aws-sdk-go-v2/service/sso/CHANGELOG.md
generated
vendored
@ -1,3 +1,154 @@
|
||||
# v1.18.7 (2024-01-18)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.18.6 (2024-01-04)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.18.5 (2023-12-08)
|
||||
|
||||
* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein.
|
||||
|
||||
# v1.18.4 (2023-12-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.18.3 (2023-12-06)
|
||||
|
||||
* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously.
|
||||
|
||||
# v1.18.2 (2023-12-01)
|
||||
|
||||
* **Bug Fix**: Correct wrapping of errors in authentication workflow.
|
||||
* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.18.1 (2023-11-30)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.18.0 (2023-11-29)
|
||||
|
||||
* **Feature**: Expose Options() accessor on service clients.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.17.5 (2023-11-28.2)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.17.4 (2023-11-28)
|
||||
|
||||
* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction.
|
||||
|
||||
# v1.17.3 (2023-11-20)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.17.2 (2023-11-15)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.17.1 (2023-11-09)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.17.0 (2023-11-01)
|
||||
|
||||
* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.16.0 (2023-10-31)
|
||||
|
||||
* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.15.2 (2023-10-12)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.15.1 (2023-10-06)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.15.0 (2023-10-02)
|
||||
|
||||
* **Feature**: Fix FIPS Endpoints in aws-us-gov.
|
||||
|
||||
# v1.14.1 (2023-09-22)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.14.0 (2023-09-18)
|
||||
|
||||
* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service.
|
||||
* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field.
|
||||
|
||||
# v1.13.6 (2023-08-31)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.13.5 (2023-08-21)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.4 (2023-08-18)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.3 (2023-08-17)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.2 (2023-08-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.1 (2023-08-01)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.13.0 (2023-07-31)
|
||||
|
||||
* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.14 (2023-07-28)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.13 (2023-07-13)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.12 (2023-06-15)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.12.11 (2023-06-13)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.10 (2023-05-04)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.12.9 (2023-04-24)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.8 (2023-04-10)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.12.7 (2023-04-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.6 (2023-03-21)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.5 (2023-03-10)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
266
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go
generated
vendored
266
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_client.go
generated
vendored
@ -4,12 +4,15 @@ package sso
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/defaults"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/retry"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
|
||||
internalauth "github.com/aws/aws-sdk-go-v2/internal/auth"
|
||||
internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy"
|
||||
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
smithydocument "github.com/aws/smithy-go/document"
|
||||
@ -45,12 +48,22 @@ func New(options Options, optFns ...func(*Options)) *Client {
|
||||
|
||||
resolveHTTPSignerV4(&options)
|
||||
|
||||
resolveDefaultEndpointConfiguration(&options)
|
||||
resolveEndpointResolverV2(&options)
|
||||
|
||||
resolveAuthSchemeResolver(&options)
|
||||
|
||||
for _, fn := range optFns {
|
||||
fn(&options)
|
||||
}
|
||||
|
||||
finalizeRetryMaxAttempts(&options)
|
||||
|
||||
ignoreAnonymousAuth(&options)
|
||||
|
||||
wrapWithAnonymousAuth(&options)
|
||||
|
||||
resolveAuthSchemes(&options)
|
||||
|
||||
client := &Client{
|
||||
options: options,
|
||||
}
|
||||
@ -58,115 +71,25 @@ func New(options Options, optFns ...func(*Options)) *Client {
|
||||
return client
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
// Set of options to modify how an operation is invoked. These apply to all
|
||||
// operations invoked for this client. Use functional options on operation call to
|
||||
// modify this list for per operation behavior.
|
||||
APIOptions []func(*middleware.Stack) error
|
||||
|
||||
// Configures the events that will be sent to the configured logger.
|
||||
ClientLogMode aws.ClientLogMode
|
||||
|
||||
// The credentials object to use when signing requests.
|
||||
Credentials aws.CredentialsProvider
|
||||
|
||||
// The configuration DefaultsMode that the SDK should use when constructing the
|
||||
// clients initial default settings.
|
||||
DefaultsMode aws.DefaultsMode
|
||||
|
||||
// The endpoint options to be used when attempting to resolve an endpoint.
|
||||
EndpointOptions EndpointResolverOptions
|
||||
|
||||
// The service endpoint resolver.
|
||||
EndpointResolver EndpointResolver
|
||||
|
||||
// Signature Version 4 (SigV4) Signer
|
||||
HTTPSignerV4 HTTPSignerV4
|
||||
|
||||
// The logger writer interface to write logging messages to.
|
||||
Logger logging.Logger
|
||||
|
||||
// The region to send requests to. (Required)
|
||||
Region string
|
||||
|
||||
// RetryMaxAttempts specifies the maximum number attempts an API client will call
|
||||
// an operation that fails with a retryable error. A value of 0 is ignored, and
|
||||
// will not be used to configure the API client created default retryer, or modify
|
||||
// per operation call's retry max attempts. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. If specified in an operation call's functional
|
||||
// options with a value that is different than the constructed client's Options,
|
||||
// the Client's Retryer will be wrapped to use the operation's specific
|
||||
// RetryMaxAttempts value.
|
||||
RetryMaxAttempts int
|
||||
|
||||
// RetryMode specifies the retry mode the API client will be created with, if
|
||||
// Retryer option is not also specified. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
RetryMode aws.RetryMode
|
||||
|
||||
// Retryer guides how HTTP requests should be retried in case of recoverable
|
||||
// failures. When nil the API client will use a default retryer. The kind of
|
||||
// default retry created by the API client can be changed with the RetryMode
|
||||
// option.
|
||||
Retryer aws.Retryer
|
||||
|
||||
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
|
||||
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You
|
||||
// should not populate this structure programmatically, or rely on the values here
|
||||
// within your applications.
|
||||
RuntimeEnvironment aws.RuntimeEnvironment
|
||||
|
||||
// The initial DefaultsMode used when the client options were constructed. If the
|
||||
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
|
||||
// value was at that point in time. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
resolvedDefaultsMode aws.DefaultsMode
|
||||
|
||||
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
|
||||
// implementation if nil.
|
||||
HTTPClient HTTPClient
|
||||
// Options returns a copy of the client configuration.
|
||||
//
|
||||
// Callers SHOULD NOT perform mutations on any inner structures within client
|
||||
// config. Config overrides should instead be made on a per-operation basis through
|
||||
// functional options.
|
||||
func (c *Client) Options() Options {
|
||||
return c.options.Copy()
|
||||
}
|
||||
|
||||
// WithAPIOptions returns a functional option for setting the Client's APIOptions
|
||||
// option.
|
||||
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, optFns...)
|
||||
}
|
||||
}
|
||||
|
||||
// WithEndpointResolver returns a functional option for setting the Client's
|
||||
// EndpointResolver option.
|
||||
func WithEndpointResolver(v EndpointResolver) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolver = v
|
||||
}
|
||||
}
|
||||
|
||||
type HTTPClient interface {
|
||||
Do(*http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
// Copy creates a clone where the APIOptions list is deep copied.
|
||||
func (o Options) Copy() Options {
|
||||
to := o
|
||||
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
|
||||
copy(to.APIOptions, o.APIOptions)
|
||||
|
||||
return to
|
||||
}
|
||||
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
|
||||
ctx = middleware.ClearStackValues(ctx)
|
||||
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
|
||||
options := c.options.Copy()
|
||||
|
||||
for _, fn := range optFns {
|
||||
fn(&options)
|
||||
}
|
||||
|
||||
finalizeRetryMaxAttemptOptions(&options, *c)
|
||||
finalizeOperationRetryMaxAttempts(&options, *c)
|
||||
|
||||
finalizeClientEndpointResolverOptions(&options)
|
||||
|
||||
@ -194,8 +117,89 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf
|
||||
return result, metadata, err
|
||||
}
|
||||
|
||||
type operationInputKey struct{}
|
||||
|
||||
func setOperationInput(ctx context.Context, input interface{}) context.Context {
|
||||
return middleware.WithStackValue(ctx, operationInputKey{}, input)
|
||||
}
|
||||
|
||||
func getOperationInput(ctx context.Context) interface{} {
|
||||
return middleware.GetStackValue(ctx, operationInputKey{})
|
||||
}
|
||||
|
||||
type setOperationInputMiddleware struct {
|
||||
}
|
||||
|
||||
func (*setOperationInputMiddleware) ID() string {
|
||||
return "setOperationInput"
|
||||
}
|
||||
|
||||
func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
ctx = setOperationInput(ctx, in.Parameters)
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error {
|
||||
if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil {
|
||||
return fmt.Errorf("add ResolveAuthScheme: %w", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil {
|
||||
return fmt.Errorf("add GetIdentity: %v", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil {
|
||||
return fmt.Errorf("add ResolveEndpointV2: %v", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil {
|
||||
return fmt.Errorf("add Signing: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func resolveAuthSchemeResolver(options *Options) {
|
||||
if options.AuthSchemeResolver == nil {
|
||||
options.AuthSchemeResolver = &defaultAuthSchemeResolver{}
|
||||
}
|
||||
}
|
||||
|
||||
func resolveAuthSchemes(options *Options) {
|
||||
if options.AuthSchemes == nil {
|
||||
options.AuthSchemes = []smithyhttp.AuthScheme{
|
||||
internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{
|
||||
Signer: options.HTTPSignerV4,
|
||||
Logger: options.Logger,
|
||||
LogSigning: options.ClientLogMode.IsSigning(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type noSmithyDocumentSerde = smithydocument.NoSerde
|
||||
|
||||
type legacyEndpointContextSetter struct {
|
||||
LegacyResolver EndpointResolver
|
||||
}
|
||||
|
||||
func (*legacyEndpointContextSetter) ID() string {
|
||||
return "legacyEndpointContextSetter"
|
||||
}
|
||||
|
||||
func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
if m.LegacyResolver != nil {
|
||||
ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true)
|
||||
}
|
||||
|
||||
return next.HandleInitialize(ctx, in)
|
||||
|
||||
}
|
||||
func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error {
|
||||
return stack.Initialize.Add(&legacyEndpointContextSetter{
|
||||
LegacyResolver: o.EndpointResolver,
|
||||
}, middleware.Before)
|
||||
}
|
||||
|
||||
func resolveDefaultLogger(o *Options) {
|
||||
if o.Logger != nil {
|
||||
return
|
||||
@ -233,6 +237,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
|
||||
APIOptions: cfg.APIOptions,
|
||||
Logger: cfg.Logger,
|
||||
ClientLogMode: cfg.ClientLogMode,
|
||||
AppID: cfg.AppID,
|
||||
}
|
||||
resolveAWSRetryerProvider(cfg, &opts)
|
||||
resolveAWSRetryMaxAttempts(cfg, &opts)
|
||||
@ -240,6 +245,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
|
||||
resolveAWSEndpointResolver(cfg, &opts)
|
||||
resolveUseDualStackEndpoint(cfg, &opts)
|
||||
resolveUseFIPSEndpoint(cfg, &opts)
|
||||
resolveBaseEndpoint(cfg, &opts)
|
||||
return New(opts, optFns...)
|
||||
}
|
||||
|
||||
@ -331,7 +337,15 @@ func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
|
||||
o.RetryMaxAttempts = cfg.RetryMaxAttempts
|
||||
}
|
||||
|
||||
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
|
||||
func finalizeRetryMaxAttempts(o *Options) {
|
||||
if o.RetryMaxAttempts == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
|
||||
}
|
||||
|
||||
func finalizeOperationRetryMaxAttempts(o *Options, client Client) {
|
||||
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
|
||||
return
|
||||
}
|
||||
@ -343,20 +357,19 @@ func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
|
||||
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
|
||||
return
|
||||
}
|
||||
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
|
||||
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions)
|
||||
}
|
||||
|
||||
func addClientUserAgent(stack *middleware.Stack) error {
|
||||
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sso", goModuleVersion)(stack)
|
||||
}
|
||||
func addClientUserAgent(stack *middleware.Stack, options Options) error {
|
||||
if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sso", goModuleVersion)(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
|
||||
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
|
||||
CredentialsProvider: o.Credentials,
|
||||
Signer: o.HTTPSignerV4,
|
||||
LogSigning: o.ClientLogMode.IsSigning(),
|
||||
})
|
||||
return stack.Finalize.Add(mw, middleware.After)
|
||||
if len(options.AppID) > 0 {
|
||||
return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type HTTPSignerV4 interface {
|
||||
@ -431,3 +444,32 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
|
||||
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
|
||||
}, middleware.After)
|
||||
}
|
||||
|
||||
type disableHTTPSMiddleware struct {
|
||||
DisableHTTPS bool
|
||||
}
|
||||
|
||||
func (*disableHTTPSMiddleware) ID() string {
|
||||
return "disableHTTPS"
|
||||
}
|
||||
|
||||
func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
|
||||
}
|
||||
|
||||
if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) {
|
||||
req.URL.Scheme = "http"
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {
|
||||
return stack.Finalize.Insert(&disableHTTPSMiddleware{
|
||||
DisableHTTPS: o.EndpointOptions.DisableHTTPS,
|
||||
}, "ResolveEndpointV2", middleware.After)
|
||||
}
|
||||
|
29
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go
generated
vendored
29
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_GetRoleCredentials.go
generated
vendored
@ -4,14 +4,15 @@ package sso
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sso/types"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
// Returns the STS short-term credentials for a given role name that is assigned to
|
||||
// the user.
|
||||
// Returns the STS short-term credentials for a given role name that is assigned
|
||||
// to the user.
|
||||
func (c *Client) GetRoleCredentials(ctx context.Context, params *GetRoleCredentialsInput, optFns ...func(*Options)) (*GetRoleCredentialsOutput, error) {
|
||||
if params == nil {
|
||||
params = &GetRoleCredentialsInput{}
|
||||
@ -30,8 +31,7 @@ func (c *Client) GetRoleCredentials(ctx context.Context, params *GetRoleCredenti
|
||||
type GetRoleCredentialsInput struct {
|
||||
|
||||
// The token issued by the CreateToken API call. For more information, see
|
||||
// CreateToken
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
|
||||
// CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
|
||||
// in the IAM Identity Center OIDC API Reference Guide.
|
||||
//
|
||||
// This member is required.
|
||||
@ -62,6 +62,9 @@ type GetRoleCredentialsOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRoleCredentials{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -70,6 +73,13 @@ func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Sta
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "GetRoleCredentials"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -91,7 +101,7 @@ func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Sta
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -100,12 +110,18 @@ func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Sta
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpGetRoleCredentialsValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRoleCredentials(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -115,6 +131,9 @@ func (c *Client) addOperationGetRoleCredentialsMiddlewares(stack *middleware.Sta
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
24
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go
generated
vendored
24
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccountRoles.go
generated
vendored
@ -30,8 +30,7 @@ func (c *Client) ListAccountRoles(ctx context.Context, params *ListAccountRolesI
|
||||
type ListAccountRolesInput struct {
|
||||
|
||||
// The token issued by the CreateToken API call. For more information, see
|
||||
// CreateToken
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
|
||||
// CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
|
||||
// in the IAM Identity Center OIDC API Reference Guide.
|
||||
//
|
||||
// This member is required.
|
||||
@ -68,6 +67,9 @@ type ListAccountRolesOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccountRoles{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -76,6 +78,13 @@ func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccountRoles"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -97,7 +106,7 @@ func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -106,12 +115,18 @@ func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListAccountRolesValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccountRoles(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -121,6 +136,9 @@ func (c *Client) addOperationListAccountRolesMiddlewares(stack *middleware.Stack
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
27
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go
generated
vendored
27
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_ListAccounts.go
generated
vendored
@ -12,8 +12,7 @@ import (
|
||||
)
|
||||
|
||||
// Lists all AWS accounts assigned to the user. These AWS accounts are assigned by
|
||||
// the administrator of the account. For more information, see Assign User Access
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers)
|
||||
// the administrator of the account. For more information, see Assign User Access (https://docs.aws.amazon.com/singlesignon/latest/userguide/useraccess.html#assignusers)
|
||||
// in the IAM Identity Center User Guide. This operation returns a paginated
|
||||
// response.
|
||||
func (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, optFns ...func(*Options)) (*ListAccountsOutput, error) {
|
||||
@ -34,8 +33,7 @@ func (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, op
|
||||
type ListAccountsInput struct {
|
||||
|
||||
// The token issued by the CreateToken API call. For more information, see
|
||||
// CreateToken
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
|
||||
// CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
|
||||
// in the IAM Identity Center OIDC API Reference Guide.
|
||||
//
|
||||
// This member is required.
|
||||
@ -67,6 +65,9 @@ type ListAccountsOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccounts{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -75,6 +76,13 @@ func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, op
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccounts"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -96,7 +104,7 @@ func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, op
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -105,12 +113,18 @@ func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, op
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpListAccountsValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccounts(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -120,6 +134,9 @@ func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, op
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
30
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go
generated
vendored
30
vendor/github.com/aws/aws-sdk-go-v2/service/sso/api_op_Logout.go
generated
vendored
@ -4,6 +4,7 @@ package sso
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
@ -19,9 +20,8 @@ import (
|
||||
// temporary AWS credentials are returned to the client. After user logout, any
|
||||
// existing IAM role sessions that were created by using IAM Identity Center
|
||||
// permission sets continue based on the duration configured in the permission set.
|
||||
// For more information, see User authentications
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html) in
|
||||
// the IAM Identity Center User Guide.
|
||||
// For more information, see User authentications (https://docs.aws.amazon.com/singlesignon/latest/userguide/authconcept.html)
|
||||
// in the IAM Identity Center User Guide.
|
||||
func (c *Client) Logout(ctx context.Context, params *LogoutInput, optFns ...func(*Options)) (*LogoutOutput, error) {
|
||||
if params == nil {
|
||||
params = &LogoutInput{}
|
||||
@ -40,8 +40,7 @@ func (c *Client) Logout(ctx context.Context, params *LogoutInput, optFns ...func
|
||||
type LogoutInput struct {
|
||||
|
||||
// The token issued by the CreateToken API call. For more information, see
|
||||
// CreateToken
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
|
||||
// CreateToken (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/API_CreateToken.html)
|
||||
// in the IAM Identity Center OIDC API Reference Guide.
|
||||
//
|
||||
// This member is required.
|
||||
@ -58,6 +57,9 @@ type LogoutOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsRestjson1_serializeOpLogout{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -66,6 +68,13 @@ func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "Logout"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -87,7 +96,7 @@ func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -96,12 +105,18 @@ func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpLogoutValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opLogout(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -111,6 +126,9 @@ func (c *Client) addOperationLogoutMiddlewares(stack *middleware.Stack, options
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
308
vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go
generated
vendored
Normal file
308
vendor/github.com/aws/aws-sdk-go-v2/service/sso/auth.go
generated
vendored
Normal file
@ -0,0 +1,308 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package sso
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) {
|
||||
params.Region = options.Region
|
||||
}
|
||||
|
||||
type setLegacyContextSigningOptionsMiddleware struct {
|
||||
}
|
||||
|
||||
func (*setLegacyContextSigningOptionsMiddleware) ID() string {
|
||||
return "setLegacyContextSigningOptions"
|
||||
}
|
||||
|
||||
func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
schemeID := rscheme.Scheme.SchemeID()
|
||||
|
||||
if sn := awsmiddleware.GetSigningName(ctx); sn != "" {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn)
|
||||
} else if schemeID == "aws.auth#sigv4a" {
|
||||
smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn)
|
||||
}
|
||||
}
|
||||
|
||||
if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr)
|
||||
} else if schemeID == "aws.auth#sigv4a" {
|
||||
smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr})
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error {
|
||||
return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before)
|
||||
}
|
||||
|
||||
type withAnonymous struct {
|
||||
resolver AuthSchemeResolver
|
||||
}
|
||||
|
||||
var _ AuthSchemeResolver = (*withAnonymous)(nil)
|
||||
|
||||
func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {
|
||||
opts, err := v.resolver.ResolveAuthSchemes(ctx, params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
opts = append(opts, &smithyauth.Option{
|
||||
SchemeID: smithyauth.SchemeIDAnonymous,
|
||||
})
|
||||
return opts, nil
|
||||
}
|
||||
|
||||
func wrapWithAnonymousAuth(options *Options) {
|
||||
if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok {
|
||||
return
|
||||
}
|
||||
|
||||
options.AuthSchemeResolver = &withAnonymous{
|
||||
resolver: options.AuthSchemeResolver,
|
||||
}
|
||||
}
|
||||
|
||||
// AuthResolverParameters contains the set of inputs necessary for auth scheme
|
||||
// resolution.
|
||||
type AuthResolverParameters struct {
|
||||
// The name of the operation being invoked.
|
||||
Operation string
|
||||
|
||||
// The region in which the operation is being invoked.
|
||||
Region string
|
||||
}
|
||||
|
||||
func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters {
|
||||
params := &AuthResolverParameters{
|
||||
Operation: operation,
|
||||
}
|
||||
|
||||
bindAuthParamsRegion(params, input, options)
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
// AuthSchemeResolver returns a set of possible authentication options for an
|
||||
// operation.
|
||||
type AuthSchemeResolver interface {
|
||||
ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error)
|
||||
}
|
||||
|
||||
type defaultAuthSchemeResolver struct{}
|
||||
|
||||
var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil)
|
||||
|
||||
func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {
|
||||
if overrides, ok := operationAuthOptions[params.Operation]; ok {
|
||||
return overrides(params), nil
|
||||
}
|
||||
return serviceAuthOptions(params), nil
|
||||
}
|
||||
|
||||
var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{
|
||||
"GetRoleCredentials": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
|
||||
"ListAccountRoles": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
|
||||
"ListAccounts": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
|
||||
"Logout": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: smithyauth.SchemeIDSigV4,
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var props smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&props, "awsssoportal")
|
||||
smithyhttp.SetSigV4SigningRegion(&props, params.Region)
|
||||
return props
|
||||
}(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type resolveAuthSchemeMiddleware struct {
|
||||
operation string
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*resolveAuthSchemeMiddleware) ID() string {
|
||||
return "ResolveAuthScheme"
|
||||
}
|
||||
|
||||
func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options)
|
||||
options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("resolve auth scheme: %w", err)
|
||||
}
|
||||
|
||||
scheme, ok := m.selectScheme(options)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("could not select an auth scheme")
|
||||
}
|
||||
|
||||
ctx = setResolvedAuthScheme(ctx, scheme)
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) {
|
||||
for _, option := range options {
|
||||
if option.SchemeID == smithyauth.SchemeIDAnonymous {
|
||||
return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true
|
||||
}
|
||||
|
||||
for _, scheme := range m.options.AuthSchemes {
|
||||
if scheme.SchemeID() != option.SchemeID {
|
||||
continue
|
||||
}
|
||||
|
||||
if scheme.IdentityResolver(m.options) != nil {
|
||||
return newResolvedAuthScheme(scheme, option), true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil, false
|
||||
}
|
||||
|
||||
type resolvedAuthSchemeKey struct{}
|
||||
|
||||
type resolvedAuthScheme struct {
|
||||
Scheme smithyhttp.AuthScheme
|
||||
IdentityProperties smithy.Properties
|
||||
SignerProperties smithy.Properties
|
||||
}
|
||||
|
||||
func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme {
|
||||
return &resolvedAuthScheme{
|
||||
Scheme: scheme,
|
||||
IdentityProperties: option.IdentityProperties,
|
||||
SignerProperties: option.SignerProperties,
|
||||
}
|
||||
}
|
||||
|
||||
func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context {
|
||||
return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme)
|
||||
}
|
||||
|
||||
func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme {
|
||||
v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme)
|
||||
return v
|
||||
}
|
||||
|
||||
type getIdentityMiddleware struct {
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*getIdentityMiddleware) ID() string {
|
||||
return "GetIdentity"
|
||||
}
|
||||
|
||||
func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
resolver := rscheme.Scheme.IdentityResolver(m.options)
|
||||
if resolver == nil {
|
||||
return out, metadata, fmt.Errorf("no identity resolver")
|
||||
}
|
||||
|
||||
identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("get identity: %w", err)
|
||||
}
|
||||
|
||||
ctx = setIdentity(ctx, identity)
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
type identityKey struct{}
|
||||
|
||||
func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context {
|
||||
return middleware.WithStackValue(ctx, identityKey{}, identity)
|
||||
}
|
||||
|
||||
func getIdentity(ctx context.Context) smithyauth.Identity {
|
||||
v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity)
|
||||
return v
|
||||
}
|
||||
|
||||
type signRequestMiddleware struct {
|
||||
}
|
||||
|
||||
func (*signRequestMiddleware) ID() string {
|
||||
return "Signing"
|
||||
}
|
||||
|
||||
func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request)
|
||||
}
|
||||
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
identity := getIdentity(ctx)
|
||||
if identity == nil {
|
||||
return out, metadata, fmt.Errorf("no identity")
|
||||
}
|
||||
|
||||
signer := rscheme.Scheme.Signer()
|
||||
if signer == nil {
|
||||
return out, metadata, fmt.Errorf("no signer")
|
||||
}
|
||||
|
||||
if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil {
|
||||
return out, metadata, fmt.Errorf("sign request: %w", err)
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
9
vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go
generated
vendored
9
vendor/github.com/aws/aws-sdk-go-v2/service/sso/doc.go
generated
vendored
@ -9,14 +9,13 @@
|
||||
// and roles assigned to them and get federated into the application. Although AWS
|
||||
// Single Sign-On was renamed, the sso and identitystore API namespaces will
|
||||
// continue to retain their original name for backward compatibility purposes. For
|
||||
// more information, see IAM Identity Center rename
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed).
|
||||
// This reference guide describes the IAM Identity Center Portal operations that
|
||||
// more information, see IAM Identity Center rename (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed)
|
||||
// . This reference guide describes the IAM Identity Center Portal operations that
|
||||
// you can call programatically and includes detailed information on data types and
|
||||
// errors. AWS provides SDKs that consist of libraries and sample code for various
|
||||
// programming languages and platforms, such as Java, Ruby, .Net, iOS, or Android.
|
||||
// The SDKs provide a convenient way to create programmatic access to IAM Identity
|
||||
// Center and other AWS services. For more information about the AWS SDKs,
|
||||
// including how to download and install them, see Tools for Amazon Web Services
|
||||
// (http://aws.amazon.com/tools/).
|
||||
// including how to download and install them, see Tools for Amazon Web Services (http://aws.amazon.com/tools/)
|
||||
// .
|
||||
package sso
|
||||
|
390
vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go
generated
vendored
390
vendor/github.com/aws/aws-sdk-go-v2/service/sso/endpoints.go
generated
vendored
@ -8,10 +8,18 @@ import (
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints"
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn"
|
||||
internalendpoints "github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
"github.com/aws/smithy-go/ptr"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -39,13 +47,6 @@ func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointRe
|
||||
return fn(region, options)
|
||||
}
|
||||
|
||||
func resolveDefaultEndpointConfiguration(o *Options) {
|
||||
if o.EndpointResolver != nil {
|
||||
return
|
||||
}
|
||||
o.EndpointResolver = NewDefaultEndpointResolver()
|
||||
}
|
||||
|
||||
// EndpointResolverFromURL returns an EndpointResolver configured using the
|
||||
// provided endpoint url. By default, the resolved endpoint resolver uses the
|
||||
// client region as signing region, and the endpoint source is set to
|
||||
@ -79,6 +80,10 @@ func (*ResolveEndpoint) ID() string {
|
||||
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) {
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
|
||||
@ -94,6 +99,11 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser
|
||||
var endpoint aws.Endpoint
|
||||
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
|
||||
if err != nil {
|
||||
nf := (&aws.EndpointNotFoundError{})
|
||||
if errors.As(err, &nf) {
|
||||
ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false)
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
@ -129,27 +139,10 @@ func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
|
||||
|
||||
type wrappedEndpointResolver struct {
|
||||
awsResolver aws.EndpointResolverWithOptions
|
||||
resolver EndpointResolver
|
||||
}
|
||||
|
||||
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
|
||||
if w.awsResolver == nil {
|
||||
goto fallback
|
||||
}
|
||||
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
|
||||
if err == nil {
|
||||
return endpoint, nil
|
||||
}
|
||||
|
||||
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
|
||||
return endpoint, err
|
||||
}
|
||||
|
||||
fallback:
|
||||
if w.resolver == nil {
|
||||
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
|
||||
}
|
||||
return w.resolver.ResolveEndpoint(region, options)
|
||||
return w.awsResolver.ResolveEndpoint(ServiceID, region, options)
|
||||
}
|
||||
|
||||
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
|
||||
@ -160,12 +153,13 @@ func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, opti
|
||||
|
||||
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
|
||||
|
||||
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
|
||||
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
|
||||
// fallbackResolver for resolution.
|
||||
// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver.
|
||||
// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error,
|
||||
// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked
|
||||
// via its middleware.
|
||||
//
|
||||
// fallbackResolver must not be nil
|
||||
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
|
||||
// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated.
|
||||
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver {
|
||||
var resolver aws.EndpointResolverWithOptions
|
||||
|
||||
if awsResolverWithOptions != nil {
|
||||
@ -176,7 +170,6 @@ func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptio
|
||||
|
||||
return &wrappedEndpointResolver{
|
||||
awsResolver: resolver,
|
||||
resolver: fallbackResolver,
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,3 +191,338 @@ func finalizeClientEndpointResolverOptions(options *Options) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func resolveEndpointResolverV2(options *Options) {
|
||||
if options.EndpointResolverV2 == nil {
|
||||
options.EndpointResolverV2 = NewDefaultEndpointResolverV2()
|
||||
}
|
||||
}
|
||||
|
||||
func resolveBaseEndpoint(cfg aws.Config, o *Options) {
|
||||
if cfg.BaseEndpoint != nil {
|
||||
o.BaseEndpoint = cfg.BaseEndpoint
|
||||
}
|
||||
|
||||
_, g := os.LookupEnv("AWS_ENDPOINT_URL")
|
||||
_, s := os.LookupEnv("AWS_ENDPOINT_URL_SSO")
|
||||
|
||||
if g && !s {
|
||||
return
|
||||
}
|
||||
|
||||
value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSO", cfg.ConfigSources)
|
||||
if found && err == nil {
|
||||
o.BaseEndpoint = &value
|
||||
}
|
||||
}
|
||||
|
||||
// EndpointParameters provides the parameters that influence how endpoints are
|
||||
// resolved.
|
||||
type EndpointParameters struct {
|
||||
// The AWS region used to dispatch the request.
|
||||
//
|
||||
// Parameter is
|
||||
// required.
|
||||
//
|
||||
// AWS::Region
|
||||
Region *string
|
||||
|
||||
// When true, use the dual-stack endpoint. If the configured endpoint does not
|
||||
// support dual-stack, dispatching the request MAY return an error.
|
||||
//
|
||||
// Defaults to
|
||||
// false if no value is provided.
|
||||
//
|
||||
// AWS::UseDualStack
|
||||
UseDualStack *bool
|
||||
|
||||
// When true, send this request to the FIPS-compliant regional endpoint. If the
|
||||
// configured endpoint does not have a FIPS compliant endpoint, dispatching the
|
||||
// request will return an error.
|
||||
//
|
||||
// Defaults to false if no value is
|
||||
// provided.
|
||||
//
|
||||
// AWS::UseFIPS
|
||||
UseFIPS *bool
|
||||
|
||||
// Override the endpoint used to send this request
|
||||
//
|
||||
// Parameter is
|
||||
// required.
|
||||
//
|
||||
// SDK::Endpoint
|
||||
Endpoint *string
|
||||
}
|
||||
|
||||
// ValidateRequired validates required parameters are set.
|
||||
func (p EndpointParameters) ValidateRequired() error {
|
||||
if p.UseDualStack == nil {
|
||||
return fmt.Errorf("parameter UseDualStack is required")
|
||||
}
|
||||
|
||||
if p.UseFIPS == nil {
|
||||
return fmt.Errorf("parameter UseFIPS is required")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithDefaults returns a shallow copy of EndpointParameterswith default values
|
||||
// applied to members where applicable.
|
||||
func (p EndpointParameters) WithDefaults() EndpointParameters {
|
||||
if p.UseDualStack == nil {
|
||||
p.UseDualStack = ptr.Bool(false)
|
||||
}
|
||||
|
||||
if p.UseFIPS == nil {
|
||||
p.UseFIPS = ptr.Bool(false)
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// EndpointResolverV2 provides the interface for resolving service endpoints.
|
||||
type EndpointResolverV2 interface {
|
||||
// ResolveEndpoint attempts to resolve the endpoint with the provided options,
|
||||
// returning the endpoint if found. Otherwise an error is returned.
|
||||
ResolveEndpoint(ctx context.Context, params EndpointParameters) (
|
||||
smithyendpoints.Endpoint, error,
|
||||
)
|
||||
}
|
||||
|
||||
// resolver provides the implementation for resolving endpoints.
|
||||
type resolver struct{}
|
||||
|
||||
func NewDefaultEndpointResolverV2() EndpointResolverV2 {
|
||||
return &resolver{}
|
||||
}
|
||||
|
||||
// ResolveEndpoint attempts to resolve the endpoint with the provided options,
|
||||
// returning the endpoint if found. Otherwise an error is returned.
|
||||
func (r *resolver) ResolveEndpoint(
|
||||
ctx context.Context, params EndpointParameters,
|
||||
) (
|
||||
endpoint smithyendpoints.Endpoint, err error,
|
||||
) {
|
||||
params = params.WithDefaults()
|
||||
if err = params.ValidateRequired(); err != nil {
|
||||
return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err)
|
||||
}
|
||||
_UseDualStack := *params.UseDualStack
|
||||
_UseFIPS := *params.UseFIPS
|
||||
|
||||
if exprVal := params.Endpoint; exprVal != nil {
|
||||
_Endpoint := *exprVal
|
||||
_ = _Endpoint
|
||||
if _UseFIPS == true {
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported")
|
||||
}
|
||||
if _UseDualStack == true {
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported")
|
||||
}
|
||||
uriString := _Endpoint
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
if exprVal := params.Region; exprVal != nil {
|
||||
_Region := *exprVal
|
||||
_ = _Region
|
||||
if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil {
|
||||
_PartitionResult := *exprVal
|
||||
_ = _PartitionResult
|
||||
if _UseFIPS == true {
|
||||
if _UseDualStack == true {
|
||||
if true == _PartitionResult.SupportsFIPS {
|
||||
if true == _PartitionResult.SupportsDualStack {
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://portal.sso-fips.")
|
||||
out.WriteString(_Region)
|
||||
out.WriteString(".")
|
||||
out.WriteString(_PartitionResult.DualStackDnsSuffix)
|
||||
return out.String()
|
||||
}()
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both")
|
||||
}
|
||||
}
|
||||
if _UseFIPS == true {
|
||||
if true == _PartitionResult.SupportsFIPS {
|
||||
if "aws-us-gov" == _PartitionResult.Name {
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://portal.sso.")
|
||||
out.WriteString(_Region)
|
||||
out.WriteString(".amazonaws.com")
|
||||
return out.String()
|
||||
}()
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://portal.sso-fips.")
|
||||
out.WriteString(_Region)
|
||||
out.WriteString(".")
|
||||
out.WriteString(_PartitionResult.DnsSuffix)
|
||||
return out.String()
|
||||
}()
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS")
|
||||
}
|
||||
if _UseDualStack == true {
|
||||
if true == _PartitionResult.SupportsDualStack {
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://portal.sso.")
|
||||
out.WriteString(_Region)
|
||||
out.WriteString(".")
|
||||
out.WriteString(_PartitionResult.DualStackDnsSuffix)
|
||||
return out.String()
|
||||
}()
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack")
|
||||
}
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://portal.sso.")
|
||||
out.WriteString(_Region)
|
||||
out.WriteString(".")
|
||||
out.WriteString(_PartitionResult.DnsSuffix)
|
||||
return out.String()
|
||||
}()
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.")
|
||||
}
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region")
|
||||
}
|
||||
|
||||
type endpointParamsBinder interface {
|
||||
bindEndpointParams(*EndpointParameters)
|
||||
}
|
||||
|
||||
func bindEndpointParams(input interface{}, options Options) *EndpointParameters {
|
||||
params := &EndpointParameters{}
|
||||
|
||||
params.Region = aws.String(endpoints.MapFIPSRegion(options.Region))
|
||||
params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled)
|
||||
params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled)
|
||||
params.Endpoint = options.BaseEndpoint
|
||||
|
||||
if b, ok := input.(endpointParamsBinder); ok {
|
||||
b.bindEndpointParams(params)
|
||||
}
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
type resolveEndpointV2Middleware struct {
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*resolveEndpointV2Middleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
if awsmiddleware.GetRequiresLegacyEndpoints(ctx) {
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
|
||||
}
|
||||
|
||||
if m.options.EndpointResolverV2 == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := bindEndpointParams(getOperationInput(ctx), m.options)
|
||||
endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
if endpt.URI.RawPath == "" && req.URL.RawPath != "" {
|
||||
endpt.URI.RawPath = endpt.URI.Path
|
||||
}
|
||||
req.URL.Scheme = endpt.URI.Scheme
|
||||
req.URL.Host = endpt.URI.Host
|
||||
req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path)
|
||||
req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath)
|
||||
for k := range endpt.Headers {
|
||||
req.Header.Set(k, endpt.Headers.Get(k))
|
||||
}
|
||||
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
opts, _ := smithyauth.GetAuthOptions(&endpt.Properties)
|
||||
for _, o := range opts {
|
||||
rscheme.SignerProperties.SetAll(&o.SignerProperties)
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
7
vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json
generated
vendored
7
vendor/github.com/aws/aws-sdk-go-v2/service/sso/generated.json
generated
vendored
@ -3,7 +3,8 @@
|
||||
"github.com/aws/aws-sdk-go-v2": "v1.4.0",
|
||||
"github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/smithy-go": "v1.4.0"
|
||||
"github.com/aws/smithy-go": "v1.4.0",
|
||||
"github.com/google/go-cmp": "v0.5.4"
|
||||
},
|
||||
"files": [
|
||||
"api_client.go",
|
||||
@ -12,12 +13,16 @@
|
||||
"api_op_ListAccountRoles.go",
|
||||
"api_op_ListAccounts.go",
|
||||
"api_op_Logout.go",
|
||||
"auth.go",
|
||||
"deserializers.go",
|
||||
"doc.go",
|
||||
"endpoints.go",
|
||||
"endpoints_config_test.go",
|
||||
"endpoints_test.go",
|
||||
"generated.json",
|
||||
"internal/endpoints/endpoints.go",
|
||||
"internal/endpoints/endpoints_test.go",
|
||||
"options.go",
|
||||
"protocol_test.go",
|
||||
"serializers.go",
|
||||
"types/errors.go",
|
||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/sso/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
||||
package sso
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.12.5"
|
||||
const goModuleVersion = "1.18.7"
|
||||
|
90
vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go
generated
vendored
90
vendor/github.com/aws/aws-sdk-go-v2/service/sso/internal/endpoints/endpoints.go
generated
vendored
@ -89,13 +89,17 @@ var partitionRegexp = struct {
|
||||
AwsCn *regexp.Regexp
|
||||
AwsIso *regexp.Regexp
|
||||
AwsIsoB *regexp.Regexp
|
||||
AwsIsoE *regexp.Regexp
|
||||
AwsIsoF *regexp.Regexp
|
||||
AwsUsGov *regexp.Regexp
|
||||
}{
|
||||
|
||||
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
|
||||
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"),
|
||||
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
|
||||
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
|
||||
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
|
||||
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
|
||||
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
|
||||
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
|
||||
}
|
||||
|
||||
@ -223,6 +227,14 @@ var defaultPartitions = endpoints.Partitions{
|
||||
Region: "eu-central-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-central-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "portal.sso.eu-central-2.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "eu-central-2",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-north-1",
|
||||
}: endpoints.Endpoint{
|
||||
@ -263,6 +275,22 @@ var defaultPartitions = endpoints.Partitions{
|
||||
Region: "eu-west-3",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "il-central-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "portal.sso.il-central-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "il-central-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "me-central-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "portal.sso.me-central-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "me-central-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "me-south-1",
|
||||
}: endpoints.Endpoint{
|
||||
@ -347,6 +375,24 @@ var defaultPartitions = endpoints.Partitions{
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsCn,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
endpoints.EndpointKey{
|
||||
Region: "cn-north-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "portal.sso.cn-north-1.amazonaws.com.cn",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "cn-north-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "cn-northwest-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "portal.sso.cn-northwest-1.amazonaws.com.cn",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "cn-northwest-1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-iso",
|
||||
@ -390,6 +436,48 @@ var defaultPartitions = endpoints.Partitions{
|
||||
RegionRegex: partitionRegexp.AwsIsoB,
|
||||
IsRegionalized: true,
|
||||
},
|
||||
{
|
||||
ID: "aws-iso-e",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "portal.sso-fips.{region}.cloud.adc-e.uk",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "portal.sso.{region}.cloud.adc-e.uk",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIsoE,
|
||||
IsRegionalized: true,
|
||||
},
|
||||
{
|
||||
ID: "aws-iso-f",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "portal.sso-fips.{region}.csp.hci.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "portal.sso.{region}.csp.hci.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIsoF,
|
||||
IsRegionalized: true,
|
||||
},
|
||||
{
|
||||
ID: "aws-us-gov",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
|
217
vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go
generated
vendored
Normal file
217
vendor/github.com/aws/aws-sdk-go-v2/service/sso/options.go
generated
vendored
Normal file
@ -0,0 +1,217 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package sso
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
"github.com/aws/smithy-go/logging"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type HTTPClient interface {
|
||||
Do(*http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
// Set of options to modify how an operation is invoked. These apply to all
|
||||
// operations invoked for this client. Use functional options on operation call to
|
||||
// modify this list for per operation behavior.
|
||||
APIOptions []func(*middleware.Stack) error
|
||||
|
||||
// The optional application specific identifier appended to the User-Agent header.
|
||||
AppID string
|
||||
|
||||
// This endpoint will be given as input to an EndpointResolverV2. It is used for
|
||||
// providing a custom base endpoint that is subject to modifications by the
|
||||
// processing EndpointResolverV2.
|
||||
BaseEndpoint *string
|
||||
|
||||
// Configures the events that will be sent to the configured logger.
|
||||
ClientLogMode aws.ClientLogMode
|
||||
|
||||
// The credentials object to use when signing requests.
|
||||
Credentials aws.CredentialsProvider
|
||||
|
||||
// The configuration DefaultsMode that the SDK should use when constructing the
|
||||
// clients initial default settings.
|
||||
DefaultsMode aws.DefaultsMode
|
||||
|
||||
// The endpoint options to be used when attempting to resolve an endpoint.
|
||||
EndpointOptions EndpointResolverOptions
|
||||
|
||||
// The service endpoint resolver.
|
||||
//
|
||||
// Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a
|
||||
// value for this field will likely prevent you from using any endpoint-related
|
||||
// service features released after the introduction of EndpointResolverV2 and
|
||||
// BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom
|
||||
// endpoint, set the client option BaseEndpoint instead.
|
||||
EndpointResolver EndpointResolver
|
||||
|
||||
// Resolves the endpoint used for a particular service operation. This should be
|
||||
// used over the deprecated EndpointResolver.
|
||||
EndpointResolverV2 EndpointResolverV2
|
||||
|
||||
// Signature Version 4 (SigV4) Signer
|
||||
HTTPSignerV4 HTTPSignerV4
|
||||
|
||||
// The logger writer interface to write logging messages to.
|
||||
Logger logging.Logger
|
||||
|
||||
// The region to send requests to. (Required)
|
||||
Region string
|
||||
|
||||
// RetryMaxAttempts specifies the maximum number attempts an API client will call
|
||||
// an operation that fails with a retryable error. A value of 0 is ignored, and
|
||||
// will not be used to configure the API client created default retryer, or modify
|
||||
// per operation call's retry max attempts. If specified in an operation call's
|
||||
// functional options with a value that is different than the constructed client's
|
||||
// Options, the Client's Retryer will be wrapped to use the operation's specific
|
||||
// RetryMaxAttempts value.
|
||||
RetryMaxAttempts int
|
||||
|
||||
// RetryMode specifies the retry mode the API client will be created with, if
|
||||
// Retryer option is not also specified. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
RetryMode aws.RetryMode
|
||||
|
||||
// Retryer guides how HTTP requests should be retried in case of recoverable
|
||||
// failures. When nil the API client will use a default retryer. The kind of
|
||||
// default retry created by the API client can be changed with the RetryMode
|
||||
// option.
|
||||
Retryer aws.Retryer
|
||||
|
||||
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
|
||||
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
|
||||
// should not populate this structure programmatically, or rely on the values here
|
||||
// within your applications.
|
||||
RuntimeEnvironment aws.RuntimeEnvironment
|
||||
|
||||
// The initial DefaultsMode used when the client options were constructed. If the
|
||||
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
|
||||
// value was at that point in time. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
resolvedDefaultsMode aws.DefaultsMode
|
||||
|
||||
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
|
||||
// implementation if nil.
|
||||
HTTPClient HTTPClient
|
||||
|
||||
// The auth scheme resolver which determines how to authenticate for each
|
||||
// operation.
|
||||
AuthSchemeResolver AuthSchemeResolver
|
||||
|
||||
// The list of auth schemes supported by the client.
|
||||
AuthSchemes []smithyhttp.AuthScheme
|
||||
}
|
||||
|
||||
// Copy creates a clone where the APIOptions list is deep copied.
|
||||
func (o Options) Copy() Options {
|
||||
to := o
|
||||
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
|
||||
copy(to.APIOptions, o.APIOptions)
|
||||
|
||||
return to
|
||||
}
|
||||
|
||||
func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
return getSigV4IdentityResolver(o)
|
||||
}
|
||||
if schemeID == "smithy.api#noAuth" {
|
||||
return &smithyauth.AnonymousIdentityResolver{}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithAPIOptions returns a functional option for setting the Client's APIOptions
|
||||
// option.
|
||||
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, optFns...)
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for
|
||||
// this field will likely prevent you from using any endpoint-related service
|
||||
// features released after the introduction of EndpointResolverV2 and BaseEndpoint.
|
||||
// To migrate an EndpointResolver implementation that uses a custom endpoint, set
|
||||
// the client option BaseEndpoint instead.
|
||||
func WithEndpointResolver(v EndpointResolver) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolver = v
|
||||
}
|
||||
}
|
||||
|
||||
// WithEndpointResolverV2 returns a functional option for setting the Client's
|
||||
// EndpointResolverV2 option.
|
||||
func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolverV2 = v
|
||||
}
|
||||
}
|
||||
|
||||
func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver {
|
||||
if o.Credentials != nil {
|
||||
return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithSigV4SigningName applies an override to the authentication workflow to
|
||||
// use the given signing name for SigV4-authenticated operations.
|
||||
//
|
||||
// This is an advanced setting. The value here is FINAL, taking precedence over
|
||||
// the resolved signing name from both auth scheme resolution and endpoint
|
||||
// resolution.
|
||||
func WithSigV4SigningName(name string) func(*Options) {
|
||||
fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in)
|
||||
}
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {
|
||||
return s.Initialize.Add(
|
||||
middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn),
|
||||
middleware.Before,
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// WithSigV4SigningRegion applies an override to the authentication workflow to
|
||||
// use the given signing region for SigV4-authenticated operations.
|
||||
//
|
||||
// This is an advanced setting. The value here is FINAL, taking precedence over
|
||||
// the resolved signing region from both auth scheme resolution and endpoint
|
||||
// resolution.
|
||||
func WithSigV4SigningRegion(region string) func(*Options) {
|
||||
fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in)
|
||||
}
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {
|
||||
return s.Initialize.Add(
|
||||
middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn),
|
||||
middleware.Before,
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func ignoreAnonymousAuth(options *Options) {
|
||||
if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) {
|
||||
options.Credentials = nil
|
||||
}
|
||||
}
|
36
vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go
generated
vendored
36
vendor/github.com/aws/aws-sdk-go-v2/service/sso/serializers.go
generated
vendored
@ -36,7 +36,14 @@ func (m *awsRestjson1_serializeOpGetRoleCredentials) HandleSerialize(ctx context
|
||||
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
|
||||
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
|
||||
request.Method = "GET"
|
||||
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
var restEncoder *httpbinding.Encoder
|
||||
if request.URL.RawPath == "" {
|
||||
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
} else {
|
||||
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
|
||||
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
@ -98,7 +105,14 @@ func (m *awsRestjson1_serializeOpListAccountRoles) HandleSerialize(ctx context.C
|
||||
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
|
||||
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
|
||||
request.Method = "GET"
|
||||
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
var restEncoder *httpbinding.Encoder
|
||||
if request.URL.RawPath == "" {
|
||||
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
} else {
|
||||
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
|
||||
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
@ -164,7 +178,14 @@ func (m *awsRestjson1_serializeOpListAccounts) HandleSerialize(ctx context.Conte
|
||||
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
|
||||
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
|
||||
request.Method = "GET"
|
||||
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
var restEncoder *httpbinding.Encoder
|
||||
if request.URL.RawPath == "" {
|
||||
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
} else {
|
||||
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
|
||||
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
@ -226,7 +247,14 @@ func (m *awsRestjson1_serializeOpLogout) HandleSerialize(ctx context.Context, in
|
||||
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
|
||||
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
|
||||
request.Method = "POST"
|
||||
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
var restEncoder *httpbinding.Encoder
|
||||
if request.URL.RawPath == "" {
|
||||
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
} else {
|
||||
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
|
||||
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
|
9
vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go
generated
vendored
9
vendor/github.com/aws/aws-sdk-go-v2/service/sso/types/types.go
generated
vendored
@ -26,8 +26,7 @@ type RoleCredentials struct {
|
||||
|
||||
// The identifier used for the temporary security credentials. For more
|
||||
// information, see Using Temporary Security Credentials to Request Access to AWS
|
||||
// Resources
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
|
||||
// Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
|
||||
// in the AWS IAM User Guide.
|
||||
AccessKeyId *string
|
||||
|
||||
@ -35,14 +34,12 @@ type RoleCredentials struct {
|
||||
Expiration int64
|
||||
|
||||
// The key that is used to sign the request. For more information, see Using
|
||||
// Temporary Security Credentials to Request Access to AWS Resources
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
|
||||
// Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
|
||||
// in the AWS IAM User Guide.
|
||||
SecretAccessKey *string
|
||||
|
||||
// The token used for temporary credentials. For more information, see Using
|
||||
// Temporary Security Credentials to Request Access to AWS Resources
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
|
||||
// Temporary Security Credentials to Request Access to AWS Resources (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html)
|
||||
// in the AWS IAM User Guide.
|
||||
SessionToken *string
|
||||
|
||||
|
155
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md
generated
vendored
155
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md
generated
vendored
@ -1,3 +1,158 @@
|
||||
# v1.21.7 (2024-01-16)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.21.6 (2024-01-04)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.21.5 (2023-12-08)
|
||||
|
||||
* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein.
|
||||
|
||||
# v1.21.4 (2023-12-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.21.3 (2023-12-06)
|
||||
|
||||
* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously.
|
||||
|
||||
# v1.21.2 (2023-12-01)
|
||||
|
||||
* **Bug Fix**: Correct wrapping of errors in authentication workflow.
|
||||
* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.21.1 (2023-11-30)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.21.0 (2023-11-29)
|
||||
|
||||
* **Feature**: Expose Options() accessor on service clients.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.20.3 (2023-11-28.2)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.20.2 (2023-11-28)
|
||||
|
||||
* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction.
|
||||
|
||||
# v1.20.1 (2023-11-20)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.20.0 (2023-11-17)
|
||||
|
||||
* **Feature**: Adding support for `sso-oauth:CreateTokenWithIAM`.
|
||||
|
||||
# v1.19.2 (2023-11-15)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.19.1 (2023-11-09)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.19.0 (2023-11-01)
|
||||
|
||||
* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.18.0 (2023-10-31)
|
||||
|
||||
* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.17.3 (2023-10-12)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.17.2 (2023-10-06)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.17.1 (2023-09-22)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.17.0 (2023-09-20)
|
||||
|
||||
* **Feature**: Update FIPS endpoints in aws-us-gov.
|
||||
|
||||
# v1.16.0 (2023-09-18)
|
||||
|
||||
* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service.
|
||||
* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field.
|
||||
|
||||
# v1.15.6 (2023-09-05)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.15.5 (2023-08-21)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.15.4 (2023-08-18)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.15.3 (2023-08-17)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.15.2 (2023-08-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.15.1 (2023-08-01)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.15.0 (2023-07-31)
|
||||
|
||||
* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.14.14 (2023-07-28)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.14.13 (2023-07-13)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.14.12 (2023-06-15)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.14.11 (2023-06-13)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.14.10 (2023-05-04)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.14.9 (2023-04-24)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.14.8 (2023-04-10)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.14.7 (2023-04-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.14.6 (2023-03-21)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.14.5 (2023-03-10)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
266
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go
generated
vendored
266
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go
generated
vendored
@ -4,12 +4,15 @@ package ssooidc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/defaults"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/retry"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
|
||||
internalauth "github.com/aws/aws-sdk-go-v2/internal/auth"
|
||||
internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy"
|
||||
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
smithydocument "github.com/aws/smithy-go/document"
|
||||
@ -45,12 +48,22 @@ func New(options Options, optFns ...func(*Options)) *Client {
|
||||
|
||||
resolveHTTPSignerV4(&options)
|
||||
|
||||
resolveDefaultEndpointConfiguration(&options)
|
||||
resolveEndpointResolverV2(&options)
|
||||
|
||||
resolveAuthSchemeResolver(&options)
|
||||
|
||||
for _, fn := range optFns {
|
||||
fn(&options)
|
||||
}
|
||||
|
||||
finalizeRetryMaxAttempts(&options)
|
||||
|
||||
ignoreAnonymousAuth(&options)
|
||||
|
||||
wrapWithAnonymousAuth(&options)
|
||||
|
||||
resolveAuthSchemes(&options)
|
||||
|
||||
client := &Client{
|
||||
options: options,
|
||||
}
|
||||
@ -58,115 +71,25 @@ func New(options Options, optFns ...func(*Options)) *Client {
|
||||
return client
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
// Set of options to modify how an operation is invoked. These apply to all
|
||||
// operations invoked for this client. Use functional options on operation call to
|
||||
// modify this list for per operation behavior.
|
||||
APIOptions []func(*middleware.Stack) error
|
||||
|
||||
// Configures the events that will be sent to the configured logger.
|
||||
ClientLogMode aws.ClientLogMode
|
||||
|
||||
// The credentials object to use when signing requests.
|
||||
Credentials aws.CredentialsProvider
|
||||
|
||||
// The configuration DefaultsMode that the SDK should use when constructing the
|
||||
// clients initial default settings.
|
||||
DefaultsMode aws.DefaultsMode
|
||||
|
||||
// The endpoint options to be used when attempting to resolve an endpoint.
|
||||
EndpointOptions EndpointResolverOptions
|
||||
|
||||
// The service endpoint resolver.
|
||||
EndpointResolver EndpointResolver
|
||||
|
||||
// Signature Version 4 (SigV4) Signer
|
||||
HTTPSignerV4 HTTPSignerV4
|
||||
|
||||
// The logger writer interface to write logging messages to.
|
||||
Logger logging.Logger
|
||||
|
||||
// The region to send requests to. (Required)
|
||||
Region string
|
||||
|
||||
// RetryMaxAttempts specifies the maximum number attempts an API client will call
|
||||
// an operation that fails with a retryable error. A value of 0 is ignored, and
|
||||
// will not be used to configure the API client created default retryer, or modify
|
||||
// per operation call's retry max attempts. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. If specified in an operation call's functional
|
||||
// options with a value that is different than the constructed client's Options,
|
||||
// the Client's Retryer will be wrapped to use the operation's specific
|
||||
// RetryMaxAttempts value.
|
||||
RetryMaxAttempts int
|
||||
|
||||
// RetryMode specifies the retry mode the API client will be created with, if
|
||||
// Retryer option is not also specified. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
RetryMode aws.RetryMode
|
||||
|
||||
// Retryer guides how HTTP requests should be retried in case of recoverable
|
||||
// failures. When nil the API client will use a default retryer. The kind of
|
||||
// default retry created by the API client can be changed with the RetryMode
|
||||
// option.
|
||||
Retryer aws.Retryer
|
||||
|
||||
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
|
||||
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You
|
||||
// should not populate this structure programmatically, or rely on the values here
|
||||
// within your applications.
|
||||
RuntimeEnvironment aws.RuntimeEnvironment
|
||||
|
||||
// The initial DefaultsMode used when the client options were constructed. If the
|
||||
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
|
||||
// value was at that point in time. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
resolvedDefaultsMode aws.DefaultsMode
|
||||
|
||||
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
|
||||
// implementation if nil.
|
||||
HTTPClient HTTPClient
|
||||
// Options returns a copy of the client configuration.
|
||||
//
|
||||
// Callers SHOULD NOT perform mutations on any inner structures within client
|
||||
// config. Config overrides should instead be made on a per-operation basis through
|
||||
// functional options.
|
||||
func (c *Client) Options() Options {
|
||||
return c.options.Copy()
|
||||
}
|
||||
|
||||
// WithAPIOptions returns a functional option for setting the Client's APIOptions
|
||||
// option.
|
||||
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, optFns...)
|
||||
}
|
||||
}
|
||||
|
||||
// WithEndpointResolver returns a functional option for setting the Client's
|
||||
// EndpointResolver option.
|
||||
func WithEndpointResolver(v EndpointResolver) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolver = v
|
||||
}
|
||||
}
|
||||
|
||||
type HTTPClient interface {
|
||||
Do(*http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
// Copy creates a clone where the APIOptions list is deep copied.
|
||||
func (o Options) Copy() Options {
|
||||
to := o
|
||||
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
|
||||
copy(to.APIOptions, o.APIOptions)
|
||||
|
||||
return to
|
||||
}
|
||||
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
|
||||
ctx = middleware.ClearStackValues(ctx)
|
||||
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
|
||||
options := c.options.Copy()
|
||||
|
||||
for _, fn := range optFns {
|
||||
fn(&options)
|
||||
}
|
||||
|
||||
finalizeRetryMaxAttemptOptions(&options, *c)
|
||||
finalizeOperationRetryMaxAttempts(&options, *c)
|
||||
|
||||
finalizeClientEndpointResolverOptions(&options)
|
||||
|
||||
@ -194,8 +117,89 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf
|
||||
return result, metadata, err
|
||||
}
|
||||
|
||||
type operationInputKey struct{}
|
||||
|
||||
func setOperationInput(ctx context.Context, input interface{}) context.Context {
|
||||
return middleware.WithStackValue(ctx, operationInputKey{}, input)
|
||||
}
|
||||
|
||||
func getOperationInput(ctx context.Context) interface{} {
|
||||
return middleware.GetStackValue(ctx, operationInputKey{})
|
||||
}
|
||||
|
||||
type setOperationInputMiddleware struct {
|
||||
}
|
||||
|
||||
func (*setOperationInputMiddleware) ID() string {
|
||||
return "setOperationInput"
|
||||
}
|
||||
|
||||
func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
ctx = setOperationInput(ctx, in.Parameters)
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error {
|
||||
if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil {
|
||||
return fmt.Errorf("add ResolveAuthScheme: %w", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil {
|
||||
return fmt.Errorf("add GetIdentity: %v", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil {
|
||||
return fmt.Errorf("add ResolveEndpointV2: %v", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil {
|
||||
return fmt.Errorf("add Signing: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func resolveAuthSchemeResolver(options *Options) {
|
||||
if options.AuthSchemeResolver == nil {
|
||||
options.AuthSchemeResolver = &defaultAuthSchemeResolver{}
|
||||
}
|
||||
}
|
||||
|
||||
func resolveAuthSchemes(options *Options) {
|
||||
if options.AuthSchemes == nil {
|
||||
options.AuthSchemes = []smithyhttp.AuthScheme{
|
||||
internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{
|
||||
Signer: options.HTTPSignerV4,
|
||||
Logger: options.Logger,
|
||||
LogSigning: options.ClientLogMode.IsSigning(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type noSmithyDocumentSerde = smithydocument.NoSerde
|
||||
|
||||
type legacyEndpointContextSetter struct {
|
||||
LegacyResolver EndpointResolver
|
||||
}
|
||||
|
||||
func (*legacyEndpointContextSetter) ID() string {
|
||||
return "legacyEndpointContextSetter"
|
||||
}
|
||||
|
||||
func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
if m.LegacyResolver != nil {
|
||||
ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true)
|
||||
}
|
||||
|
||||
return next.HandleInitialize(ctx, in)
|
||||
|
||||
}
|
||||
func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error {
|
||||
return stack.Initialize.Add(&legacyEndpointContextSetter{
|
||||
LegacyResolver: o.EndpointResolver,
|
||||
}, middleware.Before)
|
||||
}
|
||||
|
||||
func resolveDefaultLogger(o *Options) {
|
||||
if o.Logger != nil {
|
||||
return
|
||||
@ -233,6 +237,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
|
||||
APIOptions: cfg.APIOptions,
|
||||
Logger: cfg.Logger,
|
||||
ClientLogMode: cfg.ClientLogMode,
|
||||
AppID: cfg.AppID,
|
||||
}
|
||||
resolveAWSRetryerProvider(cfg, &opts)
|
||||
resolveAWSRetryMaxAttempts(cfg, &opts)
|
||||
@ -240,6 +245,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
|
||||
resolveAWSEndpointResolver(cfg, &opts)
|
||||
resolveUseDualStackEndpoint(cfg, &opts)
|
||||
resolveUseFIPSEndpoint(cfg, &opts)
|
||||
resolveBaseEndpoint(cfg, &opts)
|
||||
return New(opts, optFns...)
|
||||
}
|
||||
|
||||
@ -331,7 +337,15 @@ func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
|
||||
o.RetryMaxAttempts = cfg.RetryMaxAttempts
|
||||
}
|
||||
|
||||
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
|
||||
func finalizeRetryMaxAttempts(o *Options) {
|
||||
if o.RetryMaxAttempts == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
|
||||
}
|
||||
|
||||
func finalizeOperationRetryMaxAttempts(o *Options, client Client) {
|
||||
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
|
||||
return
|
||||
}
|
||||
@ -343,20 +357,19 @@ func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
|
||||
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
|
||||
return
|
||||
}
|
||||
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
|
||||
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions)
|
||||
}
|
||||
|
||||
func addClientUserAgent(stack *middleware.Stack) error {
|
||||
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ssooidc", goModuleVersion)(stack)
|
||||
}
|
||||
func addClientUserAgent(stack *middleware.Stack, options Options) error {
|
||||
if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ssooidc", goModuleVersion)(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
|
||||
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
|
||||
CredentialsProvider: o.Credentials,
|
||||
Signer: o.HTTPSignerV4,
|
||||
LogSigning: o.ClientLogMode.IsSigning(),
|
||||
})
|
||||
return stack.Finalize.Add(mw, middleware.After)
|
||||
if len(options.AppID) > 0 {
|
||||
return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type HTTPSignerV4 interface {
|
||||
@ -431,3 +444,32 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
|
||||
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
|
||||
}, middleware.After)
|
||||
}
|
||||
|
||||
type disableHTTPSMiddleware struct {
|
||||
DisableHTTPS bool
|
||||
}
|
||||
|
||||
func (*disableHTTPSMiddleware) ID() string {
|
||||
return "disableHTTPS"
|
||||
}
|
||||
|
||||
func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
|
||||
}
|
||||
|
||||
if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) {
|
||||
req.URL.Scheme = "http"
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {
|
||||
return stack.Finalize.Insert(&disableHTTPSMiddleware{
|
||||
DisableHTTPS: o.EndpointOptions.DisableHTTPS,
|
||||
}, "ResolveEndpointV2", middleware.After)
|
||||
}
|
||||
|
104
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go
generated
vendored
104
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go
generated
vendored
@ -4,14 +4,16 @@ package ssooidc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
// Creates and returns an access token for the authorized client. The access token
|
||||
// issued will be used to fetch short-term credentials for the assigned roles in
|
||||
// the AWS account.
|
||||
// Creates and returns access and refresh tokens for clients that are
|
||||
// authenticated using client secrets. The access token can be used to fetch
|
||||
// short-term credentials for the assigned AWS accounts or to access application
|
||||
// APIs using bearer authentication.
|
||||
func (c *Client) CreateToken(ctx context.Context, params *CreateTokenInput, optFns ...func(*Options)) (*CreateTokenOutput, error) {
|
||||
if params == nil {
|
||||
params = &CreateTokenInput{}
|
||||
@ -29,8 +31,8 @@ func (c *Client) CreateToken(ctx context.Context, params *CreateTokenInput, optF
|
||||
|
||||
type CreateTokenInput struct {
|
||||
|
||||
// The unique identifier string for each client. This value should come from the
|
||||
// persisted result of the RegisterClient API.
|
||||
// The unique identifier string for the client or application. This value comes
|
||||
// from the result of the RegisterClient API.
|
||||
//
|
||||
// This member is required.
|
||||
ClientId *string
|
||||
@ -41,38 +43,42 @@ type CreateTokenInput struct {
|
||||
// This member is required.
|
||||
ClientSecret *string
|
||||
|
||||
// Supports grant types for the authorization code, refresh token, and device code
|
||||
// request. For device code requests, specify the following value:
|
||||
// urn:ietf:params:oauth:grant-type:device_code For information about how to
|
||||
// obtain the device code, see the StartDeviceAuthorization topic.
|
||||
// Supports the following OAuth grant types: Device Code and Refresh Token.
|
||||
// Specify either of the following values, depending on the grant type that you
|
||||
// want: * Device Code - urn:ietf:params:oauth:grant-type:device_code * Refresh
|
||||
// Token - refresh_token For information about how to obtain the device code, see
|
||||
// the StartDeviceAuthorization topic.
|
||||
//
|
||||
// This member is required.
|
||||
GrantType *string
|
||||
|
||||
// The authorization code received from the authorization service. This parameter
|
||||
// is required to perform an authorization grant request to get access to a token.
|
||||
// Used only when calling this API for the Authorization Code grant type. The
|
||||
// short-term code is used to identify this authorization request. This grant type
|
||||
// is currently unsupported for the CreateToken API.
|
||||
Code *string
|
||||
|
||||
// Used only when calling this API for the device code grant type. This short-term
|
||||
// code is used to identify this authentication attempt. This should come from an
|
||||
// in-memory reference to the result of the StartDeviceAuthorization API.
|
||||
// Used only when calling this API for the Device Code grant type. This short-term
|
||||
// code is used to identify this authorization request. This comes from the result
|
||||
// of the StartDeviceAuthorization API.
|
||||
DeviceCode *string
|
||||
|
||||
// The location of the application that will receive the authorization code. Users
|
||||
// authorize the service to send the request to this location.
|
||||
// Used only when calling this API for the Authorization Code grant type. This
|
||||
// value specifies the location of the client or application that has registered to
|
||||
// receive the authorization code.
|
||||
RedirectUri *string
|
||||
|
||||
// Currently, refreshToken is not yet implemented and is not supported. For more
|
||||
// information about the features and limitations of the current IAM Identity
|
||||
// Center OIDC implementation, see Considerations for Using this Guide in the IAM
|
||||
// Identity Center OIDC API Reference
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html).
|
||||
// The token used to obtain an access token in the event that the access token is
|
||||
// invalid or expired.
|
||||
// Used only when calling this API for the Refresh Token grant type. This token is
|
||||
// used to refresh short-term tokens, such as the access token, that might expire.
|
||||
// For more information about the features and limitations of the current IAM
|
||||
// Identity Center OIDC implementation, see Considerations for Using this Guide in
|
||||
// the IAM Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html)
|
||||
// .
|
||||
RefreshToken *string
|
||||
|
||||
// The list of scopes that is defined by the client. Upon authorization, this list
|
||||
// is used to restrict permissions when granting an access token.
|
||||
// The list of scopes for which authorization is requested. The access token that
|
||||
// is issued is limited to the scopes that are granted. If this value is not
|
||||
// specified, IAM Identity Center authorizes all scopes that are configured for the
|
||||
// client during the call to RegisterClient .
|
||||
Scope []string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
@ -80,31 +86,30 @@ type CreateTokenInput struct {
|
||||
|
||||
type CreateTokenOutput struct {
|
||||
|
||||
// An opaque token to access IAM Identity Center resources assigned to a user.
|
||||
// A bearer token to access AWS accounts and applications assigned to a user.
|
||||
AccessToken *string
|
||||
|
||||
// Indicates the time in seconds when an access token will expire.
|
||||
ExpiresIn int32
|
||||
|
||||
// Currently, idToken is not yet implemented and is not supported. For more
|
||||
// information about the features and limitations of the current IAM Identity
|
||||
// Center OIDC implementation, see Considerations for Using this Guide in the IAM
|
||||
// Identity Center OIDC API Reference
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html).
|
||||
// The identifier of the user that associated with the access token, if present.
|
||||
// The idToken is not implemented or supported. For more information about the
|
||||
// features and limitations of the current IAM Identity Center OIDC implementation,
|
||||
// see Considerations for Using this Guide in the IAM Identity Center OIDC API
|
||||
// Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html)
|
||||
// . A JSON Web Token (JWT) that identifies who is associated with the issued
|
||||
// access token.
|
||||
IdToken *string
|
||||
|
||||
// Currently, refreshToken is not yet implemented and is not supported. For more
|
||||
// information about the features and limitations of the current IAM Identity
|
||||
// Center OIDC implementation, see Considerations for Using this Guide in the IAM
|
||||
// Identity Center OIDC API Reference
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html).
|
||||
// A token that, if present, can be used to refresh a previously issued access
|
||||
// token that might have expired.
|
||||
// token that might have expired. For more information about the features and
|
||||
// limitations of the current IAM Identity Center OIDC implementation, see
|
||||
// Considerations for Using this Guide in the IAM Identity Center OIDC API
|
||||
// Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html)
|
||||
// .
|
||||
RefreshToken *string
|
||||
|
||||
// Used to notify the client that the returned token is an access token. The
|
||||
// supported type is BearerToken.
|
||||
// supported token type is Bearer .
|
||||
TokenType *string
|
||||
|
||||
// Metadata pertaining to the operation's result.
|
||||
@ -114,6 +119,9 @@ type CreateTokenOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateToken{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -122,6 +130,13 @@ func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, opt
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "CreateToken"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -143,7 +158,7 @@ func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, opt
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -152,12 +167,18 @@ func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, opt
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpCreateTokenValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateToken(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -167,6 +188,9 @@ func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, opt
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
230
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go
generated
vendored
Normal file
230
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateTokenWithIAM.go
generated
vendored
Normal file
@ -0,0 +1,230 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package ssooidc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
// Creates and returns access and refresh tokens for clients and applications that
|
||||
// are authenticated using IAM entities. The access token can be used to fetch
|
||||
// short-term credentials for the assigned AWS accounts or to access application
|
||||
// APIs using bearer authentication.
|
||||
func (c *Client) CreateTokenWithIAM(ctx context.Context, params *CreateTokenWithIAMInput, optFns ...func(*Options)) (*CreateTokenWithIAMOutput, error) {
|
||||
if params == nil {
|
||||
params = &CreateTokenWithIAMInput{}
|
||||
}
|
||||
|
||||
result, metadata, err := c.invokeOperation(ctx, "CreateTokenWithIAM", params, optFns, c.addOperationCreateTokenWithIAMMiddlewares)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out := result.(*CreateTokenWithIAMOutput)
|
||||
out.ResultMetadata = metadata
|
||||
return out, nil
|
||||
}
|
||||
|
||||
type CreateTokenWithIAMInput struct {
|
||||
|
||||
// The unique identifier string for the client or application. This value is an
|
||||
// application ARN that has OAuth grants configured.
|
||||
//
|
||||
// This member is required.
|
||||
ClientId *string
|
||||
|
||||
// Supports the following OAuth grant types: Authorization Code, Refresh Token,
|
||||
// JWT Bearer, and Token Exchange. Specify one of the following values, depending
|
||||
// on the grant type that you want: * Authorization Code - authorization_code *
|
||||
// Refresh Token - refresh_token * JWT Bearer -
|
||||
// urn:ietf:params:oauth:grant-type:jwt-bearer * Token Exchange -
|
||||
// urn:ietf:params:oauth:grant-type:token-exchange
|
||||
//
|
||||
// This member is required.
|
||||
GrantType *string
|
||||
|
||||
// Used only when calling this API for the JWT Bearer grant type. This value
|
||||
// specifies the JSON Web Token (JWT) issued by a trusted token issuer. To
|
||||
// authorize a trusted token issuer, configure the JWT Bearer GrantOptions for the
|
||||
// application.
|
||||
Assertion *string
|
||||
|
||||
// Used only when calling this API for the Authorization Code grant type. This
|
||||
// short-term code is used to identify this authorization request. The code is
|
||||
// obtained through a redirect from IAM Identity Center to a redirect URI persisted
|
||||
// in the Authorization Code GrantOptions for the application.
|
||||
Code *string
|
||||
|
||||
// Used only when calling this API for the Authorization Code grant type. This
|
||||
// value specifies the location of the client or application that has registered to
|
||||
// receive the authorization code.
|
||||
RedirectUri *string
|
||||
|
||||
// Used only when calling this API for the Refresh Token grant type. This token is
|
||||
// used to refresh short-term tokens, such as the access token, that might expire.
|
||||
// For more information about the features and limitations of the current IAM
|
||||
// Identity Center OIDC implementation, see Considerations for Using this Guide in
|
||||
// the IAM Identity Center OIDC API Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html)
|
||||
// .
|
||||
RefreshToken *string
|
||||
|
||||
// Used only when calling this API for the Token Exchange grant type. This value
|
||||
// specifies the type of token that the requester can receive. The following values
|
||||
// are supported: * Access Token - urn:ietf:params:oauth:token-type:access_token *
|
||||
// Refresh Token - urn:ietf:params:oauth:token-type:refresh_token
|
||||
RequestedTokenType *string
|
||||
|
||||
// The list of scopes for which authorization is requested. The access token that
|
||||
// is issued is limited to the scopes that are granted. If the value is not
|
||||
// specified, IAM Identity Center authorizes all scopes configured for the
|
||||
// application, including the following default scopes: openid , aws ,
|
||||
// sts:identity_context .
|
||||
Scope []string
|
||||
|
||||
// Used only when calling this API for the Token Exchange grant type. This value
|
||||
// specifies the subject of the exchange. The value of the subject token must be an
|
||||
// access token issued by IAM Identity Center to a different client or application.
|
||||
// The access token must have authorized scopes that indicate the requested
|
||||
// application as a target audience.
|
||||
SubjectToken *string
|
||||
|
||||
// Used only when calling this API for the Token Exchange grant type. This value
|
||||
// specifies the type of token that is passed as the subject of the exchange. The
|
||||
// following value is supported: * Access Token -
|
||||
// urn:ietf:params:oauth:token-type:access_token
|
||||
SubjectTokenType *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
type CreateTokenWithIAMOutput struct {
|
||||
|
||||
// A bearer token to access AWS accounts and applications assigned to a user.
|
||||
AccessToken *string
|
||||
|
||||
// Indicates the time in seconds when an access token will expire.
|
||||
ExpiresIn int32
|
||||
|
||||
// A JSON Web Token (JWT) that identifies the user associated with the issued
|
||||
// access token.
|
||||
IdToken *string
|
||||
|
||||
// Indicates the type of tokens that are issued by IAM Identity Center. The
|
||||
// following values are supported: * Access Token -
|
||||
// urn:ietf:params:oauth:token-type:access_token * Refresh Token -
|
||||
// urn:ietf:params:oauth:token-type:refresh_token
|
||||
IssuedTokenType *string
|
||||
|
||||
// A token that, if present, can be used to refresh a previously issued access
|
||||
// token that might have expired. For more information about the features and
|
||||
// limitations of the current IAM Identity Center OIDC implementation, see
|
||||
// Considerations for Using this Guide in the IAM Identity Center OIDC API
|
||||
// Reference (https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html)
|
||||
// .
|
||||
RefreshToken *string
|
||||
|
||||
// The list of scopes for which authorization is granted. The access token that is
|
||||
// issued is limited to the scopes that are granted.
|
||||
Scope []string
|
||||
|
||||
// Used to notify the requester that the returned token is an access token. The
|
||||
// supported token type is Bearer .
|
||||
TokenType *string
|
||||
|
||||
// Metadata pertaining to the operation's result.
|
||||
ResultMetadata middleware.Metadata
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateTokenWithIAM{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateTokenWithIAM{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "CreateTokenWithIAM"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResolveEndpointMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpCreateTokenWithIAMValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTokenWithIAM(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResponseErrorMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func newServiceMetadataMiddleware_opCreateTokenWithIAM(region string) *awsmiddleware.RegisterServiceMetadata {
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
OperationName: "CreateTokenWithIAM",
|
||||
}
|
||||
}
|
34
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go
generated
vendored
34
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go
generated
vendored
@ -4,6 +4,7 @@ package ssooidc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
@ -40,8 +41,8 @@ type RegisterClientInput struct {
|
||||
// This member is required.
|
||||
ClientType *string
|
||||
|
||||
// The list of scopes that are defined by the client. Upon authorization, this list
|
||||
// is used to restrict permissions when granting an access token.
|
||||
// The list of scopes that are defined by the client. Upon authorization, this
|
||||
// list is used to restrict permissions when granting an access token.
|
||||
Scopes []string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
@ -49,7 +50,7 @@ type RegisterClientInput struct {
|
||||
|
||||
type RegisterClientOutput struct {
|
||||
|
||||
// The endpoint where the client can request authorization.
|
||||
// An endpoint that the client can use to request authorization.
|
||||
AuthorizationEndpoint *string
|
||||
|
||||
// The unique identifier string for each client. This client uses this identifier
|
||||
@ -59,14 +60,14 @@ type RegisterClientOutput struct {
|
||||
// Indicates the time at which the clientId and clientSecret were issued.
|
||||
ClientIdIssuedAt int64
|
||||
|
||||
// A secret string generated for the client. The client will use this string to get
|
||||
// authenticated by the service in subsequent calls.
|
||||
// A secret string generated for the client. The client will use this string to
|
||||
// get authenticated by the service in subsequent calls.
|
||||
ClientSecret *string
|
||||
|
||||
// Indicates the time at which the clientId and clientSecret will become invalid.
|
||||
ClientSecretExpiresAt int64
|
||||
|
||||
// The endpoint where the client can get an access token.
|
||||
// An endpoint that the client can use to create tokens.
|
||||
TokenEndpoint *string
|
||||
|
||||
// Metadata pertaining to the operation's result.
|
||||
@ -76,6 +77,9 @@ type RegisterClientOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterClient{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -84,6 +88,13 @@ func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack,
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterClient"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -105,7 +116,7 @@ func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack,
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -114,12 +125,18 @@ func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack,
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpRegisterClientValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterClient(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -129,6 +146,9 @@ func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack,
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
39
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go
generated
vendored
39
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go
generated
vendored
@ -4,6 +4,7 @@ package ssooidc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
@ -28,9 +29,9 @@ func (c *Client) StartDeviceAuthorization(ctx context.Context, params *StartDevi
|
||||
|
||||
type StartDeviceAuthorizationInput struct {
|
||||
|
||||
// The unique identifier string for the client that is registered with IAM Identity
|
||||
// Center. This value should come from the persisted result of the RegisterClient
|
||||
// API operation.
|
||||
// The unique identifier string for the client that is registered with IAM
|
||||
// Identity Center. This value should come from the persisted result of the
|
||||
// RegisterClient API operation.
|
||||
//
|
||||
// This member is required.
|
||||
ClientId *string
|
||||
@ -41,9 +42,8 @@ type StartDeviceAuthorizationInput struct {
|
||||
// This member is required.
|
||||
ClientSecret *string
|
||||
|
||||
// The URL for the AWS access portal. For more information, see Using the AWS
|
||||
// access portal
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html)
|
||||
// The URL for the Amazon Web Services access portal. For more information, see
|
||||
// Using the Amazon Web Services access portal (https://docs.aws.amazon.com/singlesignon/latest/userguide/using-the-portal.html)
|
||||
// in the IAM Identity Center User Guide.
|
||||
//
|
||||
// This member is required.
|
||||
@ -73,9 +73,9 @@ type StartDeviceAuthorizationOutput struct {
|
||||
// device.
|
||||
VerificationUri *string
|
||||
|
||||
// An alternate URL that the client can use to automatically launch a browser. This
|
||||
// process skips the manual step in which the user visits the verification page and
|
||||
// enters their code.
|
||||
// An alternate URL that the client can use to automatically launch a browser.
|
||||
// This process skips the manual step in which the user visits the verification
|
||||
// page and enters their code.
|
||||
VerificationUriComplete *string
|
||||
|
||||
// Metadata pertaining to the operation's result.
|
||||
@ -85,6 +85,9 @@ type StartDeviceAuthorizationOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsRestjson1_serializeOpStartDeviceAuthorization{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -93,6 +96,13 @@ func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middlewa
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "StartDeviceAuthorization"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -114,7 +124,7 @@ func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middlewa
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -123,12 +133,18 @@ func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middlewa
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpStartDeviceAuthorizationValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDeviceAuthorization(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -138,6 +154,9 @@ func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middlewa
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
302
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go
generated
vendored
Normal file
302
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/auth.go
generated
vendored
Normal file
@ -0,0 +1,302 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package ssooidc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) {
|
||||
params.Region = options.Region
|
||||
}
|
||||
|
||||
type setLegacyContextSigningOptionsMiddleware struct {
|
||||
}
|
||||
|
||||
func (*setLegacyContextSigningOptionsMiddleware) ID() string {
|
||||
return "setLegacyContextSigningOptions"
|
||||
}
|
||||
|
||||
func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
schemeID := rscheme.Scheme.SchemeID()
|
||||
|
||||
if sn := awsmiddleware.GetSigningName(ctx); sn != "" {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn)
|
||||
} else if schemeID == "aws.auth#sigv4a" {
|
||||
smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn)
|
||||
}
|
||||
}
|
||||
|
||||
if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr)
|
||||
} else if schemeID == "aws.auth#sigv4a" {
|
||||
smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr})
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error {
|
||||
return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before)
|
||||
}
|
||||
|
||||
type withAnonymous struct {
|
||||
resolver AuthSchemeResolver
|
||||
}
|
||||
|
||||
var _ AuthSchemeResolver = (*withAnonymous)(nil)
|
||||
|
||||
func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {
|
||||
opts, err := v.resolver.ResolveAuthSchemes(ctx, params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
opts = append(opts, &smithyauth.Option{
|
||||
SchemeID: smithyauth.SchemeIDAnonymous,
|
||||
})
|
||||
return opts, nil
|
||||
}
|
||||
|
||||
func wrapWithAnonymousAuth(options *Options) {
|
||||
if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok {
|
||||
return
|
||||
}
|
||||
|
||||
options.AuthSchemeResolver = &withAnonymous{
|
||||
resolver: options.AuthSchemeResolver,
|
||||
}
|
||||
}
|
||||
|
||||
// AuthResolverParameters contains the set of inputs necessary for auth scheme
|
||||
// resolution.
|
||||
type AuthResolverParameters struct {
|
||||
// The name of the operation being invoked.
|
||||
Operation string
|
||||
|
||||
// The region in which the operation is being invoked.
|
||||
Region string
|
||||
}
|
||||
|
||||
func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters {
|
||||
params := &AuthResolverParameters{
|
||||
Operation: operation,
|
||||
}
|
||||
|
||||
bindAuthParamsRegion(params, input, options)
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
// AuthSchemeResolver returns a set of possible authentication options for an
|
||||
// operation.
|
||||
type AuthSchemeResolver interface {
|
||||
ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error)
|
||||
}
|
||||
|
||||
type defaultAuthSchemeResolver struct{}
|
||||
|
||||
var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil)
|
||||
|
||||
func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {
|
||||
if overrides, ok := operationAuthOptions[params.Operation]; ok {
|
||||
return overrides(params), nil
|
||||
}
|
||||
return serviceAuthOptions(params), nil
|
||||
}
|
||||
|
||||
var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{
|
||||
"CreateToken": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
|
||||
"RegisterClient": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
|
||||
"StartDeviceAuthorization": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: smithyauth.SchemeIDSigV4,
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var props smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&props, "sso-oauth")
|
||||
smithyhttp.SetSigV4SigningRegion(&props, params.Region)
|
||||
return props
|
||||
}(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type resolveAuthSchemeMiddleware struct {
|
||||
operation string
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*resolveAuthSchemeMiddleware) ID() string {
|
||||
return "ResolveAuthScheme"
|
||||
}
|
||||
|
||||
func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options)
|
||||
options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("resolve auth scheme: %w", err)
|
||||
}
|
||||
|
||||
scheme, ok := m.selectScheme(options)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("could not select an auth scheme")
|
||||
}
|
||||
|
||||
ctx = setResolvedAuthScheme(ctx, scheme)
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) {
|
||||
for _, option := range options {
|
||||
if option.SchemeID == smithyauth.SchemeIDAnonymous {
|
||||
return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true
|
||||
}
|
||||
|
||||
for _, scheme := range m.options.AuthSchemes {
|
||||
if scheme.SchemeID() != option.SchemeID {
|
||||
continue
|
||||
}
|
||||
|
||||
if scheme.IdentityResolver(m.options) != nil {
|
||||
return newResolvedAuthScheme(scheme, option), true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil, false
|
||||
}
|
||||
|
||||
type resolvedAuthSchemeKey struct{}
|
||||
|
||||
type resolvedAuthScheme struct {
|
||||
Scheme smithyhttp.AuthScheme
|
||||
IdentityProperties smithy.Properties
|
||||
SignerProperties smithy.Properties
|
||||
}
|
||||
|
||||
func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme {
|
||||
return &resolvedAuthScheme{
|
||||
Scheme: scheme,
|
||||
IdentityProperties: option.IdentityProperties,
|
||||
SignerProperties: option.SignerProperties,
|
||||
}
|
||||
}
|
||||
|
||||
func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context {
|
||||
return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme)
|
||||
}
|
||||
|
||||
func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme {
|
||||
v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme)
|
||||
return v
|
||||
}
|
||||
|
||||
type getIdentityMiddleware struct {
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*getIdentityMiddleware) ID() string {
|
||||
return "GetIdentity"
|
||||
}
|
||||
|
||||
func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
resolver := rscheme.Scheme.IdentityResolver(m.options)
|
||||
if resolver == nil {
|
||||
return out, metadata, fmt.Errorf("no identity resolver")
|
||||
}
|
||||
|
||||
identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("get identity: %w", err)
|
||||
}
|
||||
|
||||
ctx = setIdentity(ctx, identity)
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
type identityKey struct{}
|
||||
|
||||
func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context {
|
||||
return middleware.WithStackValue(ctx, identityKey{}, identity)
|
||||
}
|
||||
|
||||
func getIdentity(ctx context.Context) smithyauth.Identity {
|
||||
v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity)
|
||||
return v
|
||||
}
|
||||
|
||||
type signRequestMiddleware struct {
|
||||
}
|
||||
|
||||
func (*signRequestMiddleware) ID() string {
|
||||
return "Signing"
|
||||
}
|
||||
|
||||
func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request)
|
||||
}
|
||||
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
identity := getIdentity(ctx)
|
||||
if identity == nil {
|
||||
return out, metadata, fmt.Errorf("no identity")
|
||||
}
|
||||
|
||||
signer := rscheme.Scheme.Signer()
|
||||
if signer == nil {
|
||||
return out, metadata, fmt.Errorf("no signer")
|
||||
}
|
||||
|
||||
if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil {
|
||||
return out, metadata, fmt.Errorf("sign request: %w", err)
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
377
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go
generated
vendored
377
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go
generated
vendored
@ -239,6 +239,244 @@ func awsRestjson1_deserializeOpDocumentCreateTokenOutput(v **CreateTokenOutput,
|
||||
return nil
|
||||
}
|
||||
|
||||
type awsRestjson1_deserializeOpCreateTokenWithIAM struct {
|
||||
}
|
||||
|
||||
func (*awsRestjson1_deserializeOpCreateTokenWithIAM) ID() string {
|
||||
return "OperationDeserializer"
|
||||
}
|
||||
|
||||
func (m *awsRestjson1_deserializeOpCreateTokenWithIAM) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
||||
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
out, metadata, err = next.HandleDeserialize(ctx, in)
|
||||
if err != nil {
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
response, ok := out.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
||||
}
|
||||
|
||||
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
||||
return out, metadata, awsRestjson1_deserializeOpErrorCreateTokenWithIAM(response, &metadata)
|
||||
}
|
||||
output := &CreateTokenWithIAMOutput{}
|
||||
out.Result = output
|
||||
|
||||
var buff [1024]byte
|
||||
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
||||
|
||||
body := io.TeeReader(response.Body, ringBuffer)
|
||||
|
||||
decoder := json.NewDecoder(body)
|
||||
decoder.UseNumber()
|
||||
var shape interface{}
|
||||
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
err = &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
err = awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(&output, shape)
|
||||
if err != nil {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
return out, metadata, &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
}
|
||||
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeOpErrorCreateTokenWithIAM(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
||||
var errorBuffer bytes.Buffer
|
||||
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
||||
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
||||
}
|
||||
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
||||
|
||||
errorCode := "UnknownError"
|
||||
errorMessage := errorCode
|
||||
|
||||
headerCode := response.Header.Get("X-Amzn-ErrorType")
|
||||
if len(headerCode) != 0 {
|
||||
errorCode = restjson.SanitizeErrorCode(headerCode)
|
||||
}
|
||||
|
||||
var buff [1024]byte
|
||||
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
||||
|
||||
body := io.TeeReader(errorBody, ringBuffer)
|
||||
decoder := json.NewDecoder(body)
|
||||
decoder.UseNumber()
|
||||
jsonCode, message, err := restjson.GetErrorInfo(decoder)
|
||||
if err != nil {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
err = &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
errorBody.Seek(0, io.SeekStart)
|
||||
if len(headerCode) == 0 && len(jsonCode) != 0 {
|
||||
errorCode = restjson.SanitizeErrorCode(jsonCode)
|
||||
}
|
||||
if len(message) != 0 {
|
||||
errorMessage = message
|
||||
}
|
||||
|
||||
switch {
|
||||
case strings.EqualFold("AccessDeniedException", errorCode):
|
||||
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("AuthorizationPendingException", errorCode):
|
||||
return awsRestjson1_deserializeErrorAuthorizationPendingException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("ExpiredTokenException", errorCode):
|
||||
return awsRestjson1_deserializeErrorExpiredTokenException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("InternalServerException", errorCode):
|
||||
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("InvalidClientException", errorCode):
|
||||
return awsRestjson1_deserializeErrorInvalidClientException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("InvalidGrantException", errorCode):
|
||||
return awsRestjson1_deserializeErrorInvalidGrantException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("InvalidRequestException", errorCode):
|
||||
return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("InvalidRequestRegionException", errorCode):
|
||||
return awsRestjson1_deserializeErrorInvalidRequestRegionException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("InvalidScopeException", errorCode):
|
||||
return awsRestjson1_deserializeErrorInvalidScopeException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("SlowDownException", errorCode):
|
||||
return awsRestjson1_deserializeErrorSlowDownException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("UnauthorizedClientException", errorCode):
|
||||
return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("UnsupportedGrantTypeException", errorCode):
|
||||
return awsRestjson1_deserializeErrorUnsupportedGrantTypeException(response, errorBody)
|
||||
|
||||
default:
|
||||
genericError := &smithy.GenericAPIError{
|
||||
Code: errorCode,
|
||||
Message: errorMessage,
|
||||
}
|
||||
return genericError
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(v **CreateTokenWithIAMOutput, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
}
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
shape, ok := value.(map[string]interface{})
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected JSON type %v", value)
|
||||
}
|
||||
|
||||
var sv *CreateTokenWithIAMOutput
|
||||
if *v == nil {
|
||||
sv = &CreateTokenWithIAMOutput{}
|
||||
} else {
|
||||
sv = *v
|
||||
}
|
||||
|
||||
for key, value := range shape {
|
||||
switch key {
|
||||
case "accessToken":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected AccessToken to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.AccessToken = ptr.String(jtv)
|
||||
}
|
||||
|
||||
case "expiresIn":
|
||||
if value != nil {
|
||||
jtv, ok := value.(json.Number)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected ExpirationInSeconds to be json.Number, got %T instead", value)
|
||||
}
|
||||
i64, err := jtv.Int64()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
sv.ExpiresIn = int32(i64)
|
||||
}
|
||||
|
||||
case "idToken":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected IdToken to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.IdToken = ptr.String(jtv)
|
||||
}
|
||||
|
||||
case "issuedTokenType":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected TokenTypeURI to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.IssuedTokenType = ptr.String(jtv)
|
||||
}
|
||||
|
||||
case "refreshToken":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected RefreshToken to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.RefreshToken = ptr.String(jtv)
|
||||
}
|
||||
|
||||
case "scope":
|
||||
if err := awsRestjson1_deserializeDocumentScopes(&sv.Scope, value); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
case "tokenType":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected TokenType to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.TokenType = ptr.String(jtv)
|
||||
}
|
||||
|
||||
default:
|
||||
_, _ = key, value
|
||||
|
||||
}
|
||||
}
|
||||
*v = sv
|
||||
return nil
|
||||
}
|
||||
|
||||
type awsRestjson1_deserializeOpRegisterClient struct {
|
||||
}
|
||||
|
||||
@ -956,6 +1194,42 @@ func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.R
|
||||
return output
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeErrorInvalidRequestRegionException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
||||
output := &types.InvalidRequestRegionException{}
|
||||
var buff [1024]byte
|
||||
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
||||
|
||||
body := io.TeeReader(errorBody, ringBuffer)
|
||||
decoder := json.NewDecoder(body)
|
||||
decoder.UseNumber()
|
||||
var shape interface{}
|
||||
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
err = &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
err := awsRestjson1_deserializeDocumentInvalidRequestRegionException(&output, shape)
|
||||
|
||||
if err != nil {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
err = &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
errorBody.Seek(0, io.SeekStart)
|
||||
|
||||
return output
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeErrorInvalidScopeException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
|
||||
output := &types.InvalidScopeException{}
|
||||
var buff [1024]byte
|
||||
@ -1492,6 +1766,73 @@ func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRe
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentInvalidRequestRegionException(v **types.InvalidRequestRegionException, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
}
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
shape, ok := value.(map[string]interface{})
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected JSON type %v", value)
|
||||
}
|
||||
|
||||
var sv *types.InvalidRequestRegionException
|
||||
if *v == nil {
|
||||
sv = &types.InvalidRequestRegionException{}
|
||||
} else {
|
||||
sv = *v
|
||||
}
|
||||
|
||||
for key, value := range shape {
|
||||
switch key {
|
||||
case "endpoint":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected Location to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.Endpoint = ptr.String(jtv)
|
||||
}
|
||||
|
||||
case "error":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected Error to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.Error_ = ptr.String(jtv)
|
||||
}
|
||||
|
||||
case "error_description":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected ErrorDescription to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.Error_description = ptr.String(jtv)
|
||||
}
|
||||
|
||||
case "region":
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected Region to be of type string, got %T instead", value)
|
||||
}
|
||||
sv.Region = ptr.String(jtv)
|
||||
}
|
||||
|
||||
default:
|
||||
_, _ = key, value
|
||||
|
||||
}
|
||||
}
|
||||
*v = sv
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentInvalidScopeException(v **types.InvalidScopeException, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
@ -1541,6 +1882,42 @@ func awsRestjson1_deserializeDocumentInvalidScopeException(v **types.InvalidScop
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentScopes(v *[]string, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
}
|
||||
if value == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
shape, ok := value.([]interface{})
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected JSON type %v", value)
|
||||
}
|
||||
|
||||
var cv []string
|
||||
if *v == nil {
|
||||
cv = []string{}
|
||||
} else {
|
||||
cv = *v
|
||||
}
|
||||
|
||||
for _, value := range shape {
|
||||
var col string
|
||||
if value != nil {
|
||||
jtv, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected Scope to be of type string, got %T instead", value)
|
||||
}
|
||||
col = jtv
|
||||
}
|
||||
cv = append(cv, col)
|
||||
|
||||
}
|
||||
*v = cv
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_deserializeDocumentSlowDownException(v **types.SlowDownException, value interface{}) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
|
74
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go
generated
vendored
74
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go
generated
vendored
@ -1,46 +1,38 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
// Package ssooidc provides the API client, operations, and parameter types for AWS
|
||||
// SSO OIDC.
|
||||
// Package ssooidc provides the API client, operations, and parameter types for
|
||||
// AWS SSO OIDC.
|
||||
//
|
||||
// AWS IAM Identity Center (successor to AWS Single Sign-On) OpenID Connect (OIDC)
|
||||
// is a web service that enables a client (such as AWS CLI or a native application)
|
||||
// to register with IAM Identity Center. The service also enables the client to
|
||||
// fetch the user’s access token upon successful authentication and authorization
|
||||
// with IAM Identity Center. Although AWS Single Sign-On was renamed, the sso and
|
||||
// identitystore API namespaces will continue to retain their original name for
|
||||
// backward compatibility purposes. For more information, see IAM Identity Center
|
||||
// rename
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html#renamed).
|
||||
// Considerations for Using This Guide Before you begin using this guide, we
|
||||
// recommend that you first review the following important information about how
|
||||
// the IAM Identity Center OIDC service works.
|
||||
// IAM Identity Center OpenID Connect (OIDC) is a web service that enables a
|
||||
// client (such as CLI or a native application) to register with IAM Identity
|
||||
// Center. The service also enables the client to fetch the user’s access token
|
||||
// upon successful authentication and authorization with IAM Identity Center. IAM
|
||||
// Identity Center uses the sso and identitystore API namespaces. Considerations
|
||||
// for Using This Guide Before you begin using this guide, we recommend that you
|
||||
// first review the following important information about how the IAM Identity
|
||||
// Center OIDC service works.
|
||||
// - The IAM Identity Center OIDC service currently implements only the portions
|
||||
// of the OAuth 2.0 Device Authorization Grant standard (
|
||||
// https://tools.ietf.org/html/rfc8628 (https://tools.ietf.org/html/rfc8628) )
|
||||
// that are necessary to enable single sign-on authentication with the CLI.
|
||||
// - With older versions of the CLI, the service only emits OIDC access tokens,
|
||||
// so to obtain a new token, users must explicitly re-authenticate. To access the
|
||||
// OIDC flow that supports token refresh and doesn’t require re-authentication,
|
||||
// update to the latest CLI version (1.27.10 for CLI V1 and 2.9.0 for CLI V2) with
|
||||
// support for OIDC token refresh and configurable IAM Identity Center session
|
||||
// durations. For more information, see Configure Amazon Web Services access
|
||||
// portal session duration (https://docs.aws.amazon.com/singlesignon/latest/userguide/configure-user-session.html)
|
||||
// .
|
||||
// - The access tokens provided by this service grant access to all Amazon Web
|
||||
// Services account entitlements assigned to an IAM Identity Center user, not just
|
||||
// a particular application.
|
||||
// - The documentation in this guide does not describe the mechanism to convert
|
||||
// the access token into Amazon Web Services Auth (“sigv4”) credentials for use
|
||||
// with IAM-protected Amazon Web Services service endpoints. For more information,
|
||||
// see GetRoleCredentials (https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html)
|
||||
// in the IAM Identity Center Portal API Reference Guide.
|
||||
//
|
||||
// * The IAM Identity Center OIDC
|
||||
// service currently implements only the portions of the OAuth 2.0 Device
|
||||
// Authorization Grant standard (https://tools.ietf.org/html/rfc8628
|
||||
// (https://tools.ietf.org/html/rfc8628)) that are necessary to enable single
|
||||
// sign-on authentication with the AWS CLI. Support for other OIDC flows frequently
|
||||
// needed for native applications, such as Authorization Code Flow (+ PKCE), will
|
||||
// be addressed in future releases.
|
||||
//
|
||||
// * The service emits only OIDC access tokens,
|
||||
// such that obtaining a new token (For example, token refresh) requires explicit
|
||||
// user re-authentication.
|
||||
//
|
||||
// * The access tokens provided by this service grant
|
||||
// access to all AWS account entitlements assigned to an IAM Identity Center user,
|
||||
// not just a particular application.
|
||||
//
|
||||
// * The documentation in this guide does not
|
||||
// describe the mechanism to convert the access token into AWS Auth (“sigv4”)
|
||||
// credentials for use with IAM-protected AWS service endpoints. For more
|
||||
// information, see GetRoleCredentials
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/PortalAPIReference/API_GetRoleCredentials.html)
|
||||
// in the IAM Identity Center Portal API Reference Guide.
|
||||
//
|
||||
// For general information
|
||||
// about IAM Identity Center, see What is IAM Identity Center?
|
||||
// (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html) in the
|
||||
// IAM Identity Center User Guide.
|
||||
// For general information about IAM Identity Center, see What is IAM Identity
|
||||
// Center? (https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html)
|
||||
// in the IAM Identity Center User Guide.
|
||||
package ssooidc
|
||||
|
392
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go
generated
vendored
392
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go
generated
vendored
@ -8,10 +8,18 @@ import (
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints"
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn"
|
||||
internalendpoints "github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
"github.com/aws/smithy-go/ptr"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -39,13 +47,6 @@ func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointRe
|
||||
return fn(region, options)
|
||||
}
|
||||
|
||||
func resolveDefaultEndpointConfiguration(o *Options) {
|
||||
if o.EndpointResolver != nil {
|
||||
return
|
||||
}
|
||||
o.EndpointResolver = NewDefaultEndpointResolver()
|
||||
}
|
||||
|
||||
// EndpointResolverFromURL returns an EndpointResolver configured using the
|
||||
// provided endpoint url. By default, the resolved endpoint resolver uses the
|
||||
// client region as signing region, and the endpoint source is set to
|
||||
@ -79,6 +80,10 @@ func (*ResolveEndpoint) ID() string {
|
||||
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) {
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
|
||||
@ -94,6 +99,11 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser
|
||||
var endpoint aws.Endpoint
|
||||
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
|
||||
if err != nil {
|
||||
nf := (&aws.EndpointNotFoundError{})
|
||||
if errors.As(err, &nf) {
|
||||
ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false)
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
@ -105,7 +115,7 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser
|
||||
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
|
||||
signingName := endpoint.SigningName
|
||||
if len(signingName) == 0 {
|
||||
signingName = "awsssooidc"
|
||||
signingName = "sso-oauth"
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
}
|
||||
@ -129,27 +139,10 @@ func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
|
||||
|
||||
type wrappedEndpointResolver struct {
|
||||
awsResolver aws.EndpointResolverWithOptions
|
||||
resolver EndpointResolver
|
||||
}
|
||||
|
||||
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
|
||||
if w.awsResolver == nil {
|
||||
goto fallback
|
||||
}
|
||||
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
|
||||
if err == nil {
|
||||
return endpoint, nil
|
||||
}
|
||||
|
||||
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
|
||||
return endpoint, err
|
||||
}
|
||||
|
||||
fallback:
|
||||
if w.resolver == nil {
|
||||
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
|
||||
}
|
||||
return w.resolver.ResolveEndpoint(region, options)
|
||||
return w.awsResolver.ResolveEndpoint(ServiceID, region, options)
|
||||
}
|
||||
|
||||
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
|
||||
@ -160,12 +153,13 @@ func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, opti
|
||||
|
||||
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
|
||||
|
||||
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
|
||||
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
|
||||
// fallbackResolver for resolution.
|
||||
// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver.
|
||||
// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error,
|
||||
// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked
|
||||
// via its middleware.
|
||||
//
|
||||
// fallbackResolver must not be nil
|
||||
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
|
||||
// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated.
|
||||
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver {
|
||||
var resolver aws.EndpointResolverWithOptions
|
||||
|
||||
if awsResolverWithOptions != nil {
|
||||
@ -176,7 +170,6 @@ func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptio
|
||||
|
||||
return &wrappedEndpointResolver{
|
||||
awsResolver: resolver,
|
||||
resolver: fallbackResolver,
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,3 +191,338 @@ func finalizeClientEndpointResolverOptions(options *Options) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func resolveEndpointResolverV2(options *Options) {
|
||||
if options.EndpointResolverV2 == nil {
|
||||
options.EndpointResolverV2 = NewDefaultEndpointResolverV2()
|
||||
}
|
||||
}
|
||||
|
||||
func resolveBaseEndpoint(cfg aws.Config, o *Options) {
|
||||
if cfg.BaseEndpoint != nil {
|
||||
o.BaseEndpoint = cfg.BaseEndpoint
|
||||
}
|
||||
|
||||
_, g := os.LookupEnv("AWS_ENDPOINT_URL")
|
||||
_, s := os.LookupEnv("AWS_ENDPOINT_URL_SSO_OIDC")
|
||||
|
||||
if g && !s {
|
||||
return
|
||||
}
|
||||
|
||||
value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "SSO OIDC", cfg.ConfigSources)
|
||||
if found && err == nil {
|
||||
o.BaseEndpoint = &value
|
||||
}
|
||||
}
|
||||
|
||||
// EndpointParameters provides the parameters that influence how endpoints are
|
||||
// resolved.
|
||||
type EndpointParameters struct {
|
||||
// The AWS region used to dispatch the request.
|
||||
//
|
||||
// Parameter is
|
||||
// required.
|
||||
//
|
||||
// AWS::Region
|
||||
Region *string
|
||||
|
||||
// When true, use the dual-stack endpoint. If the configured endpoint does not
|
||||
// support dual-stack, dispatching the request MAY return an error.
|
||||
//
|
||||
// Defaults to
|
||||
// false if no value is provided.
|
||||
//
|
||||
// AWS::UseDualStack
|
||||
UseDualStack *bool
|
||||
|
||||
// When true, send this request to the FIPS-compliant regional endpoint. If the
|
||||
// configured endpoint does not have a FIPS compliant endpoint, dispatching the
|
||||
// request will return an error.
|
||||
//
|
||||
// Defaults to false if no value is
|
||||
// provided.
|
||||
//
|
||||
// AWS::UseFIPS
|
||||
UseFIPS *bool
|
||||
|
||||
// Override the endpoint used to send this request
|
||||
//
|
||||
// Parameter is
|
||||
// required.
|
||||
//
|
||||
// SDK::Endpoint
|
||||
Endpoint *string
|
||||
}
|
||||
|
||||
// ValidateRequired validates required parameters are set.
|
||||
func (p EndpointParameters) ValidateRequired() error {
|
||||
if p.UseDualStack == nil {
|
||||
return fmt.Errorf("parameter UseDualStack is required")
|
||||
}
|
||||
|
||||
if p.UseFIPS == nil {
|
||||
return fmt.Errorf("parameter UseFIPS is required")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithDefaults returns a shallow copy of EndpointParameterswith default values
|
||||
// applied to members where applicable.
|
||||
func (p EndpointParameters) WithDefaults() EndpointParameters {
|
||||
if p.UseDualStack == nil {
|
||||
p.UseDualStack = ptr.Bool(false)
|
||||
}
|
||||
|
||||
if p.UseFIPS == nil {
|
||||
p.UseFIPS = ptr.Bool(false)
|
||||
}
|
||||
return p
|
||||
}
|
||||
|
||||
// EndpointResolverV2 provides the interface for resolving service endpoints.
|
||||
type EndpointResolverV2 interface {
|
||||
// ResolveEndpoint attempts to resolve the endpoint with the provided options,
|
||||
// returning the endpoint if found. Otherwise an error is returned.
|
||||
ResolveEndpoint(ctx context.Context, params EndpointParameters) (
|
||||
smithyendpoints.Endpoint, error,
|
||||
)
|
||||
}
|
||||
|
||||
// resolver provides the implementation for resolving endpoints.
|
||||
type resolver struct{}
|
||||
|
||||
func NewDefaultEndpointResolverV2() EndpointResolverV2 {
|
||||
return &resolver{}
|
||||
}
|
||||
|
||||
// ResolveEndpoint attempts to resolve the endpoint with the provided options,
|
||||
// returning the endpoint if found. Otherwise an error is returned.
|
||||
func (r *resolver) ResolveEndpoint(
|
||||
ctx context.Context, params EndpointParameters,
|
||||
) (
|
||||
endpoint smithyendpoints.Endpoint, err error,
|
||||
) {
|
||||
params = params.WithDefaults()
|
||||
if err = params.ValidateRequired(); err != nil {
|
||||
return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err)
|
||||
}
|
||||
_UseDualStack := *params.UseDualStack
|
||||
_UseFIPS := *params.UseFIPS
|
||||
|
||||
if exprVal := params.Endpoint; exprVal != nil {
|
||||
_Endpoint := *exprVal
|
||||
_ = _Endpoint
|
||||
if _UseFIPS == true {
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported")
|
||||
}
|
||||
if _UseDualStack == true {
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported")
|
||||
}
|
||||
uriString := _Endpoint
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
if exprVal := params.Region; exprVal != nil {
|
||||
_Region := *exprVal
|
||||
_ = _Region
|
||||
if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil {
|
||||
_PartitionResult := *exprVal
|
||||
_ = _PartitionResult
|
||||
if _UseFIPS == true {
|
||||
if _UseDualStack == true {
|
||||
if true == _PartitionResult.SupportsFIPS {
|
||||
if true == _PartitionResult.SupportsDualStack {
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://oidc-fips.")
|
||||
out.WriteString(_Region)
|
||||
out.WriteString(".")
|
||||
out.WriteString(_PartitionResult.DualStackDnsSuffix)
|
||||
return out.String()
|
||||
}()
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both")
|
||||
}
|
||||
}
|
||||
if _UseFIPS == true {
|
||||
if _PartitionResult.SupportsFIPS == true {
|
||||
if _PartitionResult.Name == "aws-us-gov" {
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://oidc.")
|
||||
out.WriteString(_Region)
|
||||
out.WriteString(".amazonaws.com")
|
||||
return out.String()
|
||||
}()
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://oidc-fips.")
|
||||
out.WriteString(_Region)
|
||||
out.WriteString(".")
|
||||
out.WriteString(_PartitionResult.DnsSuffix)
|
||||
return out.String()
|
||||
}()
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS")
|
||||
}
|
||||
if _UseDualStack == true {
|
||||
if true == _PartitionResult.SupportsDualStack {
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://oidc.")
|
||||
out.WriteString(_Region)
|
||||
out.WriteString(".")
|
||||
out.WriteString(_PartitionResult.DualStackDnsSuffix)
|
||||
return out.String()
|
||||
}()
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack")
|
||||
}
|
||||
uriString := func() string {
|
||||
var out strings.Builder
|
||||
out.WriteString("https://oidc.")
|
||||
out.WriteString(_Region)
|
||||
out.WriteString(".")
|
||||
out.WriteString(_PartitionResult.DnsSuffix)
|
||||
return out.String()
|
||||
}()
|
||||
|
||||
uri, err := url.Parse(uriString)
|
||||
if err != nil {
|
||||
return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString)
|
||||
}
|
||||
|
||||
return smithyendpoints.Endpoint{
|
||||
URI: *uri,
|
||||
Headers: http.Header{},
|
||||
}, nil
|
||||
}
|
||||
return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.")
|
||||
}
|
||||
return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region")
|
||||
}
|
||||
|
||||
type endpointParamsBinder interface {
|
||||
bindEndpointParams(*EndpointParameters)
|
||||
}
|
||||
|
||||
func bindEndpointParams(input interface{}, options Options) *EndpointParameters {
|
||||
params := &EndpointParameters{}
|
||||
|
||||
params.Region = aws.String(endpoints.MapFIPSRegion(options.Region))
|
||||
params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled)
|
||||
params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled)
|
||||
params.Endpoint = options.BaseEndpoint
|
||||
|
||||
if b, ok := input.(endpointParamsBinder); ok {
|
||||
b.bindEndpointParams(params)
|
||||
}
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
type resolveEndpointV2Middleware struct {
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*resolveEndpointV2Middleware) ID() string {
|
||||
return "ResolveEndpointV2"
|
||||
}
|
||||
|
||||
func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
if awsmiddleware.GetRequiresLegacyEndpoints(ctx) {
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
|
||||
}
|
||||
|
||||
if m.options.EndpointResolverV2 == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
params := bindEndpointParams(getOperationInput(ctx), m.options)
|
||||
endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
if endpt.URI.RawPath == "" && req.URL.RawPath != "" {
|
||||
endpt.URI.RawPath = endpt.URI.Path
|
||||
}
|
||||
req.URL.Scheme = endpt.URI.Scheme
|
||||
req.URL.Host = endpt.URI.Host
|
||||
req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path)
|
||||
req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath)
|
||||
for k := range endpt.Headers {
|
||||
req.Header.Set(k, endpt.Headers.Get(k))
|
||||
}
|
||||
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
opts, _ := smithyauth.GetAuthOptions(&endpt.Properties)
|
||||
for _, o := range opts {
|
||||
rscheme.SignerProperties.SetAll(&o.SignerProperties)
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
8
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json
generated
vendored
8
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json
generated
vendored
@ -3,20 +3,26 @@
|
||||
"github.com/aws/aws-sdk-go-v2": "v1.4.0",
|
||||
"github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/smithy-go": "v1.4.0"
|
||||
"github.com/aws/smithy-go": "v1.4.0",
|
||||
"github.com/google/go-cmp": "v0.5.4"
|
||||
},
|
||||
"files": [
|
||||
"api_client.go",
|
||||
"api_client_test.go",
|
||||
"api_op_CreateToken.go",
|
||||
"api_op_CreateTokenWithIAM.go",
|
||||
"api_op_RegisterClient.go",
|
||||
"api_op_StartDeviceAuthorization.go",
|
||||
"auth.go",
|
||||
"deserializers.go",
|
||||
"doc.go",
|
||||
"endpoints.go",
|
||||
"endpoints_config_test.go",
|
||||
"endpoints_test.go",
|
||||
"generated.json",
|
||||
"internal/endpoints/endpoints.go",
|
||||
"internal/endpoints/endpoints_test.go",
|
||||
"options.go",
|
||||
"protocol_test.go",
|
||||
"serializers.go",
|
||||
"types/errors.go",
|
||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
||||
package ssooidc
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.14.5"
|
||||
const goModuleVersion = "1.21.7"
|
||||
|
90
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go
generated
vendored
90
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go
generated
vendored
@ -89,13 +89,17 @@ var partitionRegexp = struct {
|
||||
AwsCn *regexp.Regexp
|
||||
AwsIso *regexp.Regexp
|
||||
AwsIsoB *regexp.Regexp
|
||||
AwsIsoE *regexp.Regexp
|
||||
AwsIsoF *regexp.Regexp
|
||||
AwsUsGov *regexp.Regexp
|
||||
}{
|
||||
|
||||
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
|
||||
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"),
|
||||
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
|
||||
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
|
||||
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
|
||||
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
|
||||
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
|
||||
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
|
||||
}
|
||||
|
||||
@ -223,6 +227,14 @@ var defaultPartitions = endpoints.Partitions{
|
||||
Region: "eu-central-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-central-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.eu-central-2.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "eu-central-2",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-north-1",
|
||||
}: endpoints.Endpoint{
|
||||
@ -263,6 +275,22 @@ var defaultPartitions = endpoints.Partitions{
|
||||
Region: "eu-west-3",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "il-central-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.il-central-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "il-central-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "me-central-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.me-central-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "me-central-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "me-south-1",
|
||||
}: endpoints.Endpoint{
|
||||
@ -347,6 +375,24 @@ var defaultPartitions = endpoints.Partitions{
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsCn,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
endpoints.EndpointKey{
|
||||
Region: "cn-north-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.cn-north-1.amazonaws.com.cn",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "cn-north-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "cn-northwest-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.cn-northwest-1.amazonaws.com.cn",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "cn-northwest-1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-iso",
|
||||
@ -390,6 +436,48 @@ var defaultPartitions = endpoints.Partitions{
|
||||
RegionRegex: partitionRegexp.AwsIsoB,
|
||||
IsRegionalized: true,
|
||||
},
|
||||
{
|
||||
ID: "aws-iso-e",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "oidc-fips.{region}.cloud.adc-e.uk",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "oidc.{region}.cloud.adc-e.uk",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIsoE,
|
||||
IsRegionalized: true,
|
||||
},
|
||||
{
|
||||
ID: "aws-iso-f",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "oidc-fips.{region}.csp.hci.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "oidc.{region}.csp.hci.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIsoF,
|
||||
IsRegionalized: true,
|
||||
},
|
||||
{
|
||||
ID: "aws-us-gov",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
|
217
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go
generated
vendored
Normal file
217
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/options.go
generated
vendored
Normal file
@ -0,0 +1,217 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package ssooidc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
"github.com/aws/smithy-go/logging"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type HTTPClient interface {
|
||||
Do(*http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
// Set of options to modify how an operation is invoked. These apply to all
|
||||
// operations invoked for this client. Use functional options on operation call to
|
||||
// modify this list for per operation behavior.
|
||||
APIOptions []func(*middleware.Stack) error
|
||||
|
||||
// The optional application specific identifier appended to the User-Agent header.
|
||||
AppID string
|
||||
|
||||
// This endpoint will be given as input to an EndpointResolverV2. It is used for
|
||||
// providing a custom base endpoint that is subject to modifications by the
|
||||
// processing EndpointResolverV2.
|
||||
BaseEndpoint *string
|
||||
|
||||
// Configures the events that will be sent to the configured logger.
|
||||
ClientLogMode aws.ClientLogMode
|
||||
|
||||
// The credentials object to use when signing requests.
|
||||
Credentials aws.CredentialsProvider
|
||||
|
||||
// The configuration DefaultsMode that the SDK should use when constructing the
|
||||
// clients initial default settings.
|
||||
DefaultsMode aws.DefaultsMode
|
||||
|
||||
// The endpoint options to be used when attempting to resolve an endpoint.
|
||||
EndpointOptions EndpointResolverOptions
|
||||
|
||||
// The service endpoint resolver.
|
||||
//
|
||||
// Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a
|
||||
// value for this field will likely prevent you from using any endpoint-related
|
||||
// service features released after the introduction of EndpointResolverV2 and
|
||||
// BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom
|
||||
// endpoint, set the client option BaseEndpoint instead.
|
||||
EndpointResolver EndpointResolver
|
||||
|
||||
// Resolves the endpoint used for a particular service operation. This should be
|
||||
// used over the deprecated EndpointResolver.
|
||||
EndpointResolverV2 EndpointResolverV2
|
||||
|
||||
// Signature Version 4 (SigV4) Signer
|
||||
HTTPSignerV4 HTTPSignerV4
|
||||
|
||||
// The logger writer interface to write logging messages to.
|
||||
Logger logging.Logger
|
||||
|
||||
// The region to send requests to. (Required)
|
||||
Region string
|
||||
|
||||
// RetryMaxAttempts specifies the maximum number attempts an API client will call
|
||||
// an operation that fails with a retryable error. A value of 0 is ignored, and
|
||||
// will not be used to configure the API client created default retryer, or modify
|
||||
// per operation call's retry max attempts. If specified in an operation call's
|
||||
// functional options with a value that is different than the constructed client's
|
||||
// Options, the Client's Retryer will be wrapped to use the operation's specific
|
||||
// RetryMaxAttempts value.
|
||||
RetryMaxAttempts int
|
||||
|
||||
// RetryMode specifies the retry mode the API client will be created with, if
|
||||
// Retryer option is not also specified. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
RetryMode aws.RetryMode
|
||||
|
||||
// Retryer guides how HTTP requests should be retried in case of recoverable
|
||||
// failures. When nil the API client will use a default retryer. The kind of
|
||||
// default retry created by the API client can be changed with the RetryMode
|
||||
// option.
|
||||
Retryer aws.Retryer
|
||||
|
||||
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
|
||||
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
|
||||
// should not populate this structure programmatically, or rely on the values here
|
||||
// within your applications.
|
||||
RuntimeEnvironment aws.RuntimeEnvironment
|
||||
|
||||
// The initial DefaultsMode used when the client options were constructed. If the
|
||||
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
|
||||
// value was at that point in time. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
resolvedDefaultsMode aws.DefaultsMode
|
||||
|
||||
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
|
||||
// implementation if nil.
|
||||
HTTPClient HTTPClient
|
||||
|
||||
// The auth scheme resolver which determines how to authenticate for each
|
||||
// operation.
|
||||
AuthSchemeResolver AuthSchemeResolver
|
||||
|
||||
// The list of auth schemes supported by the client.
|
||||
AuthSchemes []smithyhttp.AuthScheme
|
||||
}
|
||||
|
||||
// Copy creates a clone where the APIOptions list is deep copied.
|
||||
func (o Options) Copy() Options {
|
||||
to := o
|
||||
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
|
||||
copy(to.APIOptions, o.APIOptions)
|
||||
|
||||
return to
|
||||
}
|
||||
|
||||
func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
return getSigV4IdentityResolver(o)
|
||||
}
|
||||
if schemeID == "smithy.api#noAuth" {
|
||||
return &smithyauth.AnonymousIdentityResolver{}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithAPIOptions returns a functional option for setting the Client's APIOptions
|
||||
// option.
|
||||
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, optFns...)
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for
|
||||
// this field will likely prevent you from using any endpoint-related service
|
||||
// features released after the introduction of EndpointResolverV2 and BaseEndpoint.
|
||||
// To migrate an EndpointResolver implementation that uses a custom endpoint, set
|
||||
// the client option BaseEndpoint instead.
|
||||
func WithEndpointResolver(v EndpointResolver) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolver = v
|
||||
}
|
||||
}
|
||||
|
||||
// WithEndpointResolverV2 returns a functional option for setting the Client's
|
||||
// EndpointResolverV2 option.
|
||||
func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolverV2 = v
|
||||
}
|
||||
}
|
||||
|
||||
func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver {
|
||||
if o.Credentials != nil {
|
||||
return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithSigV4SigningName applies an override to the authentication workflow to
|
||||
// use the given signing name for SigV4-authenticated operations.
|
||||
//
|
||||
// This is an advanced setting. The value here is FINAL, taking precedence over
|
||||
// the resolved signing name from both auth scheme resolution and endpoint
|
||||
// resolution.
|
||||
func WithSigV4SigningName(name string) func(*Options) {
|
||||
fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in)
|
||||
}
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {
|
||||
return s.Initialize.Add(
|
||||
middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn),
|
||||
middleware.Before,
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// WithSigV4SigningRegion applies an override to the authentication workflow to
|
||||
// use the given signing region for SigV4-authenticated operations.
|
||||
//
|
||||
// This is an advanced setting. The value here is FINAL, taking precedence over
|
||||
// the resolved signing region from both auth scheme resolution and endpoint
|
||||
// resolution.
|
||||
func WithSigV4SigningRegion(region string) func(*Options) {
|
||||
fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in)
|
||||
}
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {
|
||||
return s.Initialize.Add(
|
||||
middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn),
|
||||
middleware.Before,
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func ignoreAnonymousAuth(options *Options) {
|
||||
if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) {
|
||||
options.Credentials = nil
|
||||
}
|
||||
}
|
149
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go
generated
vendored
149
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go
generated
vendored
@ -38,7 +38,14 @@ func (m *awsRestjson1_serializeOpCreateToken) HandleSerialize(ctx context.Contex
|
||||
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
|
||||
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
|
||||
request.Method = "POST"
|
||||
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
var restEncoder *httpbinding.Encoder
|
||||
if request.URL.RawPath == "" {
|
||||
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
} else {
|
||||
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
|
||||
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
@ -118,6 +125,128 @@ func awsRestjson1_serializeOpDocumentCreateTokenInput(v *CreateTokenInput, value
|
||||
return nil
|
||||
}
|
||||
|
||||
type awsRestjson1_serializeOpCreateTokenWithIAM struct {
|
||||
}
|
||||
|
||||
func (*awsRestjson1_serializeOpCreateTokenWithIAM) ID() string {
|
||||
return "OperationSerializer"
|
||||
}
|
||||
|
||||
func (m *awsRestjson1_serializeOpCreateTokenWithIAM) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
request, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
|
||||
}
|
||||
|
||||
input, ok := in.Parameters.(*CreateTokenWithIAMInput)
|
||||
_ = input
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
|
||||
}
|
||||
|
||||
opPath, opQuery := httpbinding.SplitURI("/token?aws_iam=t")
|
||||
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
|
||||
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
|
||||
request.Method = "POST"
|
||||
var restEncoder *httpbinding.Encoder
|
||||
if request.URL.RawPath == "" {
|
||||
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
} else {
|
||||
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
|
||||
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
|
||||
restEncoder.SetHeader("Content-Type").String("application/json")
|
||||
|
||||
jsonEncoder := smithyjson.NewEncoder()
|
||||
if err := awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(input, jsonEncoder.Value); err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
|
||||
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
|
||||
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
in.Request = request
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
func awsRestjson1_serializeOpHttpBindingsCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, encoder *httpbinding.Encoder) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unsupported serialization of nil %T", v)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_serializeOpDocumentCreateTokenWithIAMInput(v *CreateTokenWithIAMInput, value smithyjson.Value) error {
|
||||
object := value.Object()
|
||||
defer object.Close()
|
||||
|
||||
if v.Assertion != nil {
|
||||
ok := object.Key("assertion")
|
||||
ok.String(*v.Assertion)
|
||||
}
|
||||
|
||||
if v.ClientId != nil {
|
||||
ok := object.Key("clientId")
|
||||
ok.String(*v.ClientId)
|
||||
}
|
||||
|
||||
if v.Code != nil {
|
||||
ok := object.Key("code")
|
||||
ok.String(*v.Code)
|
||||
}
|
||||
|
||||
if v.GrantType != nil {
|
||||
ok := object.Key("grantType")
|
||||
ok.String(*v.GrantType)
|
||||
}
|
||||
|
||||
if v.RedirectUri != nil {
|
||||
ok := object.Key("redirectUri")
|
||||
ok.String(*v.RedirectUri)
|
||||
}
|
||||
|
||||
if v.RefreshToken != nil {
|
||||
ok := object.Key("refreshToken")
|
||||
ok.String(*v.RefreshToken)
|
||||
}
|
||||
|
||||
if v.RequestedTokenType != nil {
|
||||
ok := object.Key("requestedTokenType")
|
||||
ok.String(*v.RequestedTokenType)
|
||||
}
|
||||
|
||||
if v.Scope != nil {
|
||||
ok := object.Key("scope")
|
||||
if err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if v.SubjectToken != nil {
|
||||
ok := object.Key("subjectToken")
|
||||
ok.String(*v.SubjectToken)
|
||||
}
|
||||
|
||||
if v.SubjectTokenType != nil {
|
||||
ok := object.Key("subjectTokenType")
|
||||
ok.String(*v.SubjectTokenType)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type awsRestjson1_serializeOpRegisterClient struct {
|
||||
}
|
||||
|
||||
@ -143,7 +272,14 @@ func (m *awsRestjson1_serializeOpRegisterClient) HandleSerialize(ctx context.Con
|
||||
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
|
||||
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
|
||||
request.Method = "POST"
|
||||
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
var restEncoder *httpbinding.Encoder
|
||||
if request.URL.RawPath == "" {
|
||||
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
} else {
|
||||
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
|
||||
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
@ -223,7 +359,14 @@ func (m *awsRestjson1_serializeOpStartDeviceAuthorization) HandleSerialize(ctx c
|
||||
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
|
||||
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
|
||||
request.Method = "POST"
|
||||
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
var restEncoder *httpbinding.Encoder
|
||||
if request.URL.RawPath == "" {
|
||||
restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
} else {
|
||||
request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath)
|
||||
restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
|
42
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go
generated
vendored
42
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go
generated
vendored
@ -36,8 +36,8 @@ func (e *AccessDeniedException) ErrorCode() string {
|
||||
}
|
||||
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that a request to authorize a client with an access user session token
|
||||
// is pending.
|
||||
// Indicates that a request to authorize a client with an access user session
|
||||
// token is pending.
|
||||
type AuthorizationPendingException struct {
|
||||
Message *string
|
||||
|
||||
@ -128,7 +128,7 @@ func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy
|
||||
|
||||
// Indicates that the clientId or clientSecret in the request is invalid. For
|
||||
// example, this can occur when a client sends an incorrect clientId or an expired
|
||||
// clientSecret.
|
||||
// clientSecret .
|
||||
type InvalidClientException struct {
|
||||
Message *string
|
||||
|
||||
@ -157,8 +157,8 @@ func (e *InvalidClientException) ErrorCode() string {
|
||||
}
|
||||
func (e *InvalidClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that the client information sent in the request during registration is
|
||||
// invalid.
|
||||
// Indicates that the client information sent in the request during registration
|
||||
// is invalid.
|
||||
type InvalidClientMetadataException struct {
|
||||
Message *string
|
||||
|
||||
@ -247,6 +247,38 @@ func (e *InvalidRequestException) ErrorCode() string {
|
||||
}
|
||||
func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that a token provided as input to the request was issued by and is
|
||||
// only usable by calling IAM Identity Center endpoints in another region.
|
||||
type InvalidRequestRegionException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
Endpoint *string
|
||||
Region *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *InvalidRequestRegionException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *InvalidRequestRegionException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *InvalidRequestRegionException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "InvalidRequestRegionException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *InvalidRequestRegionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that the scope provided in the request is invalid.
|
||||
type InvalidScopeException struct {
|
||||
Message *string
|
||||
|
42
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go
generated
vendored
42
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go
generated
vendored
@ -29,6 +29,26 @@ func (m *validateOpCreateToken) HandleInitialize(ctx context.Context, in middlew
|
||||
return next.HandleInitialize(ctx, in)
|
||||
}
|
||||
|
||||
type validateOpCreateTokenWithIAM struct {
|
||||
}
|
||||
|
||||
func (*validateOpCreateTokenWithIAM) ID() string {
|
||||
return "OperationInputValidation"
|
||||
}
|
||||
|
||||
func (m *validateOpCreateTokenWithIAM) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
input, ok := in.Parameters.(*CreateTokenWithIAMInput)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
|
||||
}
|
||||
if err := validateOpCreateTokenWithIAMInput(input); err != nil {
|
||||
return out, metadata, err
|
||||
}
|
||||
return next.HandleInitialize(ctx, in)
|
||||
}
|
||||
|
||||
type validateOpRegisterClient struct {
|
||||
}
|
||||
|
||||
@ -73,6 +93,10 @@ func addOpCreateTokenValidationMiddleware(stack *middleware.Stack) error {
|
||||
return stack.Initialize.Add(&validateOpCreateToken{}, middleware.After)
|
||||
}
|
||||
|
||||
func addOpCreateTokenWithIAMValidationMiddleware(stack *middleware.Stack) error {
|
||||
return stack.Initialize.Add(&validateOpCreateTokenWithIAM{}, middleware.After)
|
||||
}
|
||||
|
||||
func addOpRegisterClientValidationMiddleware(stack *middleware.Stack) error {
|
||||
return stack.Initialize.Add(&validateOpRegisterClient{}, middleware.After)
|
||||
}
|
||||
@ -102,6 +126,24 @@ func validateOpCreateTokenInput(v *CreateTokenInput) error {
|
||||
}
|
||||
}
|
||||
|
||||
func validateOpCreateTokenWithIAMInput(v *CreateTokenWithIAMInput) error {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
invalidParams := smithy.InvalidParamsError{Context: "CreateTokenWithIAMInput"}
|
||||
if v.ClientId == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("ClientId"))
|
||||
}
|
||||
if v.GrantType == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("GrantType"))
|
||||
}
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func validateOpRegisterClientInput(v *RegisterClientInput) error {
|
||||
if v == nil {
|
||||
return nil
|
||||
|
157
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
157
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
@ -1,3 +1,160 @@
|
||||
# v1.26.7 (2024-01-04)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.26.6 (2023-12-20)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.26.5 (2023-12-08)
|
||||
|
||||
* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein.
|
||||
|
||||
# v1.26.4 (2023-12-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.26.3 (2023-12-06)
|
||||
|
||||
* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously.
|
||||
* **Bug Fix**: STS `AssumeRoleWithSAML` and `AssumeRoleWithWebIdentity` would incorrectly attempt to use SigV4 authentication.
|
||||
|
||||
# v1.26.2 (2023-12-01)
|
||||
|
||||
* **Bug Fix**: Correct wrapping of errors in authentication workflow.
|
||||
* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.26.1 (2023-11-30)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.26.0 (2023-11-29)
|
||||
|
||||
* **Feature**: Expose Options() accessor on service clients.
|
||||
* **Documentation**: Documentation updates for AWS Security Token Service.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.25.6 (2023-11-28.2)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.25.5 (2023-11-28)
|
||||
|
||||
* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction.
|
||||
|
||||
# v1.25.4 (2023-11-20)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.25.3 (2023-11-17)
|
||||
|
||||
* **Documentation**: API updates for the AWS Security Token Service
|
||||
|
||||
# v1.25.2 (2023-11-15)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.25.1 (2023-11-09)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.25.0 (2023-11-01)
|
||||
|
||||
* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.24.0 (2023-10-31)
|
||||
|
||||
* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/).
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.23.2 (2023-10-12)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.23.1 (2023-10-06)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.23.0 (2023-10-02)
|
||||
|
||||
* **Feature**: STS API updates for assumeRole
|
||||
|
||||
# v1.22.0 (2023-09-18)
|
||||
|
||||
* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service.
|
||||
* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field.
|
||||
|
||||
# v1.21.5 (2023-08-21)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.21.4 (2023-08-18)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.21.3 (2023-08-17)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.21.2 (2023-08-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.21.1 (2023-08-01)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.21.0 (2023-07-31)
|
||||
|
||||
* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.20.1 (2023-07-28)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.20.0 (2023-07-25)
|
||||
|
||||
* **Feature**: API updates for the AWS Security Token Service
|
||||
|
||||
# v1.19.3 (2023-07-13)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.19.2 (2023-06-15)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.19.1 (2023-06-13)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.19.0 (2023-05-08)
|
||||
|
||||
* **Feature**: Documentation updates for AWS Security Token Service.
|
||||
|
||||
# v1.18.11 (2023-05-04)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.18.10 (2023-04-24)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.18.9 (2023-04-10)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.18.8 (2023-04-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.18.7 (2023-03-21)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.18.6 (2023-03-10)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
320
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go
generated
vendored
320
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go
generated
vendored
@ -4,6 +4,7 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/defaults"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
@ -11,7 +12,10 @@ import (
|
||||
"github.com/aws/aws-sdk-go-v2/aws/retry"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
|
||||
internalauth "github.com/aws/aws-sdk-go-v2/internal/auth"
|
||||
internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy"
|
||||
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
|
||||
acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding"
|
||||
presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
smithydocument "github.com/aws/smithy-go/document"
|
||||
@ -48,12 +52,22 @@ func New(options Options, optFns ...func(*Options)) *Client {
|
||||
|
||||
resolveHTTPSignerV4(&options)
|
||||
|
||||
resolveDefaultEndpointConfiguration(&options)
|
||||
resolveEndpointResolverV2(&options)
|
||||
|
||||
resolveAuthSchemeResolver(&options)
|
||||
|
||||
for _, fn := range optFns {
|
||||
fn(&options)
|
||||
}
|
||||
|
||||
finalizeRetryMaxAttempts(&options)
|
||||
|
||||
ignoreAnonymousAuth(&options)
|
||||
|
||||
wrapWithAnonymousAuth(&options)
|
||||
|
||||
resolveAuthSchemes(&options)
|
||||
|
||||
client := &Client{
|
||||
options: options,
|
||||
}
|
||||
@ -61,115 +75,25 @@ func New(options Options, optFns ...func(*Options)) *Client {
|
||||
return client
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
// Set of options to modify how an operation is invoked. These apply to all
|
||||
// operations invoked for this client. Use functional options on operation call to
|
||||
// modify this list for per operation behavior.
|
||||
APIOptions []func(*middleware.Stack) error
|
||||
|
||||
// Configures the events that will be sent to the configured logger.
|
||||
ClientLogMode aws.ClientLogMode
|
||||
|
||||
// The credentials object to use when signing requests.
|
||||
Credentials aws.CredentialsProvider
|
||||
|
||||
// The configuration DefaultsMode that the SDK should use when constructing the
|
||||
// clients initial default settings.
|
||||
DefaultsMode aws.DefaultsMode
|
||||
|
||||
// The endpoint options to be used when attempting to resolve an endpoint.
|
||||
EndpointOptions EndpointResolverOptions
|
||||
|
||||
// The service endpoint resolver.
|
||||
EndpointResolver EndpointResolver
|
||||
|
||||
// Signature Version 4 (SigV4) Signer
|
||||
HTTPSignerV4 HTTPSignerV4
|
||||
|
||||
// The logger writer interface to write logging messages to.
|
||||
Logger logging.Logger
|
||||
|
||||
// The region to send requests to. (Required)
|
||||
Region string
|
||||
|
||||
// RetryMaxAttempts specifies the maximum number attempts an API client will call
|
||||
// an operation that fails with a retryable error. A value of 0 is ignored, and
|
||||
// will not be used to configure the API client created default retryer, or modify
|
||||
// per operation call's retry max attempts. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. If specified in an operation call's functional
|
||||
// options with a value that is different than the constructed client's Options,
|
||||
// the Client's Retryer will be wrapped to use the operation's specific
|
||||
// RetryMaxAttempts value.
|
||||
RetryMaxAttempts int
|
||||
|
||||
// RetryMode specifies the retry mode the API client will be created with, if
|
||||
// Retryer option is not also specified. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
RetryMode aws.RetryMode
|
||||
|
||||
// Retryer guides how HTTP requests should be retried in case of recoverable
|
||||
// failures. When nil the API client will use a default retryer. The kind of
|
||||
// default retry created by the API client can be changed with the RetryMode
|
||||
// option.
|
||||
Retryer aws.Retryer
|
||||
|
||||
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
|
||||
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You
|
||||
// should not populate this structure programmatically, or rely on the values here
|
||||
// within your applications.
|
||||
RuntimeEnvironment aws.RuntimeEnvironment
|
||||
|
||||
// The initial DefaultsMode used when the client options were constructed. If the
|
||||
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
|
||||
// value was at that point in time. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
resolvedDefaultsMode aws.DefaultsMode
|
||||
|
||||
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
|
||||
// implementation if nil.
|
||||
HTTPClient HTTPClient
|
||||
// Options returns a copy of the client configuration.
|
||||
//
|
||||
// Callers SHOULD NOT perform mutations on any inner structures within client
|
||||
// config. Config overrides should instead be made on a per-operation basis through
|
||||
// functional options.
|
||||
func (c *Client) Options() Options {
|
||||
return c.options.Copy()
|
||||
}
|
||||
|
||||
// WithAPIOptions returns a functional option for setting the Client's APIOptions
|
||||
// option.
|
||||
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, optFns...)
|
||||
}
|
||||
}
|
||||
|
||||
// WithEndpointResolver returns a functional option for setting the Client's
|
||||
// EndpointResolver option.
|
||||
func WithEndpointResolver(v EndpointResolver) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolver = v
|
||||
}
|
||||
}
|
||||
|
||||
type HTTPClient interface {
|
||||
Do(*http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
// Copy creates a clone where the APIOptions list is deep copied.
|
||||
func (o Options) Copy() Options {
|
||||
to := o
|
||||
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
|
||||
copy(to.APIOptions, o.APIOptions)
|
||||
|
||||
return to
|
||||
}
|
||||
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
|
||||
ctx = middleware.ClearStackValues(ctx)
|
||||
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
|
||||
options := c.options.Copy()
|
||||
|
||||
for _, fn := range optFns {
|
||||
fn(&options)
|
||||
}
|
||||
|
||||
finalizeRetryMaxAttemptOptions(&options, *c)
|
||||
finalizeOperationRetryMaxAttempts(&options, *c)
|
||||
|
||||
finalizeClientEndpointResolverOptions(&options)
|
||||
|
||||
@ -197,8 +121,89 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf
|
||||
return result, metadata, err
|
||||
}
|
||||
|
||||
type operationInputKey struct{}
|
||||
|
||||
func setOperationInput(ctx context.Context, input interface{}) context.Context {
|
||||
return middleware.WithStackValue(ctx, operationInputKey{}, input)
|
||||
}
|
||||
|
||||
func getOperationInput(ctx context.Context) interface{} {
|
||||
return middleware.GetStackValue(ctx, operationInputKey{})
|
||||
}
|
||||
|
||||
type setOperationInputMiddleware struct {
|
||||
}
|
||||
|
||||
func (*setOperationInputMiddleware) ID() string {
|
||||
return "setOperationInput"
|
||||
}
|
||||
|
||||
func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
ctx = setOperationInput(ctx, in.Parameters)
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error {
|
||||
if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil {
|
||||
return fmt.Errorf("add ResolveAuthScheme: %w", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil {
|
||||
return fmt.Errorf("add GetIdentity: %v", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil {
|
||||
return fmt.Errorf("add ResolveEndpointV2: %v", err)
|
||||
}
|
||||
if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil {
|
||||
return fmt.Errorf("add Signing: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
func resolveAuthSchemeResolver(options *Options) {
|
||||
if options.AuthSchemeResolver == nil {
|
||||
options.AuthSchemeResolver = &defaultAuthSchemeResolver{}
|
||||
}
|
||||
}
|
||||
|
||||
func resolveAuthSchemes(options *Options) {
|
||||
if options.AuthSchemes == nil {
|
||||
options.AuthSchemes = []smithyhttp.AuthScheme{
|
||||
internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{
|
||||
Signer: options.HTTPSignerV4,
|
||||
Logger: options.Logger,
|
||||
LogSigning: options.ClientLogMode.IsSigning(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type noSmithyDocumentSerde = smithydocument.NoSerde
|
||||
|
||||
type legacyEndpointContextSetter struct {
|
||||
LegacyResolver EndpointResolver
|
||||
}
|
||||
|
||||
func (*legacyEndpointContextSetter) ID() string {
|
||||
return "legacyEndpointContextSetter"
|
||||
}
|
||||
|
||||
func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
if m.LegacyResolver != nil {
|
||||
ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true)
|
||||
}
|
||||
|
||||
return next.HandleInitialize(ctx, in)
|
||||
|
||||
}
|
||||
func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error {
|
||||
return stack.Initialize.Add(&legacyEndpointContextSetter{
|
||||
LegacyResolver: o.EndpointResolver,
|
||||
}, middleware.Before)
|
||||
}
|
||||
|
||||
func resolveDefaultLogger(o *Options) {
|
||||
if o.Logger != nil {
|
||||
return
|
||||
@ -236,6 +241,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
|
||||
APIOptions: cfg.APIOptions,
|
||||
Logger: cfg.Logger,
|
||||
ClientLogMode: cfg.ClientLogMode,
|
||||
AppID: cfg.AppID,
|
||||
}
|
||||
resolveAWSRetryerProvider(cfg, &opts)
|
||||
resolveAWSRetryMaxAttempts(cfg, &opts)
|
||||
@ -243,6 +249,7 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
|
||||
resolveAWSEndpointResolver(cfg, &opts)
|
||||
resolveUseDualStackEndpoint(cfg, &opts)
|
||||
resolveUseFIPSEndpoint(cfg, &opts)
|
||||
resolveBaseEndpoint(cfg, &opts)
|
||||
return New(opts, optFns...)
|
||||
}
|
||||
|
||||
@ -334,7 +341,15 @@ func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
|
||||
o.RetryMaxAttempts = cfg.RetryMaxAttempts
|
||||
}
|
||||
|
||||
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
|
||||
func finalizeRetryMaxAttempts(o *Options) {
|
||||
if o.RetryMaxAttempts == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
|
||||
}
|
||||
|
||||
func finalizeOperationRetryMaxAttempts(o *Options, client Client) {
|
||||
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
|
||||
return
|
||||
}
|
||||
@ -346,20 +361,19 @@ func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
|
||||
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
|
||||
return
|
||||
}
|
||||
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
|
||||
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions)
|
||||
}
|
||||
|
||||
func addClientUserAgent(stack *middleware.Stack) error {
|
||||
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sts", goModuleVersion)(stack)
|
||||
}
|
||||
func addClientUserAgent(stack *middleware.Stack, options Options) error {
|
||||
if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sts", goModuleVersion)(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
|
||||
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
|
||||
CredentialsProvider: o.Credentials,
|
||||
Signer: o.HTTPSignerV4,
|
||||
LogSigning: o.ClientLogMode.IsSigning(),
|
||||
})
|
||||
return stack.Finalize.Add(mw, middleware.After)
|
||||
if len(options.AppID) > 0 {
|
||||
return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type HTTPSignerV4 interface {
|
||||
@ -496,20 +510,67 @@ func withNopHTTPClientAPIOption(o *Options) {
|
||||
o.HTTPClient = smithyhttp.NopClient{}
|
||||
}
|
||||
|
||||
type presignContextPolyfillMiddleware struct {
|
||||
}
|
||||
|
||||
func (*presignContextPolyfillMiddleware) ID() string {
|
||||
return "presignContextPolyfill"
|
||||
}
|
||||
|
||||
func (m *presignContextPolyfillMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
schemeID := rscheme.Scheme.SchemeID()
|
||||
|
||||
if schemeID == "aws.auth#sigv4" || schemeID == "com.amazonaws.s3#sigv4express" {
|
||||
if sn, ok := smithyhttp.GetSigV4SigningName(&rscheme.SignerProperties); ok {
|
||||
ctx = awsmiddleware.SetSigningName(ctx, sn)
|
||||
}
|
||||
if sr, ok := smithyhttp.GetSigV4SigningRegion(&rscheme.SignerProperties); ok {
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, sr)
|
||||
}
|
||||
} else if schemeID == "aws.auth#sigv4a" {
|
||||
if sn, ok := smithyhttp.GetSigV4ASigningName(&rscheme.SignerProperties); ok {
|
||||
ctx = awsmiddleware.SetSigningName(ctx, sn)
|
||||
}
|
||||
if sr, ok := smithyhttp.GetSigV4ASigningRegions(&rscheme.SignerProperties); ok {
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, sr[0])
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
type presignConverter PresignOptions
|
||||
|
||||
func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, options Options) (err error) {
|
||||
stack.Finalize.Clear()
|
||||
if _, ok := stack.Finalize.Get((*acceptencodingcust.DisableGzip)(nil).ID()); ok {
|
||||
stack.Finalize.Remove((*acceptencodingcust.DisableGzip)(nil).ID())
|
||||
}
|
||||
if _, ok := stack.Finalize.Get((*retry.Attempt)(nil).ID()); ok {
|
||||
stack.Finalize.Remove((*retry.Attempt)(nil).ID())
|
||||
}
|
||||
if _, ok := stack.Finalize.Get((*retry.MetricsHeader)(nil).ID()); ok {
|
||||
stack.Finalize.Remove((*retry.MetricsHeader)(nil).ID())
|
||||
}
|
||||
stack.Deserialize.Clear()
|
||||
stack.Build.Remove((*awsmiddleware.ClientRequestID)(nil).ID())
|
||||
stack.Build.Remove("UserAgent")
|
||||
if err := stack.Finalize.Insert(&presignContextPolyfillMiddleware{}, "Signing", middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
pmw := v4.NewPresignHTTPRequestMiddleware(v4.PresignHTTPRequestMiddlewareOptions{
|
||||
CredentialsProvider: options.Credentials,
|
||||
Presigner: c.Presigner,
|
||||
LogSigning: options.ClientLogMode.IsSigning(),
|
||||
})
|
||||
err = stack.Finalize.Add(pmw, middleware.After)
|
||||
if err != nil {
|
||||
if _, err := stack.Finalize.Swap("Signing", pmw); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddNoPayloadDefaultContentTypeRemover(stack); err != nil {
|
||||
@ -535,3 +596,32 @@ func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
|
||||
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
|
||||
}, middleware.After)
|
||||
}
|
||||
|
||||
type disableHTTPSMiddleware struct {
|
||||
DisableHTTPS bool
|
||||
}
|
||||
|
||||
func (*disableHTTPSMiddleware) ID() string {
|
||||
return "disableHTTPS"
|
||||
}
|
||||
|
||||
func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
|
||||
}
|
||||
|
||||
if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) {
|
||||
req.URL.Scheme = "http"
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {
|
||||
return stack.Finalize.Insert(&disableHTTPSMiddleware{
|
||||
DisableHTTPS: o.EndpointOptions.DisableHTTPS,
|
||||
}, "ResolveEndpointV2", middleware.After)
|
||||
}
|
||||
|
198
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
generated
vendored
198
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
generated
vendored
@ -4,6 +4,7 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
@ -16,16 +17,13 @@ import (
|
||||
// key ID, a secret access key, and a security token. Typically, you use AssumeRole
|
||||
// within your account or for cross-account access. For a comparison of AssumeRole
|
||||
// with other API operations that produce temporary credentials, see Requesting
|
||||
// Temporary Security Credentials
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// in the IAM User Guide. Permissions The temporary security credentials created by
|
||||
// AssumeRole can be used to make API calls to any Amazon Web Services service with
|
||||
// the following exception: You cannot call the Amazon Web Services STS
|
||||
// AssumeRole can be used to make API calls to any Amazon Web Services service
|
||||
// with the following exception: You cannot call the Amazon Web Services STS
|
||||
// GetFederationToken or GetSessionToken API operations. (Optional) You can pass
|
||||
// inline or managed session policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
|
||||
@ -36,49 +34,39 @@ import (
|
||||
// credentials in subsequent Amazon Web Services API calls to access resources in
|
||||
// the account that owns the role. You cannot use session policies to grant more
|
||||
// permissions than those allowed by the identity-based policy of the role that is
|
||||
// being assumed. For more information, see Session Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. When you create a role, you create two policies: A role
|
||||
// trust policy that specifies who can assume the role and a permissions policy
|
||||
// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. When you create a role, you create two policies: a role
|
||||
// trust policy that specifies who can assume the role, and a permissions policy
|
||||
// that specifies what can be done with the role. You specify the trusted principal
|
||||
// who is allowed to assume the role in the role trust policy. To assume a role
|
||||
// that is allowed to assume the role in the role trust policy. To assume a role
|
||||
// from a different account, your Amazon Web Services account must be trusted by
|
||||
// the role. The trust relationship is defined in the role's trust policy when the
|
||||
// role is created. That trust policy states which accounts are allowed to delegate
|
||||
// that access to users in the account. A user who wants to access a role in a
|
||||
// different account must also have permissions that are delegated from the user
|
||||
// account administrator. The administrator must attach a policy that allows the
|
||||
// user to call AssumeRole for the ARN of the role in the other account. To allow a
|
||||
// user to assume a role in the same account, you can do either of the
|
||||
// following:
|
||||
// different account must also have permissions that are delegated from the account
|
||||
// administrator. The administrator must attach a policy that allows the user to
|
||||
// call AssumeRole for the ARN of the role in the other account. To allow a user
|
||||
// to assume a role in the same account, you can do either of the following:
|
||||
// - Attach a policy to the user that allows the user to call AssumeRole (as long
|
||||
// as the role's trust policy trusts the account).
|
||||
// - Add the user as a principal directly in the role's trust policy.
|
||||
//
|
||||
// * Attach a policy to the user that allows the user to call
|
||||
// AssumeRole (as long as the role's trust policy trusts the account).
|
||||
//
|
||||
// * Add the
|
||||
// user as a principal directly in the role's trust policy.
|
||||
//
|
||||
// You can do either
|
||||
// because the role’s trust policy acts as an IAM resource-based policy. When a
|
||||
// resource-based policy grants access to a principal in the same account, no
|
||||
// additional identity-based policy is required. For more information about trust
|
||||
// policies and resource-based policies, see IAM Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) in the
|
||||
// IAM User Guide. Tags (Optional) You can pass tag key-value pairs to your
|
||||
// You can do either because the role’s trust policy acts as an IAM resource-based
|
||||
// policy. When a resource-based policy grants access to a principal in the same
|
||||
// account, no additional identity-based policy is required. For more information
|
||||
// about trust policies and resource-based policies, see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
|
||||
// in the IAM User Guide. Tags (Optional) You can pass tag key-value pairs to your
|
||||
// session. These tags are called session tags. For more information about session
|
||||
// tags, see Passing Session Tags in STS
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the
|
||||
// IAM User Guide. An administrator must grant you the permissions necessary to
|
||||
// pass session tags. The administrator can also create granular permissions to
|
||||
// tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. An administrator must grant you the permissions necessary
|
||||
// to pass session tags. The administrator can also create granular permissions to
|
||||
// allow you to pass only specific session tags. For more information, see
|
||||
// Tutorial: Using Tags for Attribute-Based Access Control
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// in the IAM User Guide. You can set the session tags as transitive. Transitive
|
||||
// tags persist during role chaining. For more information, see Chaining Roles with
|
||||
// Session Tags
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// tags persist during role chaining. For more information, see Chaining Roles
|
||||
// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// in the IAM User Guide. Using MFA with AssumeRole (Optional) You can include
|
||||
// multi-factor authentication (MFA) information when you call AssumeRole. This is
|
||||
// multi-factor authentication (MFA) information when you call AssumeRole . This is
|
||||
// useful for cross-account scenarios to ensure that the user that assumes the role
|
||||
// has been authenticated with an Amazon Web Services MFA device. In that scenario,
|
||||
// the trust policy of the role being assumed includes a condition that tests for
|
||||
@ -86,12 +74,11 @@ import (
|
||||
// request to assume the role is denied. The condition in a trust policy that tests
|
||||
// for MFA authentication might look like the following example. "Condition":
|
||||
// {"Bool": {"aws:MultiFactorAuthPresent": true}} For more information, see
|
||||
// Configuring MFA-Protected API Access
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html) in the
|
||||
// IAM User Guide guide. To use MFA with AssumeRole, you pass values for the
|
||||
// SerialNumber and TokenCode parameters. The SerialNumber value identifies the
|
||||
// user's hardware or virtual MFA device. The TokenCode is the time-based one-time
|
||||
// password (TOTP) that the MFA device produces.
|
||||
// Configuring MFA-Protected API Access (https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html)
|
||||
// in the IAM User Guide guide. To use MFA with AssumeRole , you pass values for
|
||||
// the SerialNumber and TokenCode parameters. The SerialNumber value identifies
|
||||
// the user's hardware or virtual MFA device. The TokenCode is the time-based
|
||||
// one-time password (TOTP) that the MFA device produces.
|
||||
func (c *Client) AssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*Options)) (*AssumeRoleOutput, error) {
|
||||
if params == nil {
|
||||
params = &AssumeRoleInput{}
|
||||
@ -143,16 +130,14 @@ type AssumeRoleInput struct {
|
||||
// maximum session duration setting for your role. However, if you assume a role
|
||||
// using role chaining and provide a DurationSeconds parameter value greater than
|
||||
// one hour, the operation fails. To learn how to view the maximum value for your
|
||||
// role, see View the Maximum Session Duration Setting for a Role
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// in the IAM User Guide. By default, the value is set to 3600 seconds. The
|
||||
// DurationSeconds parameter is separate from the duration of a console session
|
||||
// that you might request using the returned credentials. The request to the
|
||||
// federation endpoint for a console sign-in token takes a SessionDuration
|
||||
// parameter that specifies the maximum length of the console session. For more
|
||||
// information, see Creating a URL that Enables Federated Users to Access the
|
||||
// Amazon Web Services Management Console
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||
// Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||
// in the IAM User Guide.
|
||||
DurationSeconds *int32
|
||||
|
||||
@ -165,8 +150,7 @@ type AssumeRoleInput struct {
|
||||
// administrator of the trusted account. That way, only someone with the ID can
|
||||
// assume the role, rather than everyone in the account. For more information about
|
||||
// the external ID, see How to Use an External ID When Granting Access to Your
|
||||
// Amazon Web Services Resources to a Third Party
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)
|
||||
// Amazon Web Services Resources to a Third Party (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)
|
||||
// in the IAM User Guide. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
@ -181,8 +165,7 @@ type AssumeRoleInput struct {
|
||||
// access resources in the account that owns the role. You cannot use session
|
||||
// policies to grant more permissions than those allowed by the identity-based
|
||||
// policy of the role that is being assumed. For more information, see Session
|
||||
// Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. The plaintext that you use for both inline and managed
|
||||
// session policies can't exceed 2,048 characters. The JSON policy characters can
|
||||
// be any ASCII character from the space character to the end of the valid
|
||||
@ -200,9 +183,8 @@ type AssumeRoleInput struct {
|
||||
// the role. This parameter is optional. You can provide up to 10 managed policy
|
||||
// ARNs. However, the plaintext that you use for both inline and managed session
|
||||
// policies can't exceed 2,048 characters. For more information about ARNs, see
|
||||
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces
|
||||
// (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in
|
||||
// the Amazon Web Services General Reference. An Amazon Web Services conversion
|
||||
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
|
||||
// in the Amazon Web Services General Reference. An Amazon Web Services conversion
|
||||
// compresses the passed inline session policy, managed policy ARNs, and session
|
||||
// tags into a packed binary format that has a separate limit. Your request can
|
||||
// fail for this limit even if your plaintext meets the other requirements. The
|
||||
@ -214,17 +196,24 @@ type AssumeRoleInput struct {
|
||||
// Services API calls to access resources in the account that owns the role. You
|
||||
// cannot use session policies to grant more permissions than those allowed by the
|
||||
// identity-based policy of the role that is being assumed. For more information,
|
||||
// see Session Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide.
|
||||
PolicyArns []types.PolicyDescriptorType
|
||||
|
||||
// The identification number of the MFA device that is associated with the user who
|
||||
// is making the AssumeRole call. Specify this value if the trust policy of the
|
||||
// role being assumed includes a condition that requires MFA authentication. The
|
||||
// value is either the serial number for a hardware device (such as GAHT12345678)
|
||||
// or an Amazon Resource Name (ARN) for a virtual device (such as
|
||||
// arn:aws:iam::123456789012:mfa/user). The regex used to validate this parameter
|
||||
// A list of previously acquired trusted context assertions in the format of a
|
||||
// JSON array. The trusted context assertion is signed and encrypted by Amazon Web
|
||||
// Services STS. The following is an example of a ProvidedContext value that
|
||||
// includes a single trusted context assertion and the ARN of the context provider
|
||||
// from which the trusted context assertion was generated.
|
||||
// [{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}]
|
||||
ProvidedContexts []types.ProvidedContext
|
||||
|
||||
// The identification number of the MFA device that is associated with the user
|
||||
// who is making the AssumeRole call. Specify this value if the trust policy of
|
||||
// the role being assumed includes a condition that requires MFA authentication.
|
||||
// The value is either the serial number for a hardware device (such as
|
||||
// GAHT12345678 ) or an Amazon Resource Name (ARN) for a virtual device (such as
|
||||
// arn:aws:iam::123456789012:mfa/user ). The regex used to validate this parameter
|
||||
// is a string of characters consisting of upper- and lower-case alphanumeric
|
||||
// characters with no spaces. You can also include underscores or any of the
|
||||
// following characters: =,.@-
|
||||
@ -237,24 +226,21 @@ type AssumeRoleInput struct {
|
||||
// who took actions with a role. You can use the aws:SourceIdentity condition key
|
||||
// to further control access to Amazon Web Services resources based on the value of
|
||||
// source identity. For more information about using source identity, see Monitor
|
||||
// and control actions taken with assumed roles
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// in the IAM User Guide. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
// =,.@-. You cannot use a value that begins with the text aws:. This prefix is
|
||||
// =,.@-. You cannot use a value that begins with the text aws: . This prefix is
|
||||
// reserved for Amazon Web Services internal use.
|
||||
SourceIdentity *string
|
||||
|
||||
// A list of session tags that you want to pass. Each session tag consists of a key
|
||||
// name and an associated value. For more information about session tags, see
|
||||
// Tagging Amazon Web Services STS Sessions
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the
|
||||
// IAM User Guide. This parameter is optional. You can pass up to 50 session tags.
|
||||
// The plaintext session tag keys can’t exceed 128 characters, and the values can’t
|
||||
// exceed 256 characters. For these and additional limits, see IAM and STS
|
||||
// Character Limits
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// A list of session tags that you want to pass. Each session tag consists of a
|
||||
// key name and an associated value. For more information about session tags, see
|
||||
// Tagging Amazon Web Services STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. This parameter is optional. You can pass up to 50 session
|
||||
// tags. The plaintext session tag keys can’t exceed 128 characters, and the values
|
||||
// can’t exceed 256 characters. For these and additional limits, see IAM and STS
|
||||
// Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
|
||||
// inline session policy, managed policy ARNs, and session tags into a packed
|
||||
// binary format that has a separate limit. Your request can fail for this limit
|
||||
@ -264,16 +250,15 @@ type AssumeRoleInput struct {
|
||||
// same key as a tag that is already attached to the role. When you do, session
|
||||
// tags override a role tag with the same key. Tag key–value pairs are not case
|
||||
// sensitive, but case is preserved. This means that you cannot have separate
|
||||
// Department and department tag keys. Assume that the role has the
|
||||
// Department=Marketing tag and you pass the department=engineering session tag.
|
||||
// Department and department are not saved as separate tags, and the session tag
|
||||
// passed in the request takes precedence over the role tag. Additionally, if you
|
||||
// used temporary credentials to perform this operation, the new session inherits
|
||||
// any transitive session tags from the calling session. If you pass a session tag
|
||||
// with the same key as an inherited tag, the operation fails. To view the
|
||||
// inherited tags for a session, see the CloudTrail logs. For more information, see
|
||||
// Viewing Session Tags in CloudTrail
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs)
|
||||
// Department and department tag keys. Assume that the role has the Department =
|
||||
// Marketing tag and you pass the department = engineering session tag. Department
|
||||
// and department are not saved as separate tags, and the session tag passed in
|
||||
// the request takes precedence over the role tag. Additionally, if you used
|
||||
// temporary credentials to perform this operation, the new session inherits any
|
||||
// transitive session tags from the calling session. If you pass a session tag with
|
||||
// the same key as an inherited tag, the operation fails. To view the inherited
|
||||
// tags for a session, see the CloudTrail logs. For more information, see Viewing
|
||||
// Session Tags in CloudTrail (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs)
|
||||
// in the IAM User Guide.
|
||||
Tags []types.Tag
|
||||
|
||||
@ -285,11 +270,10 @@ type AssumeRoleInput struct {
|
||||
// sequence of six numeric digits.
|
||||
TokenCode *string
|
||||
|
||||
// A list of keys for session tags that you want to set as transitive. If you set a
|
||||
// tag key as transitive, the corresponding key and value passes to subsequent
|
||||
// A list of keys for session tags that you want to set as transitive. If you set
|
||||
// a tag key as transitive, the corresponding key and value passes to subsequent
|
||||
// sessions in a role chain. For more information, see Chaining Roles with Session
|
||||
// Tags
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// in the IAM User Guide. This parameter is optional. When you set session tags as
|
||||
// transitive, the session policy and session tags packed binary limit is not
|
||||
// affected. If you choose not to specify a transitive tag key, then no tags are
|
||||
@ -308,7 +292,7 @@ type AssumeRoleOutput struct {
|
||||
// that you can use to refer to the resulting temporary security credentials. For
|
||||
// example, you can reference these credentials as a principal in a resource-based
|
||||
// policy by using the ARN or assumed role ID. The ARN and ID include the
|
||||
// RoleSessionName that you specified when you called AssumeRole.
|
||||
// RoleSessionName that you specified when you called AssumeRole .
|
||||
AssumedRoleUser *types.AssumedRoleUser
|
||||
|
||||
// The temporary security credentials, which include an access key ID, a secret
|
||||
@ -330,8 +314,7 @@ type AssumeRoleOutput struct {
|
||||
// who took actions with a role. You can use the aws:SourceIdentity condition key
|
||||
// to further control access to Amazon Web Services resources based on the value of
|
||||
// source identity. For more information about using source identity, see Monitor
|
||||
// and control actions taken with assumed roles
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// in the IAM User Guide. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
@ -345,6 +328,9 @@ type AssumeRoleOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRole{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -353,6 +339,13 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRole"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -371,16 +364,13 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -389,12 +379,18 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssumeRoleValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRole(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -404,6 +400,9 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -411,7 +410,6 @@ func newServiceMetadataMiddleware_opAssumeRole(region string) *awsmiddleware.Reg
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "AssumeRole",
|
||||
}
|
||||
}
|
||||
|
158
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go
generated
vendored
158
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go
generated
vendored
@ -4,6 +4,7 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
@ -15,10 +16,8 @@ import (
|
||||
// mechanism for tying an enterprise identity store or directory to role-based
|
||||
// Amazon Web Services access without user-specific credentials or configuration.
|
||||
// For a comparison of AssumeRoleWithSAML with the other API operations that
|
||||
// produce temporary credentials, see Requesting Temporary Security Credentials
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// produce temporary credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// in the IAM User Guide. The temporary security credentials returned by this
|
||||
// operation consist of an access key ID, a secret access key, and a security
|
||||
// token. Applications can use these temporary security credentials to sign calls
|
||||
@ -31,15 +30,12 @@ import (
|
||||
// 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
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// Maximum Session Duration Setting for a Role (https://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 commands. However the
|
||||
// limit does not apply when you use those operations to create a console URL. For
|
||||
// more information, see Using IAM Roles
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the IAM
|
||||
// User Guide. Role chaining
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining)
|
||||
// more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
|
||||
// in the IAM User Guide. Role chaining (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining)
|
||||
// limits your CLI or Amazon Web Services API role session to a maximum of one
|
||||
// hour. When you use the AssumeRole API operation to assume a role, you can
|
||||
// specify the duration of your role session with the DurationSeconds parameter.
|
||||
@ -50,8 +46,7 @@ import (
|
||||
// credentials created by AssumeRoleWithSAML can be used to make API calls to any
|
||||
// Amazon Web Services service with the following exception: you cannot call the
|
||||
// STS GetFederationToken or GetSessionToken API operations. (Optional) You can
|
||||
// pass inline or managed session policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
|
||||
@ -62,8 +57,7 @@ import (
|
||||
// credentials in subsequent Amazon Web Services API calls to access resources in
|
||||
// the account that owns the role. You cannot use session policies to grant more
|
||||
// permissions than those allowed by the identity-based policy of the role that is
|
||||
// being assumed. For more information, see Session Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. Calling AssumeRoleWithSAML does not require the use of
|
||||
// Amazon Web Services security credentials. The identity of the caller is
|
||||
// validated by using keys in the metadata document that is uploaded for the SAML
|
||||
@ -71,16 +65,14 @@ import (
|
||||
// result in an entry in your CloudTrail logs. The entry includes the value in the
|
||||
// NameID element of the SAML assertion. We recommend that you use a NameIDType
|
||||
// that is not associated with any personally identifiable information (PII). For
|
||||
// example, you could instead use the persistent identifier
|
||||
// (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). Tags (Optional) You can
|
||||
// example, you could instead use the persistent identifier (
|
||||
// urn:oasis:names:tc:SAML:2.0:nameid-format:persistent ). Tags (Optional) You can
|
||||
// configure your IdP to pass attributes into your SAML assertion as session tags.
|
||||
// Each session tag consists of a key name and an associated value. For more
|
||||
// information about session tags, see Passing Session Tags in STS
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the
|
||||
// IAM User Guide. You can pass up to 50 session tags. The plaintext session tag
|
||||
// keys can’t exceed 128 characters and the values can’t exceed 256 characters. For
|
||||
// these and additional limits, see IAM and STS Character Limits
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// information about session tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. You can pass up to 50 session tags. The plaintext session
|
||||
// tag keys can’t exceed 128 characters and the values can’t exceed 256 characters.
|
||||
// For these and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
|
||||
// inline session policy, managed policy ARNs, and session tags into a packed
|
||||
// binary format that has a separate limit. Your request can fail for this limit
|
||||
@ -91,36 +83,25 @@ import (
|
||||
// override the role's tags with the same key. An administrator must grant you the
|
||||
// permissions necessary to pass session tags. The administrator can also create
|
||||
// granular permissions to allow you to pass only specific session tags. For more
|
||||
// information, see Tutorial: Using Tags for Attribute-Based Access Control
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// information, see Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// in the IAM User Guide. You can set the session tags as transitive. Transitive
|
||||
// tags persist during role chaining. For more information, see Chaining Roles with
|
||||
// Session Tags
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// tags persist during role chaining. For more information, see Chaining Roles
|
||||
// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// in the IAM User Guide. SAML Configuration Before your application can call
|
||||
// AssumeRoleWithSAML, you must configure your SAML identity provider (IdP) to
|
||||
// AssumeRoleWithSAML , you must configure your SAML identity provider (IdP) to
|
||||
// issue the claims required by Amazon Web Services. Additionally, you must use
|
||||
// Identity and Access Management (IAM) to create a SAML provider entity in your
|
||||
// Amazon Web Services account that represents your identity provider. You must
|
||||
// also create an IAM role that specifies this SAML provider in its trust policy.
|
||||
// For more information, see the following resources:
|
||||
//
|
||||
// * About SAML 2.0-based
|
||||
// Federation
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// * Creating SAML Identity Providers
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// * Configuring a Relying Party and Claims
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// * Creating a Role for SAML 2.0 Federation
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html)
|
||||
// in the IAM User Guide.
|
||||
// - About SAML 2.0-based Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html)
|
||||
// in the IAM User Guide.
|
||||
// - Creating SAML Identity Providers (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html)
|
||||
// in the IAM User Guide.
|
||||
// - Configuring a Relying Party and Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html)
|
||||
// in the IAM User Guide.
|
||||
// - Creating a Role for SAML 2.0 Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html)
|
||||
// in the IAM User Guide.
|
||||
func (c *Client) AssumeRoleWithSAML(ctx context.Context, params *AssumeRoleWithSAMLInput, optFns ...func(*Options)) (*AssumeRoleWithSAMLOutput, error) {
|
||||
if params == nil {
|
||||
params = &AssumeRoleWithSAMLInput{}
|
||||
@ -150,8 +131,7 @@ type AssumeRoleWithSAMLInput struct {
|
||||
RoleArn *string
|
||||
|
||||
// The base64 encoded SAML authentication response provided by the IdP. For more
|
||||
// information, see Configuring a Relying Party and Adding Claims
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html)
|
||||
// information, see Configuring a Relying Party and Adding Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// This member is required.
|
||||
@ -166,16 +146,14 @@ type AssumeRoleWithSAMLInput struct {
|
||||
// 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
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// in the IAM User Guide. By default, the value is set to 3600 seconds. The
|
||||
// DurationSeconds parameter is separate from the duration of a console session
|
||||
// that you might request using the returned credentials. The request to the
|
||||
// federation endpoint for a console sign-in token takes a SessionDuration
|
||||
// parameter that specifies the maximum length of the console session. For more
|
||||
// information, see Creating a URL that Enables Federated Users to Access the
|
||||
// Amazon Web Services Management Console
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||
// Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||
// in the IAM User Guide.
|
||||
DurationSeconds *int32
|
||||
|
||||
@ -187,8 +165,7 @@ type AssumeRoleWithSAMLInput struct {
|
||||
// access resources in the account that owns the role. You cannot use session
|
||||
// policies to grant more permissions than those allowed by the identity-based
|
||||
// policy of the role that is being assumed. For more information, see Session
|
||||
// Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. The plaintext that you use for both inline and managed
|
||||
// session policies can't exceed 2,048 characters. The JSON policy characters can
|
||||
// be any ASCII character from the space character to the end of the valid
|
||||
@ -206,9 +183,8 @@ type AssumeRoleWithSAMLInput struct {
|
||||
// the role. This parameter is optional. You can provide up to 10 managed policy
|
||||
// ARNs. However, the plaintext that you use for both inline and managed session
|
||||
// policies can't exceed 2,048 characters. For more information about ARNs, see
|
||||
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces
|
||||
// (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in
|
||||
// the Amazon Web Services General Reference. An Amazon Web Services conversion
|
||||
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
|
||||
// in the Amazon Web Services General Reference. An Amazon Web Services conversion
|
||||
// compresses the passed inline session policy, managed policy ARNs, and session
|
||||
// tags into a packed binary format that has a separate limit. Your request can
|
||||
// fail for this limit even if your plaintext meets the other requirements. The
|
||||
@ -220,8 +196,7 @@ type AssumeRoleWithSAMLInput struct {
|
||||
// Services API calls to access resources in the account that owns the role. You
|
||||
// cannot use session policies to grant more permissions than those allowed by the
|
||||
// identity-based policy of the role that is being assumed. For more information,
|
||||
// see Session Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide.
|
||||
PolicyArns []types.PolicyDescriptorType
|
||||
|
||||
@ -251,19 +226,12 @@ type AssumeRoleWithSAMLOutput struct {
|
||||
Issuer *string
|
||||
|
||||
// A hash value based on the concatenation of the following:
|
||||
//
|
||||
// * The Issuer response
|
||||
// value.
|
||||
//
|
||||
// * The Amazon Web Services account ID.
|
||||
//
|
||||
// * The friendly name (the last
|
||||
// part of the ARN) of the SAML provider in IAM.
|
||||
//
|
||||
// The combination of NameQualifier
|
||||
// and Subject can be used to uniquely identify a federated user. The following
|
||||
// pseudocode shows how the hash value is calculated: BASE64 ( SHA1 (
|
||||
// "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) )
|
||||
// - The Issuer response value.
|
||||
// - The Amazon Web Services account ID.
|
||||
// - The friendly name (the last part of the ARN) of the SAML provider in IAM.
|
||||
// The combination of NameQualifier and Subject can be used to uniquely identify a
|
||||
// user. The following pseudocode shows how the hash value is calculated: BASE64 (
|
||||
// SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) )
|
||||
NameQualifier *string
|
||||
|
||||
// A percentage value that indicates the packed size of the session policies and
|
||||
@ -272,20 +240,18 @@ type AssumeRoleWithSAMLOutput struct {
|
||||
// allowed space.
|
||||
PackedPolicySize *int32
|
||||
|
||||
// The value in the SourceIdentity attribute in the SAML assertion. You can require
|
||||
// users to set a source identity value when they assume a role. You do this by
|
||||
// using the sts:SourceIdentity condition key in a role trust policy. That way,
|
||||
// actions that are taken with the role are associated with that user. After the
|
||||
// source identity is set, the value cannot be changed. It is present in the
|
||||
// The value in the SourceIdentity attribute in the SAML assertion. You can
|
||||
// require users to set a source identity value when they assume a role. You do
|
||||
// this by using the sts:SourceIdentity condition key in a role trust policy. That
|
||||
// way, actions that are taken with the role are associated with that user. After
|
||||
// the source identity is set, the value cannot be changed. It is present in the
|
||||
// request for all actions that are taken by the role and persists across chained
|
||||
// role
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining)
|
||||
// role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining)
|
||||
// sessions. You can configure your SAML identity provider to use an attribute
|
||||
// associated with your users, like user name or email, as the source identity when
|
||||
// calling AssumeRoleWithSAML. You do this by adding an attribute to the SAML
|
||||
// calling AssumeRoleWithSAML . You do this by adding an attribute to the SAML
|
||||
// assertion. For more information about using source identity, see Monitor and
|
||||
// control actions taken with assumed roles
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// in the IAM User Guide. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
@ -297,10 +263,10 @@ type AssumeRoleWithSAMLOutput struct {
|
||||
|
||||
// The format of the name ID, as defined by the Format attribute in the NameID
|
||||
// element of the SAML assertion. Typical examples of the format are transient or
|
||||
// persistent. If the format includes the prefix
|
||||
// urn:oasis:names:tc:SAML:2.0:nameid-format, that prefix is removed. For example,
|
||||
// urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient. If
|
||||
// the format includes any other prefix, the format is returned with no
|
||||
// persistent . If the format includes the prefix
|
||||
// urn:oasis:names:tc:SAML:2.0:nameid-format , that prefix is removed. For example,
|
||||
// urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient .
|
||||
// If the format includes any other prefix, the format is returned with no
|
||||
// modifications.
|
||||
SubjectType *string
|
||||
|
||||
@ -311,6 +277,9 @@ type AssumeRoleWithSAMLOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithSAML{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -319,6 +288,13 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleWithSAML"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -340,7 +316,7 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -349,12 +325,18 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssumeRoleWithSAMLValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithSAML(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -364,6 +346,9 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -371,7 +356,6 @@ func newServiceMetadataMiddleware_opAssumeRoleWithSAML(region string) *awsmiddle
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "AssumeRoleWithSAML",
|
||||
}
|
||||
}
|
||||
|
209
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go
generated
vendored
209
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go
generated
vendored
@ -4,6 +4,7 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
@ -14,54 +15,44 @@ import (
|
||||
// authenticated in a mobile or web application with a web identity provider.
|
||||
// Example providers include the OAuth 2.0 providers Login with Amazon and
|
||||
// Facebook, or any OpenID Connect-compatible identity provider such as Google or
|
||||
// Amazon Cognito federated identities
|
||||
// (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html).
|
||||
// For mobile applications, we recommend that you use Amazon Cognito. You can use
|
||||
// Amazon Cognito with the Amazon Web Services SDK for iOS Developer Guide
|
||||
// (http://aws.amazon.com/sdkforios/) and the Amazon Web Services SDK for Android
|
||||
// Developer Guide (http://aws.amazon.com/sdkforandroid/) to uniquely identify a
|
||||
// user. You can also supply the user with a consistent identity throughout the
|
||||
// lifetime of an application. To learn more about Amazon Cognito, see Amazon
|
||||
// Cognito Overview
|
||||
// (https://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840)
|
||||
// in Amazon Web Services SDK for Android Developer Guide and Amazon Cognito
|
||||
// Overview
|
||||
// (https://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664)
|
||||
// in the Amazon Web Services SDK for iOS Developer Guide. Calling
|
||||
// AssumeRoleWithWebIdentity does not require the use of Amazon Web Services
|
||||
// security credentials. Therefore, you can distribute an application (for example,
|
||||
// on mobile devices) that requests temporary security credentials without
|
||||
// including long-term Amazon Web Services credentials in the application. You also
|
||||
// don't need to deploy server-based proxy services that use long-term Amazon Web
|
||||
// Services credentials. Instead, the identity of the caller is validated by using
|
||||
// a token from the web identity provider. For a comparison of
|
||||
// AssumeRoleWithWebIdentity with the other API operations that produce temporary
|
||||
// credentials, see Requesting Temporary Security Credentials
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// Amazon Cognito federated identities (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html)
|
||||
// . For mobile applications, we recommend that you use Amazon Cognito. You can use
|
||||
// Amazon Cognito with the Amazon Web Services SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/)
|
||||
// and the Amazon Web Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/)
|
||||
// to uniquely identify a user. You can also supply the user with a consistent
|
||||
// identity throughout the lifetime of an application. To learn more about Amazon
|
||||
// Cognito, see Amazon Cognito identity pools (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html)
|
||||
// in Amazon Cognito Developer Guide. Calling AssumeRoleWithWebIdentity does not
|
||||
// require the use of Amazon Web Services security credentials. Therefore, you can
|
||||
// distribute an application (for example, on mobile devices) that requests
|
||||
// temporary security credentials without including long-term Amazon Web Services
|
||||
// credentials in the application. You also don't need to deploy server-based proxy
|
||||
// services that use long-term Amazon Web Services credentials. Instead, the
|
||||
// identity of the caller is validated by using a token from the web identity
|
||||
// provider. For a comparison of AssumeRoleWithWebIdentity with the other API
|
||||
// operations that produce temporary credentials, see Requesting Temporary
|
||||
// Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// in the IAM User Guide. The temporary security credentials returned by this API
|
||||
// consist of an access key ID, a secret access key, and a security token.
|
||||
// Applications can use these temporary security credentials to sign calls to
|
||||
// Amazon Web Services service API operations. Session Duration By default, the
|
||||
// temporary security credentials created by AssumeRoleWithWebIdentity last for one
|
||||
// hour. However, you can use the optional DurationSeconds parameter 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
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// temporary security credentials created by AssumeRoleWithWebIdentity last for
|
||||
// one hour. However, you can use the optional DurationSeconds parameter 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 (https://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 commands. However the
|
||||
// limit does not apply when you use those operations to create a console URL. For
|
||||
// more information, see Using IAM Roles
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) in the IAM
|
||||
// User Guide. Permissions The temporary security credentials created by
|
||||
// more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
|
||||
// in the IAM User Guide. Permissions The temporary security credentials created by
|
||||
// AssumeRoleWithWebIdentity can be used to make API calls to any Amazon Web
|
||||
// Services service with the following exception: you cannot call the STS
|
||||
// GetFederationToken or GetSessionToken API operations. (Optional) You can pass
|
||||
// inline or managed session policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
|
||||
@ -72,17 +63,14 @@ import (
|
||||
// credentials in subsequent Amazon Web Services API calls to access resources in
|
||||
// the account that owns the role. You cannot use session policies to grant more
|
||||
// permissions than those allowed by the identity-based policy of the role that is
|
||||
// being assumed. For more information, see Session Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. Tags (Optional) You can configure your IdP to pass
|
||||
// attributes into your web identity token as session tags. Each session tag
|
||||
// consists of a key name and an associated value. For more information about
|
||||
// session tags, see Passing Session Tags in STS
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the
|
||||
// IAM User Guide. You can pass up to 50 session tags. The plaintext session tag
|
||||
// keys can’t exceed 128 characters and the values can’t exceed 256 characters. For
|
||||
// these and additional limits, see IAM and STS Character Limits
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// session tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. You can pass up to 50 session tags. The plaintext session
|
||||
// tag keys can’t exceed 128 characters and the values can’t exceed 256 characters.
|
||||
// For these and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
|
||||
// inline session policy, managed policy ARNs, and session tags into a packed
|
||||
// binary format that has a separate limit. Your request can fail for this limit
|
||||
@ -93,52 +81,38 @@ import (
|
||||
// overrides the role tag with the same key. An administrator must grant you the
|
||||
// permissions necessary to pass session tags. The administrator can also create
|
||||
// granular permissions to allow you to pass only specific session tags. For more
|
||||
// information, see Tutorial: Using Tags for Attribute-Based Access Control
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// information, see Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// in the IAM User Guide. You can set the session tags as transitive. Transitive
|
||||
// tags persist during role chaining. For more information, see Chaining Roles with
|
||||
// Session Tags
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// tags persist during role chaining. For more information, see Chaining Roles
|
||||
// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// in the IAM User Guide. Identities Before your application can call
|
||||
// AssumeRoleWithWebIdentity, you must have an identity token from a supported
|
||||
// AssumeRoleWithWebIdentity , you must have an identity token from a supported
|
||||
// identity provider and create a role that the application can assume. The role
|
||||
// that your application assumes must trust the identity provider that is
|
||||
// associated with the identity token. In other words, the identity provider must
|
||||
// be specified in the role's trust policy. Calling AssumeRoleWithWebIdentity can
|
||||
// result in an entry in your CloudTrail logs. The entry includes the Subject
|
||||
// (http://openid.net/specs/openid-connect-core-1_0.html#Claims) of the provided
|
||||
// web identity token. We recommend that you avoid using any personally
|
||||
// identifiable information (PII) in this field. For example, you could instead use
|
||||
// a GUID or a pairwise identifier, as suggested in the OIDC specification
|
||||
// (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes). For more
|
||||
// information about how to use web identity federation and the
|
||||
// result in an entry in your CloudTrail logs. The entry includes the Subject (http://openid.net/specs/openid-connect-core-1_0.html#Claims)
|
||||
// of the provided web identity token. We recommend that you avoid using any
|
||||
// personally identifiable information (PII) in this field. For example, you could
|
||||
// instead use a GUID or a pairwise identifier, as suggested in the OIDC
|
||||
// specification (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes)
|
||||
// . For more information about how to use web identity federation and the
|
||||
// AssumeRoleWithWebIdentity API, see the following resources:
|
||||
//
|
||||
// * Using Web
|
||||
// Identity Federation API Operations for Mobile Apps
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html)
|
||||
// and Federation Through a Web-based Identity Provider
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity).
|
||||
//
|
||||
// *
|
||||
// Web Identity Federation Playground
|
||||
// (https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/).
|
||||
// Walk through the process of authenticating through Login with Amazon, Facebook,
|
||||
// or Google, getting temporary security credentials, and then using those
|
||||
// credentials to make a request to Amazon Web Services.
|
||||
//
|
||||
// * Amazon Web Services SDK
|
||||
// for iOS Developer Guide (http://aws.amazon.com/sdkforios/) and Amazon Web
|
||||
// Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/).
|
||||
// These toolkits contain sample apps that show how to invoke the identity
|
||||
// providers. The toolkits then show how to use the information from these
|
||||
// providers to get and use temporary security credentials.
|
||||
//
|
||||
// * 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 how to
|
||||
// use web identity federation to get access to content in Amazon S3.
|
||||
// - Using Web Identity Federation API Operations for Mobile Apps (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html)
|
||||
// and Federation Through a Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
|
||||
// .
|
||||
// - Web Identity Federation Playground (https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/)
|
||||
// . Walk through the process of authenticating through Login with Amazon,
|
||||
// Facebook, or Google, getting temporary security credentials, and then using
|
||||
// those credentials to make a request to Amazon Web Services.
|
||||
// - Amazon Web Services SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/)
|
||||
// and Amazon Web Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/)
|
||||
// . These toolkits contain sample apps that show how to invoke the identity
|
||||
// providers. The toolkits then show how to use the information from these
|
||||
// providers to get and use temporary security credentials.
|
||||
// - 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 how to
|
||||
// use web identity federation to get access to content in Amazon S3.
|
||||
func (c *Client) AssumeRoleWithWebIdentity(ctx context.Context, params *AssumeRoleWithWebIdentityInput, optFns ...func(*Options)) (*AssumeRoleWithWebIdentityOutput, error) {
|
||||
if params == nil {
|
||||
params = &AssumeRoleWithWebIdentityInput{}
|
||||
@ -176,7 +150,8 @@ type AssumeRoleWithWebIdentityInput struct {
|
||||
// The OAuth 2.0 access token or OpenID Connect ID token that is provided by the
|
||||
// identity provider. Your application must get this token by authenticating the
|
||||
// user who is using your application with a web identity provider before the
|
||||
// application makes an AssumeRoleWithWebIdentity call.
|
||||
// application makes an AssumeRoleWithWebIdentity call. Only tokens with RSA
|
||||
// algorithms (RS256) are supported.
|
||||
//
|
||||
// This member is required.
|
||||
WebIdentityToken *string
|
||||
@ -187,16 +162,14 @@ type AssumeRoleWithWebIdentityInput struct {
|
||||
// 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
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// value for your role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// in the IAM User Guide. By default, the value is set to 3600 seconds. The
|
||||
// DurationSeconds parameter is separate from the duration of a console session
|
||||
// that you might request using the returned credentials. The request to the
|
||||
// federation endpoint for a console sign-in token takes a SessionDuration
|
||||
// parameter that specifies the maximum length of the console session. For more
|
||||
// information, see Creating a URL that Enables Federated Users to Access the
|
||||
// Amazon Web Services Management Console
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||
// Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||
// in the IAM User Guide.
|
||||
DurationSeconds *int32
|
||||
|
||||
@ -208,8 +181,7 @@ type AssumeRoleWithWebIdentityInput struct {
|
||||
// access resources in the account that owns the role. You cannot use session
|
||||
// policies to grant more permissions than those allowed by the identity-based
|
||||
// policy of the role that is being assumed. For more information, see Session
|
||||
// Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. The plaintext that you use for both inline and managed
|
||||
// session policies can't exceed 2,048 characters. The JSON policy characters can
|
||||
// be any ASCII character from the space character to the end of the valid
|
||||
@ -227,9 +199,8 @@ type AssumeRoleWithWebIdentityInput struct {
|
||||
// the role. This parameter is optional. You can provide up to 10 managed policy
|
||||
// ARNs. However, the plaintext that you use for both inline and managed session
|
||||
// policies can't exceed 2,048 characters. For more information about ARNs, see
|
||||
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces
|
||||
// (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in
|
||||
// the Amazon Web Services General Reference. An Amazon Web Services conversion
|
||||
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
|
||||
// in the Amazon Web Services General Reference. An Amazon Web Services conversion
|
||||
// compresses the passed inline session policy, managed policy ARNs, and session
|
||||
// tags into a packed binary format that has a separate limit. Your request can
|
||||
// fail for this limit even if your plaintext meets the other requirements. The
|
||||
@ -241,8 +212,7 @@ type AssumeRoleWithWebIdentityInput struct {
|
||||
// Services API calls to access resources in the account that owns the role. You
|
||||
// cannot use session policies to grant more permissions than those allowed by the
|
||||
// identity-based policy of the role that is being assumed. For more information,
|
||||
// see Session Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide.
|
||||
PolicyArns []types.PolicyDescriptorType
|
||||
|
||||
@ -265,7 +235,7 @@ type AssumeRoleWithWebIdentityOutput struct {
|
||||
// that you can use to refer to the resulting temporary security credentials. For
|
||||
// example, you can reference these credentials as a principal in a resource-based
|
||||
// policy by using the ARN or assumed role ID. The ARN and ID include the
|
||||
// RoleSessionName that you specified when you called AssumeRole.
|
||||
// RoleSessionName that you specified when you called AssumeRole .
|
||||
AssumedRoleUser *types.AssumedRoleUser
|
||||
|
||||
// The intended audience (also known as client ID) of the web identity token. This
|
||||
@ -285,10 +255,10 @@ type AssumeRoleWithWebIdentityOutput struct {
|
||||
// allowed space.
|
||||
PackedPolicySize *int32
|
||||
|
||||
// The issuing authority of the web identity token presented. For OpenID Connect ID
|
||||
// tokens, this contains the value of the iss field. For OAuth 2.0 access tokens,
|
||||
// this contains the value of the ProviderId parameter that was passed in the
|
||||
// AssumeRoleWithWebIdentity request.
|
||||
// The issuing authority of the web identity token presented. For OpenID Connect
|
||||
// ID tokens, this contains the value of the iss field. For OAuth 2.0 access
|
||||
// tokens, this contains the value of the ProviderId parameter that was passed in
|
||||
// the AssumeRoleWithWebIdentity request.
|
||||
Provider *string
|
||||
|
||||
// The value of the source identity that is returned in the JSON web token (JWT)
|
||||
@ -297,17 +267,14 @@ type AssumeRoleWithWebIdentityOutput struct {
|
||||
// key in a role trust policy. That way, actions that are taken with the role are
|
||||
// associated with that user. After the source identity is set, the value cannot be
|
||||
// changed. It is present in the request for all actions that are taken by the role
|
||||
// and persists across chained role
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining)
|
||||
// and persists across chained role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining)
|
||||
// sessions. You can configure your identity provider to use an attribute
|
||||
// associated with your users, like user name or email, as the source identity when
|
||||
// calling AssumeRoleWithWebIdentity. You do this by adding a claim to the JSON web
|
||||
// token. To learn more about OIDC tokens and claims, see Using Tokens with User
|
||||
// Pools
|
||||
// (https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html)
|
||||
// calling AssumeRoleWithWebIdentity . You do this by adding a claim to the JSON
|
||||
// web token. To learn more about OIDC tokens and claims, see Using Tokens with
|
||||
// User Pools (https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html)
|
||||
// in the Amazon Cognito Developer Guide. For more information about using source
|
||||
// identity, see Monitor and control actions taken with assumed roles
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// identity, see Monitor and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// in the IAM User Guide. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
@ -329,6 +296,9 @@ type AssumeRoleWithWebIdentityOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoleWithWebIdentity{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -337,6 +307,13 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoleWithWebIdentity"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -358,7 +335,7 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -367,12 +344,18 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssumeRoleWithWebIdentityValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -382,6 +365,9 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -389,7 +375,6 @@ func newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(region string) *aw
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "AssumeRoleWithWebIdentity",
|
||||
}
|
||||
}
|
||||
|
58
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go
generated
vendored
58
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go
generated
vendored
@ -4,6 +4,7 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
@ -22,27 +23,17 @@ import (
|
||||
// encoded because the details of the authorization status can contain privileged
|
||||
// information that the user who requested the operation should not see. To decode
|
||||
// an authorization status message, a user must be granted permissions through an
|
||||
// IAM policy
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) to
|
||||
// request the DecodeAuthorizationMessage (sts:DecodeAuthorizationMessage) action.
|
||||
// The decoded message includes the following type of information:
|
||||
//
|
||||
// * Whether the
|
||||
// request was denied due to an explicit deny or due to the absence of an explicit
|
||||
// allow. For more information, see Determining Whether a Request is Allowed or
|
||||
// Denied
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// * The principal who made the request.
|
||||
//
|
||||
// * The requested
|
||||
// action.
|
||||
//
|
||||
// * The requested resource.
|
||||
//
|
||||
// * The values of condition keys in the
|
||||
// context of the user's request.
|
||||
// IAM policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
|
||||
// to request the DecodeAuthorizationMessage ( sts:DecodeAuthorizationMessage )
|
||||
// action. The decoded message includes the following type of information:
|
||||
// - Whether the request was denied due to an explicit deny or due to the
|
||||
// absence of an explicit allow. For more information, see Determining Whether a
|
||||
// Request is Allowed or Denied (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow)
|
||||
// in the IAM User Guide.
|
||||
// - The principal who made the request.
|
||||
// - The requested action.
|
||||
// - The requested resource.
|
||||
// - The values of condition keys in the context of the user's request.
|
||||
func (c *Client) DecodeAuthorizationMessage(ctx context.Context, params *DecodeAuthorizationMessageInput, optFns ...func(*Options)) (*DecodeAuthorizationMessageOutput, error) {
|
||||
if params == nil {
|
||||
params = &DecodeAuthorizationMessageInput{}
|
||||
@ -83,6 +74,9 @@ type DecodeAuthorizationMessageOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpDecodeAuthorizationMessage{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -91,6 +85,13 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "DecodeAuthorizationMessage"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -109,16 +110,13 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -127,12 +125,18 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDecodeAuthorizationMessageValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDecodeAuthorizationMessage(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -142,6 +146,9 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -149,7 +156,6 @@ func newServiceMetadataMiddleware_opDecodeAuthorizationMessage(region string) *a
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "DecodeAuthorizationMessage",
|
||||
}
|
||||
}
|
||||
|
39
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go
generated
vendored
39
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go
generated
vendored
@ -4,6 +4,7 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
@ -11,21 +12,18 @@ import (
|
||||
)
|
||||
|
||||
// Returns the account identifier for the specified access key ID. Access keys
|
||||
// consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE) and a
|
||||
// secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY). For
|
||||
// more information about access keys, see Managing Access Keys for IAM Users
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)
|
||||
// consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE ) and
|
||||
// a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY ).
|
||||
// For more information about access keys, see Managing Access Keys for IAM Users (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)
|
||||
// in the IAM User Guide. When you pass an access key ID to this operation, it
|
||||
// returns the ID of the Amazon Web Services account to which the keys belong.
|
||||
// Access key IDs beginning with AKIA are long-term credentials for an IAM user or
|
||||
// the Amazon Web Services account root user. Access key IDs beginning with ASIA
|
||||
// are temporary credentials that are created using STS operations. If the account
|
||||
// in the response belongs to you, you can sign in as the root user and review your
|
||||
// root user access keys. Then, you can pull a credentials report
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html)
|
||||
// root user access keys. Then, you can pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html)
|
||||
// to learn which IAM user owns the keys. To learn who requested the temporary
|
||||
// credentials for an ASIA access key, view the STS events in your CloudTrail logs
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html)
|
||||
// credentials for an ASIA access key, view the STS events in your CloudTrail logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html)
|
||||
// in the IAM User Guide. This operation does not indicate the state of the access
|
||||
// key. The key might be active, inactive, or deleted. Active keys might not have
|
||||
// permissions to perform an operation. Providing a deleted access key might return
|
||||
@ -69,6 +67,9 @@ type GetAccessKeyInfoOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetAccessKeyInfo{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -77,6 +78,13 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "GetAccessKeyInfo"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -95,16 +103,13 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -113,12 +118,18 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpGetAccessKeyInfoValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessKeyInfo(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -128,6 +139,9 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -135,7 +149,6 @@ func newServiceMetadataMiddleware_opGetAccessKeyInfo(region string) *awsmiddlewa
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "GetAccessKeyInfo",
|
||||
}
|
||||
}
|
||||
|
44
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go
generated
vendored
44
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go
generated
vendored
@ -4,6 +4,7 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
@ -12,12 +13,11 @@ import (
|
||||
|
||||
// Returns details about the IAM user or role whose credentials are used to call
|
||||
// the operation. No permissions are required to perform this operation. If an
|
||||
// administrator adds a policy to your IAM user or role that explicitly denies
|
||||
// access to the sts:GetCallerIdentity action, you can still perform this
|
||||
// operation. Permissions are not required because the same information is returned
|
||||
// when an IAM user or role is denied access. To view an example response, see I Am
|
||||
// Not Authorized to Perform: iam:DeleteVirtualMFADevice
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa)
|
||||
// administrator attaches a policy to your identity that explicitly denies access
|
||||
// to the sts:GetCallerIdentity action, you can still perform this operation.
|
||||
// Permissions are not required because the same information is returned when
|
||||
// access is denied. To view an example response, see I Am Not Authorized to
|
||||
// Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa)
|
||||
// in the IAM User Guide.
|
||||
func (c *Client) GetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*Options)) (*GetCallerIdentityOutput, error) {
|
||||
if params == nil {
|
||||
@ -49,10 +49,9 @@ type GetCallerIdentityOutput struct {
|
||||
// The Amazon Web Services ARN associated with the calling entity.
|
||||
Arn *string
|
||||
|
||||
// The unique identifier of the calling entity. The exact value depends on the type
|
||||
// of entity that is making the call. The values returned are those listed in the
|
||||
// aws:userid column in the Principal table
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable)
|
||||
// The unique identifier of the calling entity. The exact value depends on the
|
||||
// type of entity that is making the call. The values returned are those listed in
|
||||
// the aws:userid column in the Principal table (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable)
|
||||
// found on the Policy Variables reference page in the IAM User Guide.
|
||||
UserId *string
|
||||
|
||||
@ -63,6 +62,9 @@ type GetCallerIdentityOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetCallerIdentity{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -71,6 +73,13 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "GetCallerIdentity"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -89,16 +98,13 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -107,9 +113,15 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCallerIdentity(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -119,6 +131,9 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -126,7 +141,6 @@ func newServiceMetadataMiddleware_opGetCallerIdentity(region string) *awsmiddlew
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "GetCallerIdentity",
|
||||
}
|
||||
}
|
||||
|
183
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go
generated
vendored
183
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go
generated
vendored
@ -4,6 +4,7 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
@ -11,50 +12,40 @@ import (
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
// Returns a set of temporary security credentials (consisting of an access key ID,
|
||||
// a secret access key, and a security token) for a federated user. A typical use
|
||||
// is in a proxy application that gets temporary security credentials on behalf of
|
||||
// Returns a set of temporary security credentials (consisting of an access key
|
||||
// ID, a secret access key, and a security token) for a user. A typical use is in a
|
||||
// proxy application that gets temporary security credentials on behalf of
|
||||
// distributed applications inside a corporate network. You must call the
|
||||
// GetFederationToken operation using the long-term security credentials of an IAM
|
||||
// user. As a result, this call is appropriate in contexts where those credentials
|
||||
// can be safely stored, usually in a server-based application. For a comparison of
|
||||
// can be safeguarded, usually in a server-based application. For a comparison of
|
||||
// GetFederationToken with the other API operations that produce temporary
|
||||
// credentials, see Requesting Temporary Security Credentials
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// in the IAM User Guide. Although it is possible to call GetFederationToken using
|
||||
// the security credentials of an Amazon Web Services account root user rather than
|
||||
// an IAM user that you create for the purpose of a proxy application, we do not
|
||||
// recommend it. For more information, see Safeguard your root user credentials
|
||||
// and don't use them for everyday tasks (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)
|
||||
// in the IAM User Guide. You can create a mobile-based or browser-based app that
|
||||
// can authenticate users using a web identity provider like Login with Amazon,
|
||||
// Facebook, Google, or an OpenID Connect-compatible identity provider. In this
|
||||
// case, we recommend that you use Amazon Cognito (http://aws.amazon.com/cognito/)
|
||||
// or AssumeRoleWithWebIdentity. For more information, see Federation Through a
|
||||
// Web-based Identity Provider
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
|
||||
// in the IAM User Guide. You can also call GetFederationToken using the security
|
||||
// credentials of an Amazon Web Services account root user, but we do not recommend
|
||||
// it. Instead, we recommend that you create an IAM user for the purpose of the
|
||||
// proxy application. Then attach a policy to the IAM user that limits federated
|
||||
// users to only the actions and resources that they need to access. For more
|
||||
// information, see IAM Best Practices
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) in the
|
||||
// IAM User Guide. Session duration The temporary credentials are valid for the
|
||||
// specified duration, from 900 seconds (15 minutes) up to a maximum of 129,600
|
||||
// or AssumeRoleWithWebIdentity . For more information, see Federation Through a
|
||||
// Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
|
||||
// in the IAM User Guide. Session duration The temporary credentials are valid for
|
||||
// the specified duration, from 900 seconds (15 minutes) up to a maximum of 129,600
|
||||
// seconds (36 hours). The default session duration is 43,200 seconds (12 hours).
|
||||
// Temporary credentials obtained by using the Amazon Web Services account root
|
||||
// user credentials have a maximum duration of 3,600 seconds (1 hour). Permissions
|
||||
// You can use the temporary credentials created by GetFederationToken in any
|
||||
// Amazon Web Services service with the following exceptions:
|
||||
// Temporary credentials obtained by using the root user credentials have a maximum
|
||||
// duration of 3,600 seconds (1 hour). Permissions You can use the temporary
|
||||
// credentials created by GetFederationToken in any Amazon Web Services service
|
||||
// with the following exceptions:
|
||||
// - You cannot call any IAM operations using the CLI or the Amazon Web Services
|
||||
// API. This limitation does not apply to console sessions.
|
||||
// - You cannot call any STS operations except GetCallerIdentity .
|
||||
//
|
||||
// * You cannot call
|
||||
// any IAM operations using the CLI or the Amazon Web Services API. This limitation
|
||||
// does not apply to console sessions.
|
||||
//
|
||||
// * You cannot call any STS operations except
|
||||
// GetCallerIdentity.
|
||||
//
|
||||
// You can use temporary credentials for single sign-on (SSO)
|
||||
// to the console. You must pass an inline or managed session policy
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// You can use temporary credentials for single sign-on (SSO) to the console. You
|
||||
// must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
|
||||
@ -65,38 +56,33 @@ import (
|
||||
// policies and the session policies that you pass. This gives you a way to further
|
||||
// restrict the permissions for a federated user. You cannot use session policies
|
||||
// to grant more permissions than those that are defined in the permissions policy
|
||||
// of the IAM user. For more information, see Session Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// of the IAM user. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. For information about using GetFederationToken to create
|
||||
// temporary security credentials, see GetFederationToken—Federation Through a
|
||||
// Custom Identity Broker
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken).
|
||||
// You can use the credentials to access a resource that has a resource-based
|
||||
// Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken)
|
||||
// . You can use the credentials to access a resource that has a resource-based
|
||||
// policy. If that policy specifically references the federated user session in the
|
||||
// Principal element of the policy, the session has the permissions allowed by the
|
||||
// policy. These permissions are granted in addition to the permissions granted by
|
||||
// the session policies. Tags (Optional) You can pass tag key-value pairs to your
|
||||
// session. These are called session tags. For more information about session tags,
|
||||
// see Passing Session Tags in STS
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the
|
||||
// IAM User Guide. You can create a mobile-based or browser-based app that can
|
||||
// authenticate users using a web identity provider like Login with Amazon,
|
||||
// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. You can create a mobile-based or browser-based app that
|
||||
// can authenticate users using a web identity provider like Login with Amazon,
|
||||
// Facebook, Google, or an OpenID Connect-compatible identity provider. In this
|
||||
// case, we recommend that you use Amazon Cognito (http://aws.amazon.com/cognito/)
|
||||
// or AssumeRoleWithWebIdentity. For more information, see Federation Through a
|
||||
// Web-based Identity Provider
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
|
||||
// or AssumeRoleWithWebIdentity . For more information, see Federation Through a
|
||||
// Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
|
||||
// in the IAM User Guide. An administrator must grant you the permissions necessary
|
||||
// to pass session tags. The administrator can also create granular permissions to
|
||||
// allow you to pass only specific session tags. For more information, see
|
||||
// Tutorial: Using Tags for Attribute-Based Access Control
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// in the IAM User Guide. Tag key–value pairs are not case sensitive, but case is
|
||||
// preserved. This means that you cannot have separate Department and department
|
||||
// tag keys. Assume that the user that you are federating has the
|
||||
// Department=Marketing tag and you pass the department=engineering session tag.
|
||||
// Department and department are not saved as separate tags, and the session tag
|
||||
// passed in the request takes precedence over the user tag.
|
||||
// tag keys. Assume that the user that you are federating has the Department =
|
||||
// Marketing tag and you pass the department = engineering session tag. Department
|
||||
// and department are not saved as separate tags, and the session tag passed in
|
||||
// the request takes precedence over the user tag.
|
||||
func (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTokenInput, optFns ...func(*Options)) (*GetFederationTokenOutput, error) {
|
||||
if params == nil {
|
||||
params = &GetFederationTokenInput{}
|
||||
@ -115,26 +101,26 @@ func (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTo
|
||||
type GetFederationTokenInput struct {
|
||||
|
||||
// The name of the federated user. The name is used as an identifier for the
|
||||
// temporary security credentials (such as Bob). For example, you can reference the
|
||||
// federated user name in a resource-based policy, such as in an Amazon S3 bucket
|
||||
// policy. The regex used to validate this parameter is a string of characters
|
||||
// consisting of upper- and lower-case alphanumeric characters with no spaces. You
|
||||
// can also include underscores or any of the following characters: =,.@-
|
||||
// temporary security credentials (such as Bob ). For example, you can reference
|
||||
// the federated user name in a resource-based policy, such as in an Amazon S3
|
||||
// bucket policy. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
// =,.@-
|
||||
//
|
||||
// This member is required.
|
||||
Name *string
|
||||
|
||||
// The duration, in seconds, that the session should last. Acceptable durations for
|
||||
// federation sessions range from 900 seconds (15 minutes) to 129,600 seconds (36
|
||||
// hours), with 43,200 seconds (12 hours) as the default. Sessions obtained using
|
||||
// Amazon Web Services account root user credentials are restricted to a maximum of
|
||||
// 3,600 seconds (one hour). If the specified duration is longer than one hour, the
|
||||
// session obtained by using root user credentials defaults to one hour.
|
||||
// The duration, in seconds, that the session should last. Acceptable durations
|
||||
// for federation sessions range from 900 seconds (15 minutes) to 129,600 seconds
|
||||
// (36 hours), with 43,200 seconds (12 hours) as the default. Sessions obtained
|
||||
// using root user credentials are restricted to a maximum of 3,600 seconds (one
|
||||
// hour). If the specified duration is longer than one hour, the session obtained
|
||||
// by using root user credentials defaults to one hour.
|
||||
DurationSeconds *int32
|
||||
|
||||
// An IAM policy in JSON format that you want to use as an inline session policy.
|
||||
// You must pass an inline or managed session policy
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. This parameter is
|
||||
@ -144,8 +130,7 @@ type GetFederationTokenInput struct {
|
||||
// session policies that you pass. This gives you a way to further restrict the
|
||||
// permissions for a federated user. You cannot use session policies to grant more
|
||||
// permissions than those that are defined in the permissions policy of the IAM
|
||||
// user. For more information, see Session Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// user. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. The resulting credentials can be used to access a
|
||||
// resource that has a resource-based policy. If that policy specifically
|
||||
// references the federated user session in the Principal element of the policy,
|
||||
@ -166,24 +151,21 @@ type GetFederationTokenInput struct {
|
||||
// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
|
||||
// use as a managed session policy. The policies must exist in the same account as
|
||||
// the IAM user that is requesting federated access. You must pass an inline or
|
||||
// managed session policy
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
|
||||
// use for both inline and managed session policies can't exceed 2,048 characters.
|
||||
// You can provide up to 10 managed policy ARNs. For more information about ARNs,
|
||||
// see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces
|
||||
// (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in
|
||||
// the Amazon Web Services General Reference. This parameter is optional. However,
|
||||
// if you do not pass any session policies, then the resulting federated user
|
||||
// session has no permissions. When you pass session policies, the session
|
||||
// see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
|
||||
// in the Amazon Web Services General Reference. This parameter is optional.
|
||||
// However, if you do not pass any session policies, then the resulting federated
|
||||
// user session has no permissions. When you pass session policies, the session
|
||||
// permissions are the intersection of the IAM user policies and the session
|
||||
// policies that you pass. This gives you a way to further restrict the permissions
|
||||
// for a federated user. You cannot use session policies to grant more permissions
|
||||
// than those that are defined in the permissions policy of the IAM user. For more
|
||||
// information, see Session Policies
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. The resulting credentials can be used to access a
|
||||
// resource that has a resource-based policy. If that policy specifically
|
||||
// references the federated user session in the Principal element of the policy,
|
||||
@ -192,20 +174,18 @@ type GetFederationTokenInput struct {
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates by
|
||||
// percentage how close the policies and tags for your request are to the upper
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
PolicyArns []types.PolicyDescriptorType
|
||||
|
||||
// A list of session tags. Each session tag consists of a key name and an
|
||||
// associated value. For more information about session tags, see Passing Session
|
||||
// Tags in STS
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the
|
||||
// IAM User Guide. This parameter is optional. You can pass up to 50 session tags.
|
||||
// The plaintext session tag keys can’t exceed 128 characters and the values can’t
|
||||
// exceed 256 characters. For these and additional limits, see IAM and STS
|
||||
// Character Limits
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. This parameter is optional. You can pass up to 50 session
|
||||
// tags. The plaintext session tag keys can’t exceed 128 characters and the values
|
||||
// can’t exceed 256 characters. For these and additional limits, see IAM and STS
|
||||
// Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
|
||||
// inline session policy, managed policy ARNs, and session tags into a packed
|
||||
// binary format that has a separate limit. Your request can fail for this limit
|
||||
@ -216,9 +196,9 @@ type GetFederationTokenInput struct {
|
||||
// you do, session tags override a user tag with the same key. Tag key–value pairs
|
||||
// are not case sensitive, but case is preserved. This means that you cannot have
|
||||
// separate Department and department tag keys. Assume that the role has the
|
||||
// Department=Marketing tag and you pass the department=engineering session tag.
|
||||
// Department and department are not saved as separate tags, and the session tag
|
||||
// passed in the request takes precedence over the role tag.
|
||||
// Department = Marketing tag and you pass the department = engineering session
|
||||
// tag. Department and department are not saved as separate tags, and the session
|
||||
// tag passed in the request takes precedence over the role tag.
|
||||
Tags []types.Tag
|
||||
|
||||
noSmithyDocumentSerde
|
||||
@ -236,7 +216,7 @@ type GetFederationTokenOutput struct {
|
||||
Credentials *types.Credentials
|
||||
|
||||
// Identifiers for the federated user associated with the credentials (such as
|
||||
// arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob). You can use
|
||||
// arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob ). You can use
|
||||
// the federated user's ARN in your resource-based policies, such as an Amazon S3
|
||||
// bucket policy.
|
||||
FederatedUser *types.FederatedUser
|
||||
@ -254,6 +234,9 @@ type GetFederationTokenOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetFederationToken{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -262,6 +245,13 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "GetFederationToken"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -280,16 +270,13 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -298,12 +285,18 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpGetFederationTokenValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFederationToken(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -313,6 +306,9 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -320,7 +316,6 @@ func newServiceMetadataMiddleware_opGetFederationToken(region string) *awsmiddle
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "GetFederationToken",
|
||||
}
|
||||
}
|
||||
|
141
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go
generated
vendored
141
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go
generated
vendored
@ -4,6 +4,7 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
@ -11,59 +12,46 @@ import (
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
// Returns a set of temporary credentials for an Amazon Web Services account or IAM
|
||||
// user. The credentials consist of an access key ID, a secret access key, and a
|
||||
// security token. Typically, you use GetSessionToken if you want to use MFA to
|
||||
// Returns a set of temporary credentials for an Amazon Web Services account or
|
||||
// IAM user. The credentials consist of an access key ID, a secret access key, and
|
||||
// a security token. Typically, you use GetSessionToken if you want to use MFA to
|
||||
// protect programmatic calls to specific Amazon Web Services API operations like
|
||||
// Amazon EC2 StopInstances. MFA-enabled IAM users would need to call
|
||||
// GetSessionToken and submit an MFA code that is associated with their MFA device.
|
||||
// Using the temporary security credentials that are returned from the call, IAM
|
||||
// users can then make programmatic calls to API operations that require MFA
|
||||
// authentication. If you do not supply a correct MFA code, then the API returns an
|
||||
// access denied error. For a comparison of GetSessionToken with the other API
|
||||
// operations that produce temporary credentials, see Requesting Temporary Security
|
||||
// Credentials
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// Amazon EC2 StopInstances . MFA-enabled IAM users must call GetSessionToken and
|
||||
// submit an MFA code that is associated with their MFA device. Using the temporary
|
||||
// security credentials that the call returns, IAM users can then make programmatic
|
||||
// calls to API operations that require MFA authentication. An incorrect MFA code
|
||||
// causes the API to return an access denied error. For a comparison of
|
||||
// GetSessionToken with the other API operations that produce temporary
|
||||
// credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// in the IAM User Guide. No permissions are required for users to perform this
|
||||
// operation. The purpose of the sts:GetSessionToken operation is to authenticate
|
||||
// the user using MFA. You cannot use policies to control authentication
|
||||
// operations. For more information, see Permissions for GetSessionToken
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html)
|
||||
// operations. For more information, see Permissions for GetSessionToken (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html)
|
||||
// in the IAM User Guide. Session Duration The GetSessionToken operation must be
|
||||
// called by using the long-term Amazon Web Services security credentials of the
|
||||
// Amazon Web Services account root user or an IAM user. Credentials that are
|
||||
// created by IAM users are valid for the duration that you specify. This duration
|
||||
// can range from 900 seconds (15 minutes) up to a maximum of 129,600 seconds (36
|
||||
// hours), with a default of 43,200 seconds (12 hours). Credentials based on
|
||||
// account credentials can range from 900 seconds (15 minutes) up to 3,600 seconds
|
||||
// (1 hour), with a default of 1 hour. Permissions The temporary security
|
||||
// credentials created by GetSessionToken can be used to make API calls to any
|
||||
// Amazon Web Services service with the following exceptions:
|
||||
// called by using the long-term Amazon Web Services security credentials of an IAM
|
||||
// user. Credentials that are created by IAM users are valid for the duration that
|
||||
// you specify. This duration can range from 900 seconds (15 minutes) up to a
|
||||
// maximum of 129,600 seconds (36 hours), with a default of 43,200 seconds (12
|
||||
// hours). Credentials based on account credentials can range from 900 seconds (15
|
||||
// minutes) up to 3,600 seconds (1 hour), with a default of 1 hour. Permissions The
|
||||
// temporary security credentials created by GetSessionToken can be used to make
|
||||
// API calls to any Amazon Web Services service with the following exceptions:
|
||||
// - You cannot call any IAM API operations unless MFA authentication
|
||||
// information is included in the request.
|
||||
// - You cannot call any STS API except AssumeRole or GetCallerIdentity .
|
||||
//
|
||||
// * You cannot call
|
||||
// any IAM API operations unless MFA authentication information is included in the
|
||||
// request.
|
||||
//
|
||||
// * You cannot call any STS API except AssumeRole or
|
||||
// GetCallerIdentity.
|
||||
//
|
||||
// We recommend that you do not call GetSessionToken with
|
||||
// Amazon Web Services account root user credentials. Instead, follow our best
|
||||
// practices
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users)
|
||||
// by creating one or more IAM users, giving them the necessary permissions, and
|
||||
// using IAM users for everyday interaction with Amazon Web Services. The
|
||||
// credentials that are returned by GetSessionToken are based on permissions
|
||||
// associated with the user whose credentials were used to call the operation. If
|
||||
// GetSessionToken is called using Amazon Web Services account root user
|
||||
// credentials, the temporary credentials have root user permissions. Similarly, if
|
||||
// GetSessionToken is called using the credentials of an IAM user, the temporary
|
||||
// credentials have the same permissions as the IAM user. For more information
|
||||
// about using GetSessionToken to create temporary credentials, go to Temporary
|
||||
// Credentials for Users in Untrusted Environments
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken)
|
||||
// The credentials that GetSessionToken returns are based on permissions
|
||||
// associated with the IAM user whose credentials were used to call the operation.
|
||||
// The temporary credentials have the same permissions as the IAM user. Although it
|
||||
// is possible to call GetSessionToken using the security credentials of an Amazon
|
||||
// Web Services account root user rather than an IAM user, we do not recommend it.
|
||||
// If GetSessionToken is called using root user credentials, the temporary
|
||||
// credentials have root user permissions. For more information, see Safeguard
|
||||
// your root user credentials and don't use them for everyday tasks (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)
|
||||
// in the IAM User Guide For more information about using GetSessionToken to
|
||||
// create temporary credentials, see Temporary Credentials for Users in Untrusted
|
||||
// Environments (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken)
|
||||
// in the IAM User Guide.
|
||||
func (c *Client) GetSessionToken(ctx context.Context, params *GetSessionTokenInput, optFns ...func(*Options)) (*GetSessionTokenOutput, error) {
|
||||
if params == nil {
|
||||
@ -90,25 +78,25 @@ type GetSessionTokenInput struct {
|
||||
// Services account owners defaults to one hour.
|
||||
DurationSeconds *int32
|
||||
|
||||
// The identification number of the MFA device that is associated with the IAM user
|
||||
// who is making the GetSessionToken call. Specify this value if the IAM user has a
|
||||
// policy that requires MFA authentication. The value is either the serial number
|
||||
// for a hardware device (such as GAHT12345678) or an Amazon Resource Name (ARN)
|
||||
// for a virtual device (such as arn:aws:iam::123456789012:mfa/user). You can find
|
||||
// the device for an IAM user by going to the Amazon Web Services Management
|
||||
// Console and viewing the user's security credentials. The regex used to validate
|
||||
// this parameter is a string of characters consisting of upper- and lower-case
|
||||
// alphanumeric characters with no spaces. You can also include underscores or any
|
||||
// of the following characters: =,.@:/-
|
||||
// The identification number of the MFA device that is associated with the IAM
|
||||
// user who is making the GetSessionToken call. Specify this value if the IAM user
|
||||
// has a policy that requires MFA authentication. The value is either the serial
|
||||
// number for a hardware device (such as GAHT12345678 ) or an Amazon Resource Name
|
||||
// (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user ). You
|
||||
// can find the device for an IAM user by going to the Amazon Web Services
|
||||
// Management Console and viewing the user's security credentials. The regex used
|
||||
// to validate this parameter is a string of characters consisting of upper- and
|
||||
// lower-case alphanumeric characters with no spaces. You can also include
|
||||
// underscores or any of the following characters: =,.@:/-
|
||||
SerialNumber *string
|
||||
|
||||
// The value provided by the MFA device, if MFA is required. If any policy requires
|
||||
// the IAM user to submit an MFA code, specify this value. If MFA authentication is
|
||||
// required, the user must provide a code when requesting a set of temporary
|
||||
// security credentials. A user who fails to provide the code receives an "access
|
||||
// denied" response when requesting resources that require MFA authentication. The
|
||||
// format for this parameter, as described by its regex pattern, is a sequence of
|
||||
// six numeric digits.
|
||||
// The value provided by the MFA device, if MFA is required. If any policy
|
||||
// requires the IAM user to submit an MFA code, specify this value. If MFA
|
||||
// authentication is required, the user must provide a code when requesting a set
|
||||
// of temporary security credentials. A user who fails to provide the code receives
|
||||
// an "access denied" response when requesting resources that require MFA
|
||||
// authentication. The format for this parameter, as described by its regex
|
||||
// pattern, is a sequence of six numeric digits.
|
||||
TokenCode *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
@ -132,6 +120,9 @@ type GetSessionTokenOutput struct {
|
||||
}
|
||||
|
||||
func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpGetSessionToken{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -140,6 +131,13 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "GetSessionToken"); err != nil {
|
||||
return fmt.Errorf("add protocol finalizers: %v", err)
|
||||
}
|
||||
|
||||
if err = addlegacyEndpointContextSetter(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -158,16 +156,13 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack); err != nil {
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
|
||||
@ -176,9 +171,15 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSessionToken(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
@ -188,6 +189,9 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err = addRequestResponseLogging(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -195,7 +199,6 @@ func newServiceMetadataMiddleware_opGetSessionToken(region string) *awsmiddlewar
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
SigningName: "sts",
|
||||
OperationName: "GetSessionToken",
|
||||
}
|
||||
}
|
||||
|
296
vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go
generated
vendored
Normal file
296
vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go
generated
vendored
Normal file
@ -0,0 +1,296 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) {
|
||||
params.Region = options.Region
|
||||
}
|
||||
|
||||
type setLegacyContextSigningOptionsMiddleware struct {
|
||||
}
|
||||
|
||||
func (*setLegacyContextSigningOptionsMiddleware) ID() string {
|
||||
return "setLegacyContextSigningOptions"
|
||||
}
|
||||
|
||||
func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
schemeID := rscheme.Scheme.SchemeID()
|
||||
|
||||
if sn := awsmiddleware.GetSigningName(ctx); sn != "" {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn)
|
||||
} else if schemeID == "aws.auth#sigv4a" {
|
||||
smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn)
|
||||
}
|
||||
}
|
||||
|
||||
if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr)
|
||||
} else if schemeID == "aws.auth#sigv4a" {
|
||||
smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr})
|
||||
}
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error {
|
||||
return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before)
|
||||
}
|
||||
|
||||
type withAnonymous struct {
|
||||
resolver AuthSchemeResolver
|
||||
}
|
||||
|
||||
var _ AuthSchemeResolver = (*withAnonymous)(nil)
|
||||
|
||||
func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {
|
||||
opts, err := v.resolver.ResolveAuthSchemes(ctx, params)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
opts = append(opts, &smithyauth.Option{
|
||||
SchemeID: smithyauth.SchemeIDAnonymous,
|
||||
})
|
||||
return opts, nil
|
||||
}
|
||||
|
||||
func wrapWithAnonymousAuth(options *Options) {
|
||||
if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok {
|
||||
return
|
||||
}
|
||||
|
||||
options.AuthSchemeResolver = &withAnonymous{
|
||||
resolver: options.AuthSchemeResolver,
|
||||
}
|
||||
}
|
||||
|
||||
// AuthResolverParameters contains the set of inputs necessary for auth scheme
|
||||
// resolution.
|
||||
type AuthResolverParameters struct {
|
||||
// The name of the operation being invoked.
|
||||
Operation string
|
||||
|
||||
// The region in which the operation is being invoked.
|
||||
Region string
|
||||
}
|
||||
|
||||
func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters {
|
||||
params := &AuthResolverParameters{
|
||||
Operation: operation,
|
||||
}
|
||||
|
||||
bindAuthParamsRegion(params, input, options)
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
// AuthSchemeResolver returns a set of possible authentication options for an
|
||||
// operation.
|
||||
type AuthSchemeResolver interface {
|
||||
ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error)
|
||||
}
|
||||
|
||||
type defaultAuthSchemeResolver struct{}
|
||||
|
||||
var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil)
|
||||
|
||||
func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) {
|
||||
if overrides, ok := operationAuthOptions[params.Operation]; ok {
|
||||
return overrides(params), nil
|
||||
}
|
||||
return serviceAuthOptions(params), nil
|
||||
}
|
||||
|
||||
var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{
|
||||
"AssumeRoleWithSAML": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
|
||||
"AssumeRoleWithWebIdentity": func(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{SchemeID: smithyauth.SchemeIDAnonymous},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option {
|
||||
return []*smithyauth.Option{
|
||||
{
|
||||
SchemeID: smithyauth.SchemeIDSigV4,
|
||||
SignerProperties: func() smithy.Properties {
|
||||
var props smithy.Properties
|
||||
smithyhttp.SetSigV4SigningName(&props, "sts")
|
||||
smithyhttp.SetSigV4SigningRegion(&props, params.Region)
|
||||
return props
|
||||
}(),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
type resolveAuthSchemeMiddleware struct {
|
||||
operation string
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*resolveAuthSchemeMiddleware) ID() string {
|
||||
return "ResolveAuthScheme"
|
||||
}
|
||||
|
||||
func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options)
|
||||
options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("resolve auth scheme: %w", err)
|
||||
}
|
||||
|
||||
scheme, ok := m.selectScheme(options)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("could not select an auth scheme")
|
||||
}
|
||||
|
||||
ctx = setResolvedAuthScheme(ctx, scheme)
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) {
|
||||
for _, option := range options {
|
||||
if option.SchemeID == smithyauth.SchemeIDAnonymous {
|
||||
return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true
|
||||
}
|
||||
|
||||
for _, scheme := range m.options.AuthSchemes {
|
||||
if scheme.SchemeID() != option.SchemeID {
|
||||
continue
|
||||
}
|
||||
|
||||
if scheme.IdentityResolver(m.options) != nil {
|
||||
return newResolvedAuthScheme(scheme, option), true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil, false
|
||||
}
|
||||
|
||||
type resolvedAuthSchemeKey struct{}
|
||||
|
||||
type resolvedAuthScheme struct {
|
||||
Scheme smithyhttp.AuthScheme
|
||||
IdentityProperties smithy.Properties
|
||||
SignerProperties smithy.Properties
|
||||
}
|
||||
|
||||
func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme {
|
||||
return &resolvedAuthScheme{
|
||||
Scheme: scheme,
|
||||
IdentityProperties: option.IdentityProperties,
|
||||
SignerProperties: option.SignerProperties,
|
||||
}
|
||||
}
|
||||
|
||||
func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context {
|
||||
return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme)
|
||||
}
|
||||
|
||||
func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme {
|
||||
v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme)
|
||||
return v
|
||||
}
|
||||
|
||||
type getIdentityMiddleware struct {
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*getIdentityMiddleware) ID() string {
|
||||
return "GetIdentity"
|
||||
}
|
||||
|
||||
func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
resolver := rscheme.Scheme.IdentityResolver(m.options)
|
||||
if resolver == nil {
|
||||
return out, metadata, fmt.Errorf("no identity resolver")
|
||||
}
|
||||
|
||||
identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("get identity: %w", err)
|
||||
}
|
||||
|
||||
ctx = setIdentity(ctx, identity)
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
type identityKey struct{}
|
||||
|
||||
func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context {
|
||||
return middleware.WithStackValue(ctx, identityKey{}, identity)
|
||||
}
|
||||
|
||||
func getIdentity(ctx context.Context) smithyauth.Identity {
|
||||
v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity)
|
||||
return v
|
||||
}
|
||||
|
||||
type signRequestMiddleware struct {
|
||||
}
|
||||
|
||||
func (*signRequestMiddleware) ID() string {
|
||||
return "Signing"
|
||||
}
|
||||
|
||||
func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request)
|
||||
}
|
||||
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
|
||||
identity := getIdentity(ctx)
|
||||
if identity == nil {
|
||||
return out, metadata, fmt.Errorf("no identity")
|
||||
}
|
||||
|
||||
signer := rscheme.Scheme.Signer()
|
||||
if signer == nil {
|
||||
return out, metadata, fmt.Errorf("no signer")
|
||||
}
|
||||
|
||||
if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil {
|
||||
return out, metadata, fmt.Errorf("sign request: %w", err)
|
||||
}
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
9
vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go
generated
vendored
9
vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go
generated
vendored
@ -4,9 +4,8 @@
|
||||
// Security Token Service.
|
||||
//
|
||||
// Security Token Service Security Token Service (STS) enables you to request
|
||||
// temporary, limited-privilege credentials for Identity and Access Management
|
||||
// (IAM) users or for users that you authenticate (federated users). This guide
|
||||
// provides descriptions of the STS API. For more information about using this
|
||||
// service, see Temporary Security Credentials
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html).
|
||||
// temporary, limited-privilege credentials for users. This guide provides
|
||||
// descriptions of the STS API. For more information about using this service, see
|
||||
// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
|
||||
// .
|
||||
package sts
|
||||
|
970
vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go
generated
vendored
970
vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go
generated
vendored
File diff suppressed because it is too large
Load Diff
8
vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json
generated
vendored
8
vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json
generated
vendored
@ -3,8 +3,10 @@
|
||||
"github.com/aws/aws-sdk-go-v2": "v1.4.0",
|
||||
"github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding": "v1.0.5",
|
||||
"github.com/aws/aws-sdk-go-v2/service/internal/presigned-url": "v1.0.7",
|
||||
"github.com/aws/smithy-go": "v1.4.0"
|
||||
"github.com/aws/smithy-go": "v1.4.0",
|
||||
"github.com/google/go-cmp": "v0.5.4"
|
||||
},
|
||||
"files": [
|
||||
"api_client.go",
|
||||
@ -17,12 +19,16 @@
|
||||
"api_op_GetCallerIdentity.go",
|
||||
"api_op_GetFederationToken.go",
|
||||
"api_op_GetSessionToken.go",
|
||||
"auth.go",
|
||||
"deserializers.go",
|
||||
"doc.go",
|
||||
"endpoints.go",
|
||||
"endpoints_config_test.go",
|
||||
"endpoints_test.go",
|
||||
"generated.json",
|
||||
"internal/endpoints/endpoints.go",
|
||||
"internal/endpoints/endpoints_test.go",
|
||||
"options.go",
|
||||
"protocol_test.go",
|
||||
"serializers.go",
|
||||
"types/errors.go",
|
||||
|
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
@ -3,4 +3,4 @@
|
||||
package sts
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.18.6"
|
||||
const goModuleVersion = "1.26.7"
|
||||
|
54
vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go
generated
vendored
54
vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go
generated
vendored
@ -89,13 +89,17 @@ var partitionRegexp = struct {
|
||||
AwsCn *regexp.Regexp
|
||||
AwsIso *regexp.Regexp
|
||||
AwsIsoB *regexp.Regexp
|
||||
AwsIsoE *regexp.Regexp
|
||||
AwsIsoF *regexp.Regexp
|
||||
AwsUsGov *regexp.Regexp
|
||||
}{
|
||||
|
||||
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
|
||||
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"),
|
||||
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
|
||||
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
|
||||
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
|
||||
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
|
||||
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
|
||||
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
|
||||
}
|
||||
|
||||
@ -179,6 +183,9 @@ var defaultPartitions = endpoints.Partitions{
|
||||
endpoints.EndpointKey{
|
||||
Region: "ca-central-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ca-west-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-central-1",
|
||||
}: endpoints.Endpoint{},
|
||||
@ -203,6 +210,9 @@ var defaultPartitions = endpoints.Partitions{
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-west-3",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "il-central-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "me-central-1",
|
||||
}: endpoints.Endpoint{},
|
||||
@ -384,6 +394,48 @@ var defaultPartitions = endpoints.Partitions{
|
||||
}: endpoints.Endpoint{},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-iso-e",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "sts-fips.{region}.cloud.adc-e.uk",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "sts.{region}.cloud.adc-e.uk",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIsoE,
|
||||
IsRegionalized: true,
|
||||
},
|
||||
{
|
||||
ID: "aws-iso-f",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "sts-fips.{region}.csp.hci.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "sts.{region}.csp.hci.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIsoF,
|
||||
IsRegionalized: true,
|
||||
},
|
||||
{
|
||||
ID: "aws-us-gov",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
|
217
vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go
generated
vendored
Normal file
217
vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go
generated
vendored
Normal file
@ -0,0 +1,217 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
"github.com/aws/smithy-go/logging"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type HTTPClient interface {
|
||||
Do(*http.Request) (*http.Response, error)
|
||||
}
|
||||
|
||||
type Options struct {
|
||||
// Set of options to modify how an operation is invoked. These apply to all
|
||||
// operations invoked for this client. Use functional options on operation call to
|
||||
// modify this list for per operation behavior.
|
||||
APIOptions []func(*middleware.Stack) error
|
||||
|
||||
// The optional application specific identifier appended to the User-Agent header.
|
||||
AppID string
|
||||
|
||||
// This endpoint will be given as input to an EndpointResolverV2. It is used for
|
||||
// providing a custom base endpoint that is subject to modifications by the
|
||||
// processing EndpointResolverV2.
|
||||
BaseEndpoint *string
|
||||
|
||||
// Configures the events that will be sent to the configured logger.
|
||||
ClientLogMode aws.ClientLogMode
|
||||
|
||||
// The credentials object to use when signing requests.
|
||||
Credentials aws.CredentialsProvider
|
||||
|
||||
// The configuration DefaultsMode that the SDK should use when constructing the
|
||||
// clients initial default settings.
|
||||
DefaultsMode aws.DefaultsMode
|
||||
|
||||
// The endpoint options to be used when attempting to resolve an endpoint.
|
||||
EndpointOptions EndpointResolverOptions
|
||||
|
||||
// The service endpoint resolver.
|
||||
//
|
||||
// Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a
|
||||
// value for this field will likely prevent you from using any endpoint-related
|
||||
// service features released after the introduction of EndpointResolverV2 and
|
||||
// BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom
|
||||
// endpoint, set the client option BaseEndpoint instead.
|
||||
EndpointResolver EndpointResolver
|
||||
|
||||
// Resolves the endpoint used for a particular service operation. This should be
|
||||
// used over the deprecated EndpointResolver.
|
||||
EndpointResolverV2 EndpointResolverV2
|
||||
|
||||
// Signature Version 4 (SigV4) Signer
|
||||
HTTPSignerV4 HTTPSignerV4
|
||||
|
||||
// The logger writer interface to write logging messages to.
|
||||
Logger logging.Logger
|
||||
|
||||
// The region to send requests to. (Required)
|
||||
Region string
|
||||
|
||||
// RetryMaxAttempts specifies the maximum number attempts an API client will call
|
||||
// an operation that fails with a retryable error. A value of 0 is ignored, and
|
||||
// will not be used to configure the API client created default retryer, or modify
|
||||
// per operation call's retry max attempts. If specified in an operation call's
|
||||
// functional options with a value that is different than the constructed client's
|
||||
// Options, the Client's Retryer will be wrapped to use the operation's specific
|
||||
// RetryMaxAttempts value.
|
||||
RetryMaxAttempts int
|
||||
|
||||
// RetryMode specifies the retry mode the API client will be created with, if
|
||||
// Retryer option is not also specified. When creating a new API Clients this
|
||||
// member will only be used if the Retryer Options member is nil. This value will
|
||||
// be ignored if Retryer is not nil. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
RetryMode aws.RetryMode
|
||||
|
||||
// Retryer guides how HTTP requests should be retried in case of recoverable
|
||||
// failures. When nil the API client will use a default retryer. The kind of
|
||||
// default retry created by the API client can be changed with the RetryMode
|
||||
// option.
|
||||
Retryer aws.Retryer
|
||||
|
||||
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
|
||||
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
|
||||
// should not populate this structure programmatically, or rely on the values here
|
||||
// within your applications.
|
||||
RuntimeEnvironment aws.RuntimeEnvironment
|
||||
|
||||
// The initial DefaultsMode used when the client options were constructed. If the
|
||||
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
|
||||
// value was at that point in time. Currently does not support per operation call
|
||||
// overrides, may in the future.
|
||||
resolvedDefaultsMode aws.DefaultsMode
|
||||
|
||||
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
|
||||
// implementation if nil.
|
||||
HTTPClient HTTPClient
|
||||
|
||||
// The auth scheme resolver which determines how to authenticate for each
|
||||
// operation.
|
||||
AuthSchemeResolver AuthSchemeResolver
|
||||
|
||||
// The list of auth schemes supported by the client.
|
||||
AuthSchemes []smithyhttp.AuthScheme
|
||||
}
|
||||
|
||||
// Copy creates a clone where the APIOptions list is deep copied.
|
||||
func (o Options) Copy() Options {
|
||||
to := o
|
||||
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
|
||||
copy(to.APIOptions, o.APIOptions)
|
||||
|
||||
return to
|
||||
}
|
||||
|
||||
func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver {
|
||||
if schemeID == "aws.auth#sigv4" {
|
||||
return getSigV4IdentityResolver(o)
|
||||
}
|
||||
if schemeID == "smithy.api#noAuth" {
|
||||
return &smithyauth.AnonymousIdentityResolver{}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithAPIOptions returns a functional option for setting the Client's APIOptions
|
||||
// option.
|
||||
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, optFns...)
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for
|
||||
// this field will likely prevent you from using any endpoint-related service
|
||||
// features released after the introduction of EndpointResolverV2 and BaseEndpoint.
|
||||
// To migrate an EndpointResolver implementation that uses a custom endpoint, set
|
||||
// the client option BaseEndpoint instead.
|
||||
func WithEndpointResolver(v EndpointResolver) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolver = v
|
||||
}
|
||||
}
|
||||
|
||||
// WithEndpointResolverV2 returns a functional option for setting the Client's
|
||||
// EndpointResolverV2 option.
|
||||
func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) {
|
||||
return func(o *Options) {
|
||||
o.EndpointResolverV2 = v
|
||||
}
|
||||
}
|
||||
|
||||
func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver {
|
||||
if o.Credentials != nil {
|
||||
return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// WithSigV4SigningName applies an override to the authentication workflow to
|
||||
// use the given signing name for SigV4-authenticated operations.
|
||||
//
|
||||
// This is an advanced setting. The value here is FINAL, taking precedence over
|
||||
// the resolved signing name from both auth scheme resolution and endpoint
|
||||
// resolution.
|
||||
func WithSigV4SigningName(name string) func(*Options) {
|
||||
fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in)
|
||||
}
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {
|
||||
return s.Initialize.Add(
|
||||
middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn),
|
||||
middleware.Before,
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// WithSigV4SigningRegion applies an override to the authentication workflow to
|
||||
// use the given signing region for SigV4-authenticated operations.
|
||||
//
|
||||
// This is an advanced setting. The value here is FINAL, taking precedence over
|
||||
// the resolved signing region from both auth scheme resolution and endpoint
|
||||
// resolution.
|
||||
func WithSigV4SigningRegion(region string) func(*Options) {
|
||||
fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in)
|
||||
}
|
||||
return func(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error {
|
||||
return s.Initialize.Add(
|
||||
middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn),
|
||||
middleware.Before,
|
||||
)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func ignoreAnonymousAuth(options *Options) {
|
||||
if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) {
|
||||
options.Credentials = nil
|
||||
}
|
||||
}
|
36
vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go
generated
vendored
36
vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go
generated
vendored
@ -546,6 +546,35 @@ func awsAwsquery_serializeDocumentPolicyDescriptorType(v *types.PolicyDescriptor
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsAwsquery_serializeDocumentProvidedContext(v *types.ProvidedContext, value query.Value) error {
|
||||
object := value.Object()
|
||||
_ = object
|
||||
|
||||
if v.ContextAssertion != nil {
|
||||
objectKey := object.Key("ContextAssertion")
|
||||
objectKey.String(*v.ContextAssertion)
|
||||
}
|
||||
|
||||
if v.ProviderArn != nil {
|
||||
objectKey := object.Key("ProviderArn")
|
||||
objectKey.String(*v.ProviderArn)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsAwsquery_serializeDocumentProvidedContextsListType(v []types.ProvidedContext, value query.Value) error {
|
||||
array := value.Array("member")
|
||||
|
||||
for i := range v {
|
||||
av := array.Value()
|
||||
if err := awsAwsquery_serializeDocumentProvidedContext(&v[i], av); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsAwsquery_serializeDocumentTag(v *types.Tag, value query.Value) error {
|
||||
object := value.Object()
|
||||
_ = object
|
||||
@ -611,6 +640,13 @@ func awsAwsquery_serializeOpDocumentAssumeRoleInput(v *AssumeRoleInput, value qu
|
||||
}
|
||||
}
|
||||
|
||||
if v.ProvidedContexts != nil {
|
||||
objectKey := object.Key("ProvidedContexts")
|
||||
if err := awsAwsquery_serializeDocumentProvidedContextsListType(v.ProvidedContexts, objectKey); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if v.RoleArn != nil {
|
||||
objectKey := object.Key("RoleArn")
|
||||
objectKey.String(*v.RoleArn)
|
||||
|
19
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go
generated
vendored
19
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go
generated
vendored
@ -183,12 +183,10 @@ func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { retu
|
||||
// compresses the session policy document, session policy ARNs, and session tags
|
||||
// into a packed binary format that has a separate limit. The error message
|
||||
// indicates by percentage how close the policies and tags are to the upper size
|
||||
// limit. For more information, see Passing Session Tags in STS
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the
|
||||
// IAM User Guide. You could receive this error even though you meet other defined
|
||||
// session policy and session tag limits. For more information, see IAM and STS
|
||||
// Entity Character Limits
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length)
|
||||
// limit. For more information, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. You could receive this error even though you meet other
|
||||
// defined session policy and session tag limits. For more information, see IAM
|
||||
// and STS Entity Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide.
|
||||
type PackedPolicyTooLargeException struct {
|
||||
Message *string
|
||||
@ -215,11 +213,10 @@ func (e *PackedPolicyTooLargeException) ErrorCode() string {
|
||||
}
|
||||
func (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// STS is not activated in the requested region for the account that is being asked
|
||||
// to generate credentials. The account administrator must use the IAM console to
|
||||
// activate STS in that region. For more information, see Activating and
|
||||
// Deactivating Amazon Web Services STS in an Amazon Web Services Region
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||
// STS is not activated in the requested region for the account that is being
|
||||
// asked to generate credentials. The account administrator must use the IAM
|
||||
// console to activate STS in that region. For more information, see Activating
|
||||
// and Deactivating Amazon Web Services STS in an Amazon Web Services Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||
// in the IAM User Guide.
|
||||
type RegionDisabledException struct {
|
||||
Message *string
|
||||
|
48
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go
generated
vendored
48
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go
generated
vendored
@ -13,9 +13,8 @@ type AssumedRoleUser struct {
|
||||
|
||||
// The ARN of the temporary security credentials that are returned from the
|
||||
// AssumeRole action. For more information about ARNs and how to use them in
|
||||
// policies, see IAM Identifiers
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) in
|
||||
// the IAM User Guide.
|
||||
// policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// This member is required.
|
||||
Arn *string
|
||||
@ -62,9 +61,8 @@ type FederatedUser struct {
|
||||
|
||||
// The ARN that specifies the federated user that is associated with the
|
||||
// credentials. For more information about ARNs and how to use them in policies,
|
||||
// see IAM Identifiers
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) in
|
||||
// the IAM User Guide.
|
||||
// see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// This member is required.
|
||||
Arn *string
|
||||
@ -84,26 +82,39 @@ type PolicyDescriptorType struct {
|
||||
|
||||
// The Amazon Resource Name (ARN) of the IAM managed policy to use as a session
|
||||
// policy for the role. For more information about ARNs, see Amazon Resource Names
|
||||
// (ARNs) and Amazon Web Services Service Namespaces
|
||||
// (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) in
|
||||
// the Amazon Web Services General Reference.
|
||||
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
|
||||
// in the Amazon Web Services General Reference.
|
||||
Arn *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// You can pass custom key-value pair attributes when you assume a role or federate
|
||||
// a user. These are called session tags. You can then use the session tags to
|
||||
// control access to resources. For more information, see Tagging Amazon Web
|
||||
// Services STS Sessions
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) in the
|
||||
// IAM User Guide.
|
||||
// Contains information about the provided context. This includes the signed and
|
||||
// encrypted trusted context assertion and the context provider ARN from which the
|
||||
// trusted context assertion was generated.
|
||||
type ProvidedContext struct {
|
||||
|
||||
// The signed and encrypted trusted context assertion generated by the context
|
||||
// provider. The trusted context assertion is signed and encrypted by Amazon Web
|
||||
// Services STS.
|
||||
ContextAssertion *string
|
||||
|
||||
// The context provider ARN from which the trusted context assertion was generated.
|
||||
ProviderArn *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// You can pass custom key-value pair attributes when you assume a role or
|
||||
// federate a user. These are called session tags. You can then use the session
|
||||
// tags to control access to resources. For more information, see Tagging Amazon
|
||||
// Web Services STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide.
|
||||
type Tag struct {
|
||||
|
||||
// The key for a session tag. You can pass up to 50 session tags. The plain text
|
||||
// session tag keys can’t exceed 128 characters. For these and additional limits,
|
||||
// see IAM and STS Character Limits
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// This member is required.
|
||||
@ -111,8 +122,7 @@ type Tag struct {
|
||||
|
||||
// The value for a session tag. You can pass up to 50 session tags. The plain text
|
||||
// session tag values can’t exceed 256 characters. For these and additional limits,
|
||||
// see IAM and STS Character Limits
|
||||
// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// This member is required.
|
||||
|
Reference in New Issue
Block a user