Update dependencies
This commit is contained in:
372
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md
generated
vendored
Normal file
372
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,372 @@
|
||||
# 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
|
||||
|
||||
# v1.14.4 (2023-02-22)
|
||||
|
||||
* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes.
|
||||
|
||||
# v1.14.3 (2023-02-20)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.14.2 (2023-02-15)
|
||||
|
||||
* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910.
|
||||
* **Bug Fix**: Correct error type parsing for restJson services.
|
||||
|
||||
# v1.14.1 (2023-02-03)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.14.0 (2023-01-05)
|
||||
|
||||
* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401).
|
||||
|
||||
# v1.13.11 (2022-12-19)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.13.10 (2022-12-15)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.9 (2022-12-02)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.8 (2022-10-24)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.7 (2022-10-21)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.6 (2022-09-30)
|
||||
|
||||
* **Documentation**: Documentation updates for the IAM Identity Center OIDC CLI Reference.
|
||||
|
||||
# v1.13.5 (2022-09-20)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.4 (2022-09-14)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.3 (2022-09-02)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.2 (2022-08-31)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.1 (2022-08-29)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.13.0 (2022-08-25)
|
||||
|
||||
* **Feature**: Updated required request parameters on IAM Identity Center's OIDC CreateToken action.
|
||||
|
||||
# v1.12.14 (2022-08-11)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.13 (2022-08-09)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.12 (2022-08-08)
|
||||
|
||||
* **Documentation**: Documentation updates to reflect service rename - AWS IAM Identity Center (successor to AWS Single Sign-On)
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.11 (2022-08-01)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.10 (2022-07-11)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.12.9 (2022-07-05)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.8 (2022-06-29)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.7 (2022-06-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.6 (2022-05-27)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.12.5 (2022-05-17)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.4 (2022-04-25)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.3 (2022-03-30)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.2 (2022-03-24)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.1 (2022-03-23)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.12.0 (2022-03-08)
|
||||
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.11.0 (2022-02-24)
|
||||
|
||||
* **Feature**: API client updated
|
||||
* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options.
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.10.0 (2022-01-14)
|
||||
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.9.0 (2022-01-07)
|
||||
|
||||
* **Feature**: API client updated
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.8.2 (2021-12-02)
|
||||
|
||||
* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514))
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.8.1 (2021-11-19)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.8.0 (2021-11-06)
|
||||
|
||||
* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically.
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.7.0 (2021-10-21)
|
||||
|
||||
* **Feature**: Updated to latest version
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.6.0 (2021-10-11)
|
||||
|
||||
* **Feature**: API client updated
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.5.0 (2021-09-17)
|
||||
|
||||
* **Feature**: Updated API client and endpoints to latest revision.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.4.0 (2021-08-27)
|
||||
|
||||
* **Feature**: Updated API model to latest revision.
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.3.3 (2021-08-19)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.3.2 (2021-08-04)
|
||||
|
||||
* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.3.1 (2021-07-15)
|
||||
|
||||
* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.3.0 (2021-06-25)
|
||||
|
||||
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.2.1 (2021-05-20)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.2.0 (2021-05-14)
|
||||
|
||||
* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
202
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/LICENSE.txt
generated
vendored
Normal file
202
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/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.
|
||||
475
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go
generated
vendored
Normal file
475
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_client.go
generated
vendored
Normal file
@@ -0,0 +1,475 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
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"
|
||||
"github.com/aws/smithy-go/logging"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"net"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
const ServiceID = "SSO OIDC"
|
||||
const ServiceAPIVersion = "2019-06-10"
|
||||
|
||||
// Client provides the API client to make operations call for AWS SSO OIDC.
|
||||
type Client struct {
|
||||
options Options
|
||||
}
|
||||
|
||||
// New returns an initialized Client based on the functional options. Provide
|
||||
// additional functional options to further configure the behavior of the client,
|
||||
// such as changing the client's endpoint or adding custom middleware behavior.
|
||||
func New(options Options, optFns ...func(*Options)) *Client {
|
||||
options = options.Copy()
|
||||
|
||||
resolveDefaultLogger(&options)
|
||||
|
||||
setResolvedDefaultsMode(&options)
|
||||
|
||||
resolveRetryer(&options)
|
||||
|
||||
resolveHTTPClient(&options)
|
||||
|
||||
resolveHTTPSignerV4(&options)
|
||||
|
||||
resolveEndpointResolverV2(&options)
|
||||
|
||||
resolveAuthSchemeResolver(&options)
|
||||
|
||||
for _, fn := range optFns {
|
||||
fn(&options)
|
||||
}
|
||||
|
||||
finalizeRetryMaxAttempts(&options)
|
||||
|
||||
ignoreAnonymousAuth(&options)
|
||||
|
||||
wrapWithAnonymousAuth(&options)
|
||||
|
||||
resolveAuthSchemes(&options)
|
||||
|
||||
client := &Client{
|
||||
options: options,
|
||||
}
|
||||
|
||||
return client
|
||||
}
|
||||
|
||||
// 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()
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
finalizeOperationRetryMaxAttempts(&options, *c)
|
||||
|
||||
finalizeClientEndpointResolverOptions(&options)
|
||||
|
||||
for _, fn := range stackFns {
|
||||
if err := fn(stack, options); err != nil {
|
||||
return nil, metadata, err
|
||||
}
|
||||
}
|
||||
|
||||
for _, fn := range options.APIOptions {
|
||||
if err := fn(stack); err != nil {
|
||||
return nil, metadata, err
|
||||
}
|
||||
}
|
||||
|
||||
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
|
||||
result, metadata, err = handler.Handle(ctx, params)
|
||||
if err != nil {
|
||||
err = &smithy.OperationError{
|
||||
ServiceID: ServiceID,
|
||||
OperationName: opID,
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
o.Logger = logging.Nop{}
|
||||
}
|
||||
|
||||
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
|
||||
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
|
||||
}
|
||||
|
||||
func setResolvedDefaultsMode(o *Options) {
|
||||
if len(o.resolvedDefaultsMode) > 0 {
|
||||
return
|
||||
}
|
||||
|
||||
var mode aws.DefaultsMode
|
||||
mode.SetFromString(string(o.DefaultsMode))
|
||||
|
||||
if mode == aws.DefaultsModeAuto {
|
||||
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
|
||||
}
|
||||
|
||||
o.resolvedDefaultsMode = mode
|
||||
}
|
||||
|
||||
// NewFromConfig returns a new client from the provided config.
|
||||
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
|
||||
opts := Options{
|
||||
Region: cfg.Region,
|
||||
DefaultsMode: cfg.DefaultsMode,
|
||||
RuntimeEnvironment: cfg.RuntimeEnvironment,
|
||||
HTTPClient: cfg.HTTPClient,
|
||||
Credentials: cfg.Credentials,
|
||||
APIOptions: cfg.APIOptions,
|
||||
Logger: cfg.Logger,
|
||||
ClientLogMode: cfg.ClientLogMode,
|
||||
AppID: cfg.AppID,
|
||||
}
|
||||
resolveAWSRetryerProvider(cfg, &opts)
|
||||
resolveAWSRetryMaxAttempts(cfg, &opts)
|
||||
resolveAWSRetryMode(cfg, &opts)
|
||||
resolveAWSEndpointResolver(cfg, &opts)
|
||||
resolveUseDualStackEndpoint(cfg, &opts)
|
||||
resolveUseFIPSEndpoint(cfg, &opts)
|
||||
resolveBaseEndpoint(cfg, &opts)
|
||||
return New(opts, optFns...)
|
||||
}
|
||||
|
||||
func resolveHTTPClient(o *Options) {
|
||||
var buildable *awshttp.BuildableClient
|
||||
|
||||
if o.HTTPClient != nil {
|
||||
var ok bool
|
||||
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
buildable = awshttp.NewBuildableClient()
|
||||
}
|
||||
|
||||
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
|
||||
if err == nil {
|
||||
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
|
||||
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
|
||||
dialer.Timeout = dialerTimeout
|
||||
}
|
||||
})
|
||||
|
||||
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
|
||||
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
|
||||
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
o.HTTPClient = buildable
|
||||
}
|
||||
|
||||
func resolveRetryer(o *Options) {
|
||||
if o.Retryer != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if len(o.RetryMode) == 0 {
|
||||
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
|
||||
if err == nil {
|
||||
o.RetryMode = modeConfig.RetryMode
|
||||
}
|
||||
}
|
||||
if len(o.RetryMode) == 0 {
|
||||
o.RetryMode = aws.RetryModeStandard
|
||||
}
|
||||
|
||||
var standardOptions []func(*retry.StandardOptions)
|
||||
if v := o.RetryMaxAttempts; v != 0 {
|
||||
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
|
||||
so.MaxAttempts = v
|
||||
})
|
||||
}
|
||||
|
||||
switch o.RetryMode {
|
||||
case aws.RetryModeAdaptive:
|
||||
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
|
||||
if len(standardOptions) != 0 {
|
||||
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
|
||||
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
|
||||
})
|
||||
}
|
||||
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
|
||||
|
||||
default:
|
||||
o.Retryer = retry.NewStandard(standardOptions...)
|
||||
}
|
||||
}
|
||||
|
||||
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
|
||||
if cfg.Retryer == nil {
|
||||
return
|
||||
}
|
||||
o.Retryer = cfg.Retryer()
|
||||
}
|
||||
|
||||
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
|
||||
if len(cfg.RetryMode) == 0 {
|
||||
return
|
||||
}
|
||||
o.RetryMode = cfg.RetryMode
|
||||
}
|
||||
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
|
||||
if cfg.RetryMaxAttempts == 0 {
|
||||
return
|
||||
}
|
||||
o.RetryMaxAttempts = cfg.RetryMaxAttempts
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
|
||||
}
|
||||
|
||||
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
|
||||
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
|
||||
return
|
||||
}
|
||||
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions)
|
||||
}
|
||||
|
||||
func addClientUserAgent(stack *middleware.Stack, options Options) error {
|
||||
if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "ssooidc", goModuleVersion)(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if len(options.AppID) > 0 {
|
||||
return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type HTTPSignerV4 interface {
|
||||
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
|
||||
}
|
||||
|
||||
func resolveHTTPSignerV4(o *Options) {
|
||||
if o.HTTPSignerV4 != nil {
|
||||
return
|
||||
}
|
||||
o.HTTPSignerV4 = newDefaultV4Signer(*o)
|
||||
}
|
||||
|
||||
func newDefaultV4Signer(o Options) *v4.Signer {
|
||||
return v4.NewSigner(func(so *v4.SignerOptions) {
|
||||
so.Logger = o.Logger
|
||||
so.LogSigning = o.ClientLogMode.IsSigning()
|
||||
})
|
||||
}
|
||||
|
||||
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
|
||||
mo := retry.AddRetryMiddlewaresOptions{
|
||||
Retryer: o.Retryer,
|
||||
LogRetryAttempts: o.ClientLogMode.IsRetries(),
|
||||
}
|
||||
return retry.AddRetryMiddlewares(stack, mo)
|
||||
}
|
||||
|
||||
// resolves dual-stack endpoint configuration
|
||||
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
|
||||
if len(cfg.ConfigSources) == 0 {
|
||||
return nil
|
||||
}
|
||||
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if found {
|
||||
o.EndpointOptions.UseDualStackEndpoint = value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// resolves FIPS endpoint configuration
|
||||
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
|
||||
if len(cfg.ConfigSources) == 0 {
|
||||
return nil
|
||||
}
|
||||
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if found {
|
||||
o.EndpointOptions.UseFIPSEndpoint = value
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
|
||||
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
|
||||
}
|
||||
|
||||
func addResponseErrorMiddleware(stack *middleware.Stack) error {
|
||||
return awshttp.AddResponseErrorMiddleware(stack)
|
||||
}
|
||||
|
||||
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
|
||||
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
|
||||
LogRequest: o.ClientLogMode.IsRequest(),
|
||||
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
|
||||
LogResponse: o.ClientLogMode.IsResponse(),
|
||||
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)
|
||||
}
|
||||
203
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go
generated
vendored
Normal file
203
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_CreateToken.go
generated
vendored
Normal file
@@ -0,0 +1,203 @@
|
||||
// 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/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
// 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{}
|
||||
}
|
||||
|
||||
result, metadata, err := c.invokeOperation(ctx, "CreateToken", params, optFns, c.addOperationCreateTokenMiddlewares)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out := result.(*CreateTokenOutput)
|
||||
out.ResultMetadata = metadata
|
||||
return out, nil
|
||||
}
|
||||
|
||||
type CreateTokenInput struct {
|
||||
|
||||
// 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
|
||||
|
||||
// A secret string generated for the client. This value should come from the
|
||||
// persisted result of the RegisterClient API.
|
||||
//
|
||||
// This member is required.
|
||||
ClientSecret *string
|
||||
|
||||
// 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
|
||||
|
||||
// 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 authorization request. This comes from the result
|
||||
// of the StartDeviceAuthorization API.
|
||||
DeviceCode *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
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
type CreateTokenOutput 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
|
||||
|
||||
// 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
|
||||
|
||||
// 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
|
||||
|
||||
// Used to notify the client 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) 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
|
||||
}
|
||||
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateToken{}, middleware.After)
|
||||
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
|
||||
}
|
||||
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 = 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 = 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
|
||||
}
|
||||
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_opCreateToken(region string) *awsmiddleware.RegisterServiceMetadata {
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
OperationName: "CreateToken",
|
||||
}
|
||||
}
|
||||
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",
|
||||
}
|
||||
}
|
||||
161
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go
generated
vendored
Normal file
161
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_RegisterClient.go
generated
vendored
Normal file
@@ -0,0 +1,161 @@
|
||||
// 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/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
// Registers a client with IAM Identity Center. This allows clients to initiate
|
||||
// device authorization. The output should be persisted for reuse through many
|
||||
// authentication requests.
|
||||
func (c *Client) RegisterClient(ctx context.Context, params *RegisterClientInput, optFns ...func(*Options)) (*RegisterClientOutput, error) {
|
||||
if params == nil {
|
||||
params = &RegisterClientInput{}
|
||||
}
|
||||
|
||||
result, metadata, err := c.invokeOperation(ctx, "RegisterClient", params, optFns, c.addOperationRegisterClientMiddlewares)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out := result.(*RegisterClientOutput)
|
||||
out.ResultMetadata = metadata
|
||||
return out, nil
|
||||
}
|
||||
|
||||
type RegisterClientInput struct {
|
||||
|
||||
// The friendly name of the client.
|
||||
//
|
||||
// This member is required.
|
||||
ClientName *string
|
||||
|
||||
// The type of client. The service supports only public as a client type. Anything
|
||||
// other than public will be rejected by the service.
|
||||
//
|
||||
// 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.
|
||||
Scopes []string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
type RegisterClientOutput struct {
|
||||
|
||||
// An endpoint that the client can use to request authorization.
|
||||
AuthorizationEndpoint *string
|
||||
|
||||
// The unique identifier string for each client. This client uses this identifier
|
||||
// to get authenticated by the service in subsequent calls.
|
||||
ClientId *string
|
||||
|
||||
// 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.
|
||||
ClientSecret *string
|
||||
|
||||
// Indicates the time at which the clientId and clientSecret will become invalid.
|
||||
ClientSecretExpiresAt int64
|
||||
|
||||
// An endpoint that the client can use to create tokens.
|
||||
TokenEndpoint *string
|
||||
|
||||
// Metadata pertaining to the operation's result.
|
||||
ResultMetadata middleware.Metadata
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterClient{}, middleware.After)
|
||||
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
|
||||
}
|
||||
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 = 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 = 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
|
||||
}
|
||||
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_opRegisterClient(region string) *awsmiddleware.RegisterServiceMetadata {
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
OperationName: "RegisterClient",
|
||||
}
|
||||
}
|
||||
169
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go
generated
vendored
Normal file
169
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/api_op_StartDeviceAuthorization.go
generated
vendored
Normal file
@@ -0,0 +1,169 @@
|
||||
// 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/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
// Initiates device authorization by requesting a pair of verification codes from
|
||||
// the authorization service.
|
||||
func (c *Client) StartDeviceAuthorization(ctx context.Context, params *StartDeviceAuthorizationInput, optFns ...func(*Options)) (*StartDeviceAuthorizationOutput, error) {
|
||||
if params == nil {
|
||||
params = &StartDeviceAuthorizationInput{}
|
||||
}
|
||||
|
||||
result, metadata, err := c.invokeOperation(ctx, "StartDeviceAuthorization", params, optFns, c.addOperationStartDeviceAuthorizationMiddlewares)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out := result.(*StartDeviceAuthorizationOutput)
|
||||
out.ResultMetadata = metadata
|
||||
return out, nil
|
||||
}
|
||||
|
||||
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.
|
||||
//
|
||||
// This member is required.
|
||||
ClientId *string
|
||||
|
||||
// A secret string that is generated for the client. This value should come from
|
||||
// the persisted result of the RegisterClient API operation.
|
||||
//
|
||||
// This member is required.
|
||||
ClientSecret *string
|
||||
|
||||
// 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.
|
||||
StartUrl *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
type StartDeviceAuthorizationOutput struct {
|
||||
|
||||
// The short-lived code that is used by the device when polling for a session
|
||||
// token.
|
||||
DeviceCode *string
|
||||
|
||||
// Indicates the number of seconds in which the verification code will become
|
||||
// invalid.
|
||||
ExpiresIn int32
|
||||
|
||||
// Indicates the number of seconds the client must wait between attempts when
|
||||
// polling for a session.
|
||||
Interval int32
|
||||
|
||||
// A one-time user verification code. This is needed to authorize an in-use device.
|
||||
UserCode *string
|
||||
|
||||
// The URI of the verification page that takes the userCode to authorize the
|
||||
// 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.
|
||||
VerificationUriComplete *string
|
||||
|
||||
// Metadata pertaining to the operation's result.
|
||||
ResultMetadata middleware.Metadata
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartDeviceAuthorization{}, middleware.After)
|
||||
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
|
||||
}
|
||||
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 = 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 = 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
|
||||
}
|
||||
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_opStartDeviceAuthorization(region string) *awsmiddleware.RegisterServiceMetadata {
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
OperationName: "StartDeviceAuthorization",
|
||||
}
|
||||
}
|
||||
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)
|
||||
}
|
||||
2066
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go
generated
vendored
Normal file
2066
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/deserializers.go
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
38
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go
generated
vendored
Normal file
38
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/doc.go
generated
vendored
Normal file
@@ -0,0 +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.
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
// 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
|
||||
528
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go
generated
vendored
Normal file
528
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/endpoints.go
generated
vendored
Normal file
@@ -0,0 +1,528 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package ssooidc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"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"
|
||||
)
|
||||
|
||||
// EndpointResolverOptions is the service endpoint resolver options
|
||||
type EndpointResolverOptions = internalendpoints.Options
|
||||
|
||||
// EndpointResolver interface for resolving service endpoints.
|
||||
type EndpointResolver interface {
|
||||
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
|
||||
}
|
||||
|
||||
var _ EndpointResolver = &internalendpoints.Resolver{}
|
||||
|
||||
// NewDefaultEndpointResolver constructs a new service endpoint resolver
|
||||
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
|
||||
return internalendpoints.New()
|
||||
}
|
||||
|
||||
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
|
||||
// the EndpointResolver interface. This is useful when you want to add additional
|
||||
// endpoint resolving logic, or stub out specific endpoints with custom values.
|
||||
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
|
||||
|
||||
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
|
||||
return fn(region, options)
|
||||
}
|
||||
|
||||
// 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
|
||||
// EndpointSourceCustom.You can provide functional options to configure endpoint
|
||||
// values for the resolved endpoint.
|
||||
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
|
||||
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
|
||||
for _, fn := range optFns {
|
||||
fn(&e)
|
||||
}
|
||||
|
||||
return EndpointResolverFunc(
|
||||
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
|
||||
if len(e.SigningRegion) == 0 {
|
||||
e.SigningRegion = region
|
||||
}
|
||||
return e, nil
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
type ResolveEndpoint struct {
|
||||
Resolver EndpointResolver
|
||||
Options EndpointResolverOptions
|
||||
}
|
||||
|
||||
func (*ResolveEndpoint) ID() string {
|
||||
return "ResolveEndpoint"
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
if m.Resolver == nil {
|
||||
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
|
||||
}
|
||||
|
||||
eo := m.Options
|
||||
eo.Logger = middleware.GetLogger(ctx)
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
req.URL, err = url.Parse(endpoint.URL)
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
|
||||
}
|
||||
|
||||
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
|
||||
signingName := endpoint.SigningName
|
||||
if len(signingName) == 0 {
|
||||
signingName = "sso-oauth"
|
||||
}
|
||||
ctx = awsmiddleware.SetSigningName(ctx, signingName)
|
||||
}
|
||||
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
|
||||
ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable)
|
||||
ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion)
|
||||
ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID)
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {
|
||||
return stack.Serialize.Insert(&ResolveEndpoint{
|
||||
Resolver: o.EndpointResolver,
|
||||
Options: o.EndpointOptions,
|
||||
}, "OperationSerializer", middleware.Before)
|
||||
}
|
||||
|
||||
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
|
||||
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
|
||||
return err
|
||||
}
|
||||
|
||||
type wrappedEndpointResolver struct {
|
||||
awsResolver aws.EndpointResolverWithOptions
|
||||
}
|
||||
|
||||
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
|
||||
return w.awsResolver.ResolveEndpoint(ServiceID, region, options)
|
||||
}
|
||||
|
||||
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
|
||||
|
||||
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
|
||||
return a(service, region)
|
||||
}
|
||||
|
||||
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
|
||||
|
||||
// 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.
|
||||
//
|
||||
// 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 {
|
||||
resolver = awsResolverWithOptions
|
||||
} else if awsResolver != nil {
|
||||
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
|
||||
}
|
||||
|
||||
return &wrappedEndpointResolver{
|
||||
awsResolver: resolver,
|
||||
}
|
||||
}
|
||||
|
||||
func finalizeClientEndpointResolverOptions(options *Options) {
|
||||
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
|
||||
|
||||
if len(options.EndpointOptions.ResolvedRegion) == 0 {
|
||||
const fipsInfix = "-fips-"
|
||||
const fipsPrefix = "fips-"
|
||||
const fipsSuffix = "-fips"
|
||||
|
||||
if strings.Contains(options.Region, fipsInfix) ||
|
||||
strings.Contains(options.Region, fipsPrefix) ||
|
||||
strings.Contains(options.Region, fipsSuffix) {
|
||||
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
|
||||
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
|
||||
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
35
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json
generated
vendored
Normal file
35
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/generated.json
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"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/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",
|
||||
"types/types.go",
|
||||
"validators.go"
|
||||
],
|
||||
"go": "1.15",
|
||||
"module": "github.com/aws/aws-sdk-go-v2/service/ssooidc",
|
||||
"unstable": false
|
||||
}
|
||||
6
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go
generated
vendored
Normal file
6
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/go_module_metadata.go
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
|
||||
|
||||
package ssooidc
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.21.7"
|
||||
534
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go
generated
vendored
Normal file
534
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/internal/endpoints/endpoints.go
generated
vendored
Normal file
@@ -0,0 +1,534 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package endpoints
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
|
||||
"github.com/aws/smithy-go/logging"
|
||||
"regexp"
|
||||
)
|
||||
|
||||
// Options is the endpoint resolver configuration options
|
||||
type Options struct {
|
||||
// Logger is a logging implementation that log events should be sent to.
|
||||
Logger logging.Logger
|
||||
|
||||
// LogDeprecated indicates that deprecated endpoints should be logged to the
|
||||
// provided logger.
|
||||
LogDeprecated bool
|
||||
|
||||
// ResolvedRegion is used to override the region to be resolved, rather then the
|
||||
// using the value passed to the ResolveEndpoint method. This value is used by the
|
||||
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
|
||||
// name. You must not set this value directly in your application.
|
||||
ResolvedRegion string
|
||||
|
||||
// DisableHTTPS informs the resolver to return an endpoint that does not use the
|
||||
// HTTPS scheme.
|
||||
DisableHTTPS bool
|
||||
|
||||
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
|
||||
UseDualStackEndpoint aws.DualStackEndpointState
|
||||
|
||||
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
|
||||
UseFIPSEndpoint aws.FIPSEndpointState
|
||||
}
|
||||
|
||||
func (o Options) GetResolvedRegion() string {
|
||||
return o.ResolvedRegion
|
||||
}
|
||||
|
||||
func (o Options) GetDisableHTTPS() bool {
|
||||
return o.DisableHTTPS
|
||||
}
|
||||
|
||||
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
|
||||
return o.UseDualStackEndpoint
|
||||
}
|
||||
|
||||
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
|
||||
return o.UseFIPSEndpoint
|
||||
}
|
||||
|
||||
func transformToSharedOptions(options Options) endpoints.Options {
|
||||
return endpoints.Options{
|
||||
Logger: options.Logger,
|
||||
LogDeprecated: options.LogDeprecated,
|
||||
ResolvedRegion: options.ResolvedRegion,
|
||||
DisableHTTPS: options.DisableHTTPS,
|
||||
UseDualStackEndpoint: options.UseDualStackEndpoint,
|
||||
UseFIPSEndpoint: options.UseFIPSEndpoint,
|
||||
}
|
||||
}
|
||||
|
||||
// Resolver SSO OIDC endpoint resolver
|
||||
type Resolver struct {
|
||||
partitions endpoints.Partitions
|
||||
}
|
||||
|
||||
// ResolveEndpoint resolves the service endpoint for the given region and options
|
||||
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
|
||||
if len(region) == 0 {
|
||||
return endpoint, &aws.MissingRegionError{}
|
||||
}
|
||||
|
||||
opt := transformToSharedOptions(options)
|
||||
return r.partitions.ResolveEndpoint(region, opt)
|
||||
}
|
||||
|
||||
// New returns a new Resolver
|
||||
func New() *Resolver {
|
||||
return &Resolver{
|
||||
partitions: defaultPartitions,
|
||||
}
|
||||
}
|
||||
|
||||
var partitionRegexp = struct {
|
||||
Aws *regexp.Regexp
|
||||
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|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+$"),
|
||||
}
|
||||
|
||||
var defaultPartitions = endpoints.Partitions{
|
||||
{
|
||||
ID: "aws",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "oidc.{region}.api.aws",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "oidc-fips.{region}.amazonaws.com",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "oidc-fips.{region}.api.aws",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "oidc.{region}.amazonaws.com",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.Aws,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
endpoints.EndpointKey{
|
||||
Region: "af-south-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.af-south-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "af-south-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-east-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.ap-east-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "ap-east-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-northeast-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.ap-northeast-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "ap-northeast-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-northeast-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.ap-northeast-2.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "ap-northeast-2",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-northeast-3",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.ap-northeast-3.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "ap-northeast-3",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-south-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.ap-south-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "ap-south-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-southeast-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.ap-southeast-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "ap-southeast-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-southeast-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.ap-southeast-2.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "ap-southeast-2",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-southeast-3",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.ap-southeast-3.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "ap-southeast-3",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ca-central-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.ca-central-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "ca-central-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-central-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.eu-central-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
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{
|
||||
Hostname: "oidc.eu-north-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "eu-north-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-south-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.eu-south-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "eu-south-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-west-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.eu-west-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "eu-west-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-west-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.eu-west-2.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "eu-west-2",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "eu-west-3",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.eu-west-3.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
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{
|
||||
Hostname: "oidc.me-south-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "me-south-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "sa-east-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.sa-east-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "sa-east-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-east-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.us-east-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-east-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-east-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.us-east-2.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-east-2",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-west-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.us-west-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-west-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-west-2",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.us-west-2.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-west-2",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-cn",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "oidc.{region}.api.amazonwebservices.com.cn",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "oidc-fips.{region}.amazonaws.com.cn",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "oidc-fips.{region}.api.amazonwebservices.com.cn",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "oidc.{region}.amazonaws.com.cn",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
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",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "oidc-fips.{region}.c2s.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "oidc.{region}.c2s.ic.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIso,
|
||||
IsRegionalized: true,
|
||||
},
|
||||
{
|
||||
ID: "aws-iso-b",
|
||||
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "oidc-fips.{region}.sc2s.sgov.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "oidc.{region}.sc2s.sgov.gov",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
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{
|
||||
{
|
||||
Variant: endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "oidc.{region}.api.aws",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: endpoints.FIPSVariant,
|
||||
}: {
|
||||
Hostname: "oidc-fips.{region}.amazonaws.com",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
|
||||
}: {
|
||||
Hostname: "oidc-fips.{region}.api.aws",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
{
|
||||
Variant: 0,
|
||||
}: {
|
||||
Hostname: "oidc.{region}.amazonaws.com",
|
||||
Protocols: []string{"https"},
|
||||
SignatureVersions: []string{"v4"},
|
||||
},
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsUsGov,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-gov-east-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.us-gov-east-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-gov-east-1",
|
||||
},
|
||||
},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-gov-west-1",
|
||||
}: endpoints.Endpoint{
|
||||
Hostname: "oidc.us-gov-west-1.amazonaws.com",
|
||||
CredentialScope: endpoints.CredentialScope{
|
||||
Region: "us-gov-west-1",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
431
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go
generated
vendored
Normal file
431
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/serializers.go
generated
vendored
Normal file
@@ -0,0 +1,431 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package ssooidc
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
"github.com/aws/smithy-go/encoding/httpbinding"
|
||||
smithyjson "github.com/aws/smithy-go/encoding/json"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
type awsRestjson1_serializeOpCreateToken struct {
|
||||
}
|
||||
|
||||
func (*awsRestjson1_serializeOpCreateToken) ID() string {
|
||||
return "OperationSerializer"
|
||||
}
|
||||
|
||||
func (m *awsRestjson1_serializeOpCreateToken) 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.(*CreateTokenInput)
|
||||
_ = input
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
|
||||
}
|
||||
|
||||
opPath, opQuery := httpbinding.SplitURI("/token")
|
||||
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_serializeOpDocumentCreateTokenInput(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_serializeOpHttpBindingsCreateTokenInput(v *CreateTokenInput, encoder *httpbinding.Encoder) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unsupported serialization of nil %T", v)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_serializeOpDocumentCreateTokenInput(v *CreateTokenInput, value smithyjson.Value) error {
|
||||
object := value.Object()
|
||||
defer object.Close()
|
||||
|
||||
if v.ClientId != nil {
|
||||
ok := object.Key("clientId")
|
||||
ok.String(*v.ClientId)
|
||||
}
|
||||
|
||||
if v.ClientSecret != nil {
|
||||
ok := object.Key("clientSecret")
|
||||
ok.String(*v.ClientSecret)
|
||||
}
|
||||
|
||||
if v.Code != nil {
|
||||
ok := object.Key("code")
|
||||
ok.String(*v.Code)
|
||||
}
|
||||
|
||||
if v.DeviceCode != nil {
|
||||
ok := object.Key("deviceCode")
|
||||
ok.String(*v.DeviceCode)
|
||||
}
|
||||
|
||||
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.Scope != nil {
|
||||
ok := object.Key("scope")
|
||||
if err := awsRestjson1_serializeDocumentScopes(v.Scope, ok); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
}
|
||||
|
||||
func (*awsRestjson1_serializeOpRegisterClient) ID() string {
|
||||
return "OperationSerializer"
|
||||
}
|
||||
|
||||
func (m *awsRestjson1_serializeOpRegisterClient) 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.(*RegisterClientInput)
|
||||
_ = input
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
|
||||
}
|
||||
|
||||
opPath, opQuery := httpbinding.SplitURI("/client/register")
|
||||
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_serializeOpDocumentRegisterClientInput(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_serializeOpHttpBindingsRegisterClientInput(v *RegisterClientInput, encoder *httpbinding.Encoder) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unsupported serialization of nil %T", v)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_serializeOpDocumentRegisterClientInput(v *RegisterClientInput, value smithyjson.Value) error {
|
||||
object := value.Object()
|
||||
defer object.Close()
|
||||
|
||||
if v.ClientName != nil {
|
||||
ok := object.Key("clientName")
|
||||
ok.String(*v.ClientName)
|
||||
}
|
||||
|
||||
if v.ClientType != nil {
|
||||
ok := object.Key("clientType")
|
||||
ok.String(*v.ClientType)
|
||||
}
|
||||
|
||||
if v.Scopes != nil {
|
||||
ok := object.Key("scopes")
|
||||
if err := awsRestjson1_serializeDocumentScopes(v.Scopes, ok); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type awsRestjson1_serializeOpStartDeviceAuthorization struct {
|
||||
}
|
||||
|
||||
func (*awsRestjson1_serializeOpStartDeviceAuthorization) ID() string {
|
||||
return "OperationSerializer"
|
||||
}
|
||||
|
||||
func (m *awsRestjson1_serializeOpStartDeviceAuthorization) 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.(*StartDeviceAuthorizationInput)
|
||||
_ = input
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
|
||||
}
|
||||
|
||||
opPath, opQuery := httpbinding.SplitURI("/device_authorization")
|
||||
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_serializeOpDocumentStartDeviceAuthorizationInput(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_serializeOpHttpBindingsStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, encoder *httpbinding.Encoder) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unsupported serialization of nil %T", v)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_serializeOpDocumentStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput, value smithyjson.Value) error {
|
||||
object := value.Object()
|
||||
defer object.Close()
|
||||
|
||||
if v.ClientId != nil {
|
||||
ok := object.Key("clientId")
|
||||
ok.String(*v.ClientId)
|
||||
}
|
||||
|
||||
if v.ClientSecret != nil {
|
||||
ok := object.Key("clientSecret")
|
||||
ok.String(*v.ClientSecret)
|
||||
}
|
||||
|
||||
if v.StartUrl != nil {
|
||||
ok := object.Key("startUrl")
|
||||
ok.String(*v.StartUrl)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsRestjson1_serializeDocumentScopes(v []string, value smithyjson.Value) error {
|
||||
array := value.Array()
|
||||
defer array.Close()
|
||||
|
||||
for i := range v {
|
||||
av := array.Value()
|
||||
av.String(v[i])
|
||||
}
|
||||
return nil
|
||||
}
|
||||
398
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go
generated
vendored
Normal file
398
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/errors.go
generated
vendored
Normal file
@@ -0,0 +1,398 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
)
|
||||
|
||||
// You do not have sufficient access to perform this action.
|
||||
type AccessDeniedException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *AccessDeniedException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *AccessDeniedException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *AccessDeniedException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "AccessDeniedException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
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.
|
||||
type AuthorizationPendingException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *AuthorizationPendingException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *AuthorizationPendingException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *AuthorizationPendingException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "AuthorizationPendingException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *AuthorizationPendingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that the token issued by the service is expired and is no longer
|
||||
// valid.
|
||||
type ExpiredTokenException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *ExpiredTokenException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *ExpiredTokenException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *ExpiredTokenException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "ExpiredTokenException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *ExpiredTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that an error from the service occurred while trying to process a
|
||||
// request.
|
||||
type InternalServerException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *InternalServerException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *InternalServerException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *InternalServerException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "InternalServerException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
|
||||
|
||||
// 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 .
|
||||
type InvalidClientException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *InvalidClientException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *InvalidClientException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *InvalidClientException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "InvalidClientException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *InvalidClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that the client information sent in the request during registration
|
||||
// is invalid.
|
||||
type InvalidClientMetadataException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *InvalidClientMetadataException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *InvalidClientMetadataException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *InvalidClientMetadataException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "InvalidClientMetadataException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *InvalidClientMetadataException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that a request contains an invalid grant. This can occur if a client
|
||||
// makes a CreateToken request with an invalid grant type.
|
||||
type InvalidGrantException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *InvalidGrantException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *InvalidGrantException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *InvalidGrantException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "InvalidGrantException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *InvalidGrantException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that something is wrong with the input to the request. For example, a
|
||||
// required parameter might be missing or out of range.
|
||||
type InvalidRequestException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *InvalidRequestException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *InvalidRequestException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *InvalidRequestException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "InvalidRequestException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
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
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *InvalidScopeException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *InvalidScopeException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *InvalidScopeException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "InvalidScopeException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *InvalidScopeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that the client is making the request too frequently and is more than
|
||||
// the service can handle.
|
||||
type SlowDownException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *SlowDownException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *SlowDownException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *SlowDownException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "SlowDownException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *SlowDownException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that the client is not currently authorized to make the request. This
|
||||
// can happen when a clientId is not issued for a public client.
|
||||
type UnauthorizedClientException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *UnauthorizedClientException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *UnauthorizedClientException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *UnauthorizedClientException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "UnauthorizedClientException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *UnauthorizedClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// Indicates that the grant type in the request is not supported by the service.
|
||||
type UnsupportedGrantTypeException struct {
|
||||
Message *string
|
||||
|
||||
ErrorCodeOverride *string
|
||||
|
||||
Error_ *string
|
||||
Error_description *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (e *UnsupportedGrantTypeException) Error() string {
|
||||
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
|
||||
}
|
||||
func (e *UnsupportedGrantTypeException) ErrorMessage() string {
|
||||
if e.Message == nil {
|
||||
return ""
|
||||
}
|
||||
return *e.Message
|
||||
}
|
||||
func (e *UnsupportedGrantTypeException) ErrorCode() string {
|
||||
if e == nil || e.ErrorCodeOverride == nil {
|
||||
return "UnsupportedGrantTypeException"
|
||||
}
|
||||
return *e.ErrorCodeOverride
|
||||
}
|
||||
func (e *UnsupportedGrantTypeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
9
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go
generated
vendored
Normal file
9
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/types/types.go
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package types
|
||||
|
||||
import (
|
||||
smithydocument "github.com/aws/smithy-go/document"
|
||||
)
|
||||
|
||||
type noSmithyDocumentSerde = smithydocument.NoSerde
|
||||
184
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go
generated
vendored
Normal file
184
vendor/github.com/aws/aws-sdk-go-v2/service/ssooidc/validators.go
generated
vendored
Normal file
@@ -0,0 +1,184 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package ssooidc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
)
|
||||
|
||||
type validateOpCreateToken struct {
|
||||
}
|
||||
|
||||
func (*validateOpCreateToken) ID() string {
|
||||
return "OperationInputValidation"
|
||||
}
|
||||
|
||||
func (m *validateOpCreateToken) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
input, ok := in.Parameters.(*CreateTokenInput)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
|
||||
}
|
||||
if err := validateOpCreateTokenInput(input); err != nil {
|
||||
return out, metadata, err
|
||||
}
|
||||
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 {
|
||||
}
|
||||
|
||||
func (*validateOpRegisterClient) ID() string {
|
||||
return "OperationInputValidation"
|
||||
}
|
||||
|
||||
func (m *validateOpRegisterClient) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
input, ok := in.Parameters.(*RegisterClientInput)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
|
||||
}
|
||||
if err := validateOpRegisterClientInput(input); err != nil {
|
||||
return out, metadata, err
|
||||
}
|
||||
return next.HandleInitialize(ctx, in)
|
||||
}
|
||||
|
||||
type validateOpStartDeviceAuthorization struct {
|
||||
}
|
||||
|
||||
func (*validateOpStartDeviceAuthorization) ID() string {
|
||||
return "OperationInputValidation"
|
||||
}
|
||||
|
||||
func (m *validateOpStartDeviceAuthorization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
input, ok := in.Parameters.(*StartDeviceAuthorizationInput)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
|
||||
}
|
||||
if err := validateOpStartDeviceAuthorizationInput(input); err != nil {
|
||||
return out, metadata, err
|
||||
}
|
||||
return next.HandleInitialize(ctx, in)
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
func addOpStartDeviceAuthorizationValidationMiddleware(stack *middleware.Stack) error {
|
||||
return stack.Initialize.Add(&validateOpStartDeviceAuthorization{}, middleware.After)
|
||||
}
|
||||
|
||||
func validateOpCreateTokenInput(v *CreateTokenInput) error {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
invalidParams := smithy.InvalidParamsError{Context: "CreateTokenInput"}
|
||||
if v.ClientId == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("ClientId"))
|
||||
}
|
||||
if v.ClientSecret == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("ClientSecret"))
|
||||
}
|
||||
if v.GrantType == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("GrantType"))
|
||||
}
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
invalidParams := smithy.InvalidParamsError{Context: "RegisterClientInput"}
|
||||
if v.ClientName == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("ClientName"))
|
||||
}
|
||||
if v.ClientType == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("ClientType"))
|
||||
}
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func validateOpStartDeviceAuthorizationInput(v *StartDeviceAuthorizationInput) error {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
invalidParams := smithy.InvalidParamsError{Context: "StartDeviceAuthorizationInput"}
|
||||
if v.ClientId == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("ClientId"))
|
||||
}
|
||||
if v.ClientSecret == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("ClientSecret"))
|
||||
}
|
||||
if v.StartUrl == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("StartUrl"))
|
||||
}
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user