Update dependencies
This commit is contained in:
219
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
219
vendor/github.com/aws/aws-sdk-go-v2/service/sts/CHANGELOG.md
generated
vendored
@@ -1,3 +1,222 @@
|
||||
# v1.33.13 (2025-02-04)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.33.12 (2025-01-31)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.33.11 (2025-01-30)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.33.10 (2025-01-24)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
* **Dependency Update**: Upgrade to smithy-go v1.22.2.
|
||||
|
||||
# v1.33.9 (2025-01-17)
|
||||
|
||||
* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop.
|
||||
|
||||
# v1.33.8 (2025-01-15)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.33.7 (2025-01-14)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.33.6 (2025-01-10)
|
||||
|
||||
* **Documentation**: Fixed typos in the descriptions.
|
||||
|
||||
# v1.33.5 (2025-01-09)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.33.4 (2025-01-08)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.33.3 (2024-12-19)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.33.2 (2024-12-02)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.33.1 (2024-11-18)
|
||||
|
||||
* **Dependency Update**: Update to smithy-go v1.22.1.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.33.0 (2024-11-14)
|
||||
|
||||
* **Feature**: This release introduces the new API 'AssumeRoot', which returns short-term credentials that you can use to perform privileged tasks.
|
||||
|
||||
# v1.32.4 (2024-11-06)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.32.3 (2024-10-28)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.32.2 (2024-10-08)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.32.1 (2024-10-07)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.32.0 (2024-10-04)
|
||||
|
||||
* **Feature**: Add support for HTTP client metrics.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.31.4 (2024-10-03)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.31.3 (2024-09-27)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.31.2 (2024-09-25)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.31.1 (2024-09-23)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.31.0 (2024-09-20)
|
||||
|
||||
* **Feature**: Add tracing and metrics support to service clients.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.30.8 (2024-09-17)
|
||||
|
||||
* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution.
|
||||
|
||||
# v1.30.7 (2024-09-04)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.30.6 (2024-09-03)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.30.5 (2024-08-22)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.30.4 (2024-08-15)
|
||||
|
||||
* **Dependency Update**: Bump minimum Go version to 1.21.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.30.3 (2024-07-10.2)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.30.2 (2024-07-10)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.30.1 (2024-06-28)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.30.0 (2024-06-26)
|
||||
|
||||
* **Feature**: Support list-of-string endpoint parameter.
|
||||
|
||||
# v1.29.1 (2024-06-19)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.29.0 (2024-06-18)
|
||||
|
||||
* **Feature**: Track usage of various AWS SDK features in user-agent string.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.13 (2024-06-17)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.12 (2024-06-07)
|
||||
|
||||
* **Bug Fix**: Add clock skew correction on all service clients
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.11 (2024-06-03)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.10 (2024-05-23)
|
||||
|
||||
* No change notes available for this release.
|
||||
|
||||
# v1.28.9 (2024-05-16)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.8 (2024-05-15)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.7 (2024-05-08)
|
||||
|
||||
* **Bug Fix**: GoDoc improvement
|
||||
|
||||
# v1.28.6 (2024-03-29)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.5 (2024-03-18)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.4 (2024-03-07)
|
||||
|
||||
* **Bug Fix**: Remove dependency on go-cmp.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.3 (2024-03-05)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.2 (2024-03-04)
|
||||
|
||||
* **Bug Fix**: Update internal/presigned-url dependency for corrected API name.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.1 (2024-02-23)
|
||||
|
||||
* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.28.0 (2024-02-22)
|
||||
|
||||
* **Feature**: Add middleware stack snapshot tests.
|
||||
|
||||
# v1.27.2 (2024-02-21)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.27.1 (2024-02-20)
|
||||
|
||||
* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure.
|
||||
|
||||
# v1.27.0 (2024-02-13)
|
||||
|
||||
* **Feature**: Bump minimum Go version to 1.20 per our language support policy.
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
# v1.26.7 (2024-01-04)
|
||||
|
||||
* **Dependency Update**: Updated to the latest SDK module versions
|
||||
|
||||
465
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go
generated
vendored
465
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_client.go
generated
vendored
@@ -4,6 +4,7 @@ package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/defaults"
|
||||
@@ -15,25 +16,160 @@ import (
|
||||
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"
|
||||
internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware"
|
||||
acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding"
|
||||
presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url"
|
||||
smithy "github.com/aws/smithy-go"
|
||||
smithyauth "github.com/aws/smithy-go/auth"
|
||||
smithydocument "github.com/aws/smithy-go/document"
|
||||
"github.com/aws/smithy-go/logging"
|
||||
"github.com/aws/smithy-go/metrics"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
"github.com/aws/smithy-go/tracing"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"net"
|
||||
"net/http"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
)
|
||||
|
||||
const ServiceID = "STS"
|
||||
const ServiceAPIVersion = "2011-06-15"
|
||||
|
||||
type operationMetrics struct {
|
||||
Duration metrics.Float64Histogram
|
||||
SerializeDuration metrics.Float64Histogram
|
||||
ResolveIdentityDuration metrics.Float64Histogram
|
||||
ResolveEndpointDuration metrics.Float64Histogram
|
||||
SignRequestDuration metrics.Float64Histogram
|
||||
DeserializeDuration metrics.Float64Histogram
|
||||
}
|
||||
|
||||
func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram {
|
||||
switch name {
|
||||
case "client.call.duration":
|
||||
return m.Duration
|
||||
case "client.call.serialization_duration":
|
||||
return m.SerializeDuration
|
||||
case "client.call.resolve_identity_duration":
|
||||
return m.ResolveIdentityDuration
|
||||
case "client.call.resolve_endpoint_duration":
|
||||
return m.ResolveEndpointDuration
|
||||
case "client.call.signing_duration":
|
||||
return m.SignRequestDuration
|
||||
case "client.call.deserialization_duration":
|
||||
return m.DeserializeDuration
|
||||
default:
|
||||
panic("unrecognized operation metric")
|
||||
}
|
||||
}
|
||||
|
||||
func timeOperationMetric[T any](
|
||||
ctx context.Context, metric string, fn func() (T, error),
|
||||
opts ...metrics.RecordMetricOption,
|
||||
) (T, error) {
|
||||
instr := getOperationMetrics(ctx).histogramFor(metric)
|
||||
opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...)
|
||||
|
||||
start := time.Now()
|
||||
v, err := fn()
|
||||
end := time.Now()
|
||||
|
||||
elapsed := end.Sub(start)
|
||||
instr.Record(ctx, float64(elapsed)/1e9, opts...)
|
||||
return v, err
|
||||
}
|
||||
|
||||
func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() {
|
||||
instr := getOperationMetrics(ctx).histogramFor(metric)
|
||||
opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...)
|
||||
|
||||
var ended bool
|
||||
start := time.Now()
|
||||
return func() {
|
||||
if ended {
|
||||
return
|
||||
}
|
||||
ended = true
|
||||
|
||||
end := time.Now()
|
||||
|
||||
elapsed := end.Sub(start)
|
||||
instr.Record(ctx, float64(elapsed)/1e9, opts...)
|
||||
}
|
||||
}
|
||||
|
||||
func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption {
|
||||
return func(o *metrics.RecordMetricOptions) {
|
||||
o.Properties.Set("rpc.service", middleware.GetServiceID(ctx))
|
||||
o.Properties.Set("rpc.method", middleware.GetOperationName(ctx))
|
||||
}
|
||||
}
|
||||
|
||||
type operationMetricsKey struct{}
|
||||
|
||||
func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) {
|
||||
meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/sts")
|
||||
om := &operationMetrics{}
|
||||
|
||||
var err error
|
||||
|
||||
om.Duration, err = operationMetricTimer(meter, "client.call.duration",
|
||||
"Overall call duration (including retries and time to send or receive request and response body)")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration",
|
||||
"The time it takes to serialize a message body")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration",
|
||||
"The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration",
|
||||
"The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration",
|
||||
"The time it takes to sign a request")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration",
|
||||
"The time it takes to deserialize a message body")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return context.WithValue(parent, operationMetricsKey{}, om), nil
|
||||
}
|
||||
|
||||
func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) {
|
||||
return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) {
|
||||
o.UnitLabel = "s"
|
||||
o.Description = desc
|
||||
})
|
||||
}
|
||||
|
||||
func getOperationMetrics(ctx context.Context) *operationMetrics {
|
||||
return ctx.Value(operationMetricsKey{}).(*operationMetrics)
|
||||
}
|
||||
|
||||
func operationTracer(p tracing.TracerProvider) tracing.Tracer {
|
||||
return p.Tracer("github.com/aws/aws-sdk-go-v2/service/sts")
|
||||
}
|
||||
|
||||
// Client provides the API client to make operations call for AWS Security Token
|
||||
// Service.
|
||||
type Client struct {
|
||||
options Options
|
||||
|
||||
// Difference between the time reported by the server and the client
|
||||
timeOffset *atomic.Int64
|
||||
}
|
||||
|
||||
// New returns an initialized Client based on the functional options. Provide
|
||||
@@ -54,6 +190,10 @@ func New(options Options, optFns ...func(*Options)) *Client {
|
||||
|
||||
resolveEndpointResolverV2(&options)
|
||||
|
||||
resolveTracerProvider(&options)
|
||||
|
||||
resolveMeterProvider(&options)
|
||||
|
||||
resolveAuthSchemeResolver(&options)
|
||||
|
||||
for _, fn := range optFns {
|
||||
@@ -72,6 +212,8 @@ func New(options Options, optFns ...func(*Options)) *Client {
|
||||
options: options,
|
||||
}
|
||||
|
||||
initializeTimeOffsetResolver(client)
|
||||
|
||||
return client
|
||||
}
|
||||
|
||||
@@ -84,8 +226,15 @@ 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) {
|
||||
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)
|
||||
ctx = middleware.WithServiceID(ctx, ServiceID)
|
||||
ctx = middleware.WithOperationName(ctx, opID)
|
||||
|
||||
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
|
||||
options := c.options.Copy()
|
||||
|
||||
@@ -109,15 +258,56 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf
|
||||
}
|
||||
}
|
||||
|
||||
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
|
||||
result, metadata, err = handler.Handle(ctx, params)
|
||||
ctx, err = withOperationMetrics(ctx, options.MeterProvider)
|
||||
if err != nil {
|
||||
return nil, metadata, err
|
||||
}
|
||||
|
||||
tracer := operationTracer(options.TracerProvider)
|
||||
spanName := fmt.Sprintf("%s.%s", ServiceID, opID)
|
||||
|
||||
ctx = tracing.WithOperationTracer(ctx, tracer)
|
||||
|
||||
ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) {
|
||||
o.Kind = tracing.SpanKindClient
|
||||
o.Properties.Set("rpc.system", "aws-api")
|
||||
o.Properties.Set("rpc.method", opID)
|
||||
o.Properties.Set("rpc.service", ServiceID)
|
||||
})
|
||||
endTimer := startMetricTimer(ctx, "client.call.duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
|
||||
handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) {
|
||||
o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/sts")
|
||||
})
|
||||
decorated := middleware.DecorateHandler(handler, stack)
|
||||
result, metadata, err = decorated.Handle(ctx, params)
|
||||
if err != nil {
|
||||
span.SetProperty("exception.type", fmt.Sprintf("%T", err))
|
||||
span.SetProperty("exception.message", err.Error())
|
||||
|
||||
var aerr smithy.APIError
|
||||
if errors.As(err, &aerr) {
|
||||
span.SetProperty("api.error_code", aerr.ErrorCode())
|
||||
span.SetProperty("api.error_message", aerr.ErrorMessage())
|
||||
span.SetProperty("api.error_fault", aerr.ErrorFault().String())
|
||||
}
|
||||
|
||||
err = &smithy.OperationError{
|
||||
ServiceID: ServiceID,
|
||||
OperationName: opID,
|
||||
Err: err,
|
||||
}
|
||||
}
|
||||
|
||||
span.SetProperty("error", err != nil)
|
||||
if err == nil {
|
||||
span.SetStatus(tracing.SpanStatusOK)
|
||||
} else {
|
||||
span.SetStatus(tracing.SpanStatusError)
|
||||
}
|
||||
|
||||
return result, metadata, err
|
||||
}
|
||||
|
||||
@@ -155,7 +345,7 @@ func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, o
|
||||
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 {
|
||||
if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil {
|
||||
return fmt.Errorf("add Signing: %w", err)
|
||||
}
|
||||
return nil
|
||||
@@ -365,17 +555,37 @@ func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
|
||||
}
|
||||
|
||||
func addClientUserAgent(stack *middleware.Stack, options Options) error {
|
||||
if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sts", goModuleVersion)(stack); err != nil {
|
||||
ua, err := getOrAddRequestUserAgent(stack)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "sts", goModuleVersion)
|
||||
if len(options.AppID) > 0 {
|
||||
return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack)
|
||||
ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) {
|
||||
id := (*awsmiddleware.RequestUserAgent)(nil).ID()
|
||||
mw, ok := stack.Build.Get(id)
|
||||
if !ok {
|
||||
mw = awsmiddleware.NewRequestUserAgent()
|
||||
if err := stack.Build.Add(mw, middleware.After); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
ua, ok := mw.(*awsmiddleware.RequestUserAgent)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id)
|
||||
}
|
||||
|
||||
return ua, 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
|
||||
}
|
||||
@@ -394,12 +604,97 @@ func newDefaultV4Signer(o Options) *v4.Signer {
|
||||
})
|
||||
}
|
||||
|
||||
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
|
||||
mo := retry.AddRetryMiddlewaresOptions{
|
||||
Retryer: o.Retryer,
|
||||
LogRetryAttempts: o.ClientLogMode.IsRetries(),
|
||||
func addClientRequestID(stack *middleware.Stack) error {
|
||||
return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After)
|
||||
}
|
||||
|
||||
func addComputeContentLength(stack *middleware.Stack) error {
|
||||
return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After)
|
||||
}
|
||||
|
||||
func addRawResponseToMetadata(stack *middleware.Stack) error {
|
||||
return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before)
|
||||
}
|
||||
|
||||
func addRecordResponseTiming(stack *middleware.Stack) error {
|
||||
return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After)
|
||||
}
|
||||
|
||||
func addSpanRetryLoop(stack *middleware.Stack, options Options) error {
|
||||
return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before)
|
||||
}
|
||||
|
||||
type spanRetryLoop struct {
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*spanRetryLoop) ID() string {
|
||||
return "spanRetryLoop"
|
||||
}
|
||||
|
||||
func (m *spanRetryLoop) HandleFinalize(
|
||||
ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler,
|
||||
) (
|
||||
middleware.FinalizeOutput, middleware.Metadata, error,
|
||||
) {
|
||||
tracer := operationTracer(m.options.TracerProvider)
|
||||
ctx, span := tracer.StartSpan(ctx, "RetryLoop")
|
||||
defer span.End()
|
||||
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
func addStreamingEventsPayload(stack *middleware.Stack) error {
|
||||
return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before)
|
||||
}
|
||||
|
||||
func addUnsignedPayload(stack *middleware.Stack) error {
|
||||
return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After)
|
||||
}
|
||||
|
||||
func addComputePayloadSHA256(stack *middleware.Stack) error {
|
||||
return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After)
|
||||
}
|
||||
|
||||
func addContentSHA256Header(stack *middleware.Stack) error {
|
||||
return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After)
|
||||
}
|
||||
|
||||
func addIsWaiterUserAgent(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
|
||||
ua, err := getOrAddRequestUserAgent(stack)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func addIsPaginatorUserAgent(o *Options) {
|
||||
o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error {
|
||||
ua, err := getOrAddRequestUserAgent(stack)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
func addRetry(stack *middleware.Stack, o Options) error {
|
||||
attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) {
|
||||
m.LogAttempts = o.ClientLogMode.IsRetries()
|
||||
m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/sts")
|
||||
})
|
||||
if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
return retry.AddRetryMiddlewares(stack, mo)
|
||||
if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// resolves dual-stack endpoint configuration
|
||||
@@ -432,12 +727,68 @@ func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string {
|
||||
if mode == aws.AccountIDEndpointModeDisabled {
|
||||
return nil
|
||||
}
|
||||
|
||||
if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" {
|
||||
return aws.String(ca.Credentials.AccountID)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error {
|
||||
mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset}
|
||||
if err := stack.Build.Add(&mw, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before)
|
||||
}
|
||||
func initializeTimeOffsetResolver(c *Client) {
|
||||
c.timeOffset = new(atomic.Int64)
|
||||
}
|
||||
|
||||
func addUserAgentRetryMode(stack *middleware.Stack, options Options) error {
|
||||
ua, err := getOrAddRequestUserAgent(stack)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
switch options.Retryer.(type) {
|
||||
case *retry.Standard:
|
||||
ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard)
|
||||
case *retry.AdaptiveMode:
|
||||
ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func resolveTracerProvider(options *Options) {
|
||||
if options.TracerProvider == nil {
|
||||
options.TracerProvider = &tracing.NopTracerProvider{}
|
||||
}
|
||||
}
|
||||
|
||||
func resolveMeterProvider(options *Options) {
|
||||
if options.MeterProvider == nil {
|
||||
options.MeterProvider = metrics.NopMeterProvider{}
|
||||
}
|
||||
}
|
||||
|
||||
func addRecursionDetection(stack *middleware.Stack) error {
|
||||
return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After)
|
||||
}
|
||||
|
||||
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
|
||||
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
|
||||
return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before)
|
||||
|
||||
}
|
||||
|
||||
func addResponseErrorMiddleware(stack *middleware.Stack) error {
|
||||
return awshttp.AddResponseErrorMiddleware(stack)
|
||||
return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before)
|
||||
|
||||
}
|
||||
|
||||
// HTTPPresignerV4 represents presigner interface used by presign url client
|
||||
@@ -581,7 +932,7 @@ func (c presignConverter) convertToPresignMiddleware(stack *middleware.Stack, op
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = presignedurlcust.AddAsIsPresigingMiddleware(stack)
|
||||
err = presignedurlcust.AddAsIsPresigningMiddleware(stack)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -625,3 +976,89 @@ func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error {
|
||||
DisableHTTPS: o.EndpointOptions.DisableHTTPS,
|
||||
}, "ResolveEndpointV2", middleware.After)
|
||||
}
|
||||
|
||||
type spanInitializeStart struct {
|
||||
}
|
||||
|
||||
func (*spanInitializeStart) ID() string {
|
||||
return "spanInitializeStart"
|
||||
}
|
||||
|
||||
func (m *spanInitializeStart) HandleInitialize(
|
||||
ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler,
|
||||
) (
|
||||
middleware.InitializeOutput, middleware.Metadata, error,
|
||||
) {
|
||||
ctx, _ = tracing.StartSpan(ctx, "Initialize")
|
||||
|
||||
return next.HandleInitialize(ctx, in)
|
||||
}
|
||||
|
||||
type spanInitializeEnd struct {
|
||||
}
|
||||
|
||||
func (*spanInitializeEnd) ID() string {
|
||||
return "spanInitializeEnd"
|
||||
}
|
||||
|
||||
func (m *spanInitializeEnd) HandleInitialize(
|
||||
ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler,
|
||||
) (
|
||||
middleware.InitializeOutput, middleware.Metadata, error,
|
||||
) {
|
||||
ctx, span := tracing.PopSpan(ctx)
|
||||
span.End()
|
||||
|
||||
return next.HandleInitialize(ctx, in)
|
||||
}
|
||||
|
||||
type spanBuildRequestStart struct {
|
||||
}
|
||||
|
||||
func (*spanBuildRequestStart) ID() string {
|
||||
return "spanBuildRequestStart"
|
||||
}
|
||||
|
||||
func (m *spanBuildRequestStart) HandleSerialize(
|
||||
ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler,
|
||||
) (
|
||||
middleware.SerializeOutput, middleware.Metadata, error,
|
||||
) {
|
||||
ctx, _ = tracing.StartSpan(ctx, "BuildRequest")
|
||||
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
type spanBuildRequestEnd struct {
|
||||
}
|
||||
|
||||
func (*spanBuildRequestEnd) ID() string {
|
||||
return "spanBuildRequestEnd"
|
||||
}
|
||||
|
||||
func (m *spanBuildRequestEnd) HandleBuild(
|
||||
ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler,
|
||||
) (
|
||||
middleware.BuildOutput, middleware.Metadata, error,
|
||||
) {
|
||||
ctx, span := tracing.PopSpan(ctx)
|
||||
span.End()
|
||||
|
||||
return next.HandleBuild(ctx, in)
|
||||
}
|
||||
|
||||
func addSpanInitializeStart(stack *middleware.Stack) error {
|
||||
return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before)
|
||||
}
|
||||
|
||||
func addSpanInitializeEnd(stack *middleware.Stack) error {
|
||||
return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After)
|
||||
}
|
||||
|
||||
func addSpanBuildRequestStart(stack *middleware.Stack) error {
|
||||
return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before)
|
||||
}
|
||||
|
||||
func addSpanBuildRequestEnd(stack *middleware.Stack) error {
|
||||
return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After)
|
||||
}
|
||||
|
||||
498
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
generated
vendored
498
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRole.go
generated
vendored
@@ -16,69 +16,98 @@ import (
|
||||
// Amazon Web Services resources. These temporary credentials consist of an access
|
||||
// key ID, a secret access key, and a security token. Typically, you use AssumeRole
|
||||
// within your account or for cross-account access. For a comparison of AssumeRole
|
||||
// with other API operations that produce temporary credentials, see Requesting
|
||||
// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// in the IAM User Guide. Permissions The temporary security credentials created by
|
||||
// AssumeRole can be used to make API calls to any Amazon Web Services service
|
||||
// with the following exception: You cannot call the Amazon Web Services STS
|
||||
// GetFederationToken or GetSessionToken API operations. (Optional) You can pass
|
||||
// inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
|
||||
// use for both inline and managed session policies can't exceed 2,048 characters.
|
||||
// Passing policies to this operation returns new temporary credentials. The
|
||||
// resulting session's permissions are the intersection of the role's
|
||||
// identity-based policy and the session policies. You can use the role's temporary
|
||||
// credentials in subsequent Amazon Web Services API calls to access resources in
|
||||
// the account that owns the role. You cannot use session policies to grant more
|
||||
// permissions than those allowed by the identity-based policy of the role that is
|
||||
// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. When you create a role, you create two policies: a role
|
||||
// trust policy that specifies who can assume the role, and a permissions policy
|
||||
// that specifies what can be done with the role. You specify the trusted principal
|
||||
// that is allowed to assume the role in the role trust policy. To assume a role
|
||||
// from a different account, your Amazon Web Services account must be trusted by
|
||||
// the role. The trust relationship is defined in the role's trust policy when the
|
||||
// role is created. That trust policy states which accounts are allowed to delegate
|
||||
// that access to users in the account. A user who wants to access a role in a
|
||||
// different account must also have permissions that are delegated from the account
|
||||
// administrator. The administrator must attach a policy that allows the user to
|
||||
// call AssumeRole for the ARN of the role in the other account. To allow a user
|
||||
// to assume a role in the same account, you can do either of the following:
|
||||
// with other API operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the
|
||||
// IAM User Guide.
|
||||
//
|
||||
// # Permissions
|
||||
//
|
||||
// The temporary security credentials created by AssumeRole can be used to make
|
||||
// API calls to any Amazon Web Services service with the following exception: You
|
||||
// cannot call the Amazon Web Services STS GetFederationToken or GetSessionToken
|
||||
// API operations.
|
||||
//
|
||||
// (Optional) You can pass inline or managed session policies to this operation.
|
||||
// You can pass a single JSON policy document to use as an inline session policy.
|
||||
// You can also specify up to 10 managed policy Amazon Resource Names (ARNs) to use
|
||||
// as managed session policies. The plaintext that you use for both inline and
|
||||
// managed session policies can't exceed 2,048 characters. Passing policies to this
|
||||
// operation returns new temporary credentials. The resulting session's permissions
|
||||
// are the intersection of the role's identity-based policy and the session
|
||||
// policies. You can use the role's temporary credentials in subsequent Amazon Web
|
||||
// Services API calls to access resources in the account that owns the role. You
|
||||
// cannot use session policies to grant more permissions than those allowed by the
|
||||
// identity-based policy of the role that is being assumed. For more information,
|
||||
// see [Session Policies]in the IAM User Guide.
|
||||
//
|
||||
// When you create a role, you create two policies: a role trust policy that
|
||||
// specifies who can assume the role, and a permissions policy that specifies what
|
||||
// can be done with the role. You specify the trusted principal that is allowed to
|
||||
// assume the role in the role trust policy.
|
||||
//
|
||||
// To assume a role from a different account, your Amazon Web Services account
|
||||
// must be trusted by the role. The trust relationship is defined in the role's
|
||||
// trust policy when the role is created. That trust policy states which accounts
|
||||
// are allowed to delegate that access to users in the account.
|
||||
//
|
||||
// A user who wants to access a role in a different account must also have
|
||||
// permissions that are delegated from the account administrator. The administrator
|
||||
// must attach a policy that allows the user to call AssumeRole for the ARN of the
|
||||
// role in the other account.
|
||||
//
|
||||
// To allow a user to assume a role in the same account, you can do either of the
|
||||
// following:
|
||||
//
|
||||
// - Attach a policy to the user that allows the user to call AssumeRole (as long
|
||||
// as the role's trust policy trusts the account).
|
||||
//
|
||||
// - Add the user as a principal directly in the role's trust policy.
|
||||
//
|
||||
// You can do either because the role’s trust policy acts as an IAM resource-based
|
||||
// policy. When a resource-based policy grants access to a principal in the same
|
||||
// account, no additional identity-based policy is required. For more information
|
||||
// about trust policies and resource-based policies, see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
|
||||
// in the IAM User Guide. Tags (Optional) You can pass tag key-value pairs to your
|
||||
// session. These tags are called session tags. For more information about session
|
||||
// tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. An administrator must grant you the permissions necessary
|
||||
// to pass session tags. The administrator can also create granular permissions to
|
||||
// allow you to pass only specific session tags. For more information, see
|
||||
// Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// in the IAM User Guide. You can set the session tags as transitive. Transitive
|
||||
// tags persist during role chaining. For more information, see Chaining Roles
|
||||
// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// in the IAM User Guide. Using MFA with AssumeRole (Optional) You can include
|
||||
// multi-factor authentication (MFA) information when you call AssumeRole . This is
|
||||
// useful for cross-account scenarios to ensure that the user that assumes the role
|
||||
// has been authenticated with an Amazon Web Services MFA device. In that scenario,
|
||||
// the trust policy of the role being assumed includes a condition that tests for
|
||||
// MFA authentication. If the caller does not include valid MFA information, the
|
||||
// request to assume the role is denied. The condition in a trust policy that tests
|
||||
// for MFA authentication might look like the following example. "Condition":
|
||||
// {"Bool": {"aws:MultiFactorAuthPresent": true}} For more information, see
|
||||
// Configuring MFA-Protected API Access (https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html)
|
||||
// in the IAM User Guide guide. To use MFA with AssumeRole , you pass values for
|
||||
// the SerialNumber and TokenCode parameters. The SerialNumber value identifies
|
||||
// the user's hardware or virtual MFA device. The TokenCode is the time-based
|
||||
// one-time password (TOTP) that the MFA device produces.
|
||||
// about trust policies and resource-based policies, see [IAM Policies]in the IAM User Guide.
|
||||
//
|
||||
// # Tags
|
||||
//
|
||||
// (Optional) You can pass tag key-value pairs to your session. These tags are
|
||||
// called session tags. For more information about session tags, see [Passing Session Tags in STS]in the IAM
|
||||
// User Guide.
|
||||
//
|
||||
// An administrator must grant you the permissions necessary to pass session tags.
|
||||
// The administrator can also create granular permissions to allow you to pass only
|
||||
// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide.
|
||||
//
|
||||
// You can set the session tags as transitive. Transitive tags persist during role
|
||||
// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide.
|
||||
//
|
||||
// # Using MFA with AssumeRole
|
||||
//
|
||||
// (Optional) You can include multi-factor authentication (MFA) information when
|
||||
// you call AssumeRole . This is useful for cross-account scenarios to ensure that
|
||||
// the user that assumes the role has been authenticated with an Amazon Web
|
||||
// Services MFA device. In that scenario, the trust policy of the role being
|
||||
// assumed includes a condition that tests for MFA authentication. If the caller
|
||||
// does not include valid MFA information, the request to assume the role is
|
||||
// denied. The condition in a trust policy that tests for MFA authentication might
|
||||
// look like the following example.
|
||||
//
|
||||
// "Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}}
|
||||
//
|
||||
// For more information, see [Configuring MFA-Protected API Access] in the IAM User Guide guide.
|
||||
//
|
||||
// To use MFA with AssumeRole , you pass values for the SerialNumber and TokenCode
|
||||
// parameters. The SerialNumber value identifies the user's hardware or virtual
|
||||
// MFA device. The TokenCode is the time-based one-time password (TOTP) that the
|
||||
// MFA device produces.
|
||||
//
|
||||
// [Configuring MFA-Protected API Access]: https://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
||||
// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining
|
||||
// [IAM Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html
|
||||
// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
|
||||
// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html
|
||||
// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html
|
||||
func (c *Client) AssumeRole(ctx context.Context, params *AssumeRoleInput, optFns ...func(*Options)) (*AssumeRoleOutput, error) {
|
||||
if params == nil {
|
||||
params = &AssumeRoleInput{}
|
||||
@@ -101,17 +130,27 @@ type AssumeRoleInput struct {
|
||||
// This member is required.
|
||||
RoleArn *string
|
||||
|
||||
// An identifier for the assumed role session. Use the role session name to
|
||||
// uniquely identify a session when the same role is assumed by different
|
||||
// principals or for different reasons. In cross-account scenarios, the role
|
||||
// session name is visible to, and can be logged by the account that owns the role.
|
||||
// The role session name is also used in the ARN of the assumed role principal.
|
||||
// This means that subsequent cross-account API requests that use the temporary
|
||||
// security credentials will expose the role session name to the external account
|
||||
// in their CloudTrail logs. The regex used to validate this parameter is a string
|
||||
// of characters consisting of upper- and lower-case alphanumeric characters with
|
||||
// no spaces. You can also include underscores or any of the following characters:
|
||||
// =,.@-
|
||||
// An identifier for the assumed role session.
|
||||
//
|
||||
// Use the role session name to uniquely identify a session when the same role is
|
||||
// assumed by different principals or for different reasons. In cross-account
|
||||
// scenarios, the role session name is visible to, and can be logged by the account
|
||||
// that owns the role. The role session name is also used in the ARN of the assumed
|
||||
// role principal. This means that subsequent cross-account API requests that use
|
||||
// the temporary security credentials will expose the role session name to the
|
||||
// external account in their CloudTrail logs.
|
||||
//
|
||||
// For security purposes, administrators can view this field in [CloudTrail logs] to help identify
|
||||
// who performed an action in Amazon Web Services. Your administrator might require
|
||||
// that you specify your user name as the session name when you assume the role.
|
||||
// For more information, see [sts:RoleSessionName]sts:RoleSessionName .
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: =,.@-
|
||||
//
|
||||
// [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds
|
||||
// [sts:RoleSessionName]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname
|
||||
//
|
||||
// This member is required.
|
||||
RoleSessionName *string
|
||||
@@ -122,23 +161,27 @@ type AssumeRoleInput struct {
|
||||
// hours. If you specify a value higher than this setting or the administrator
|
||||
// setting (whichever is lower), the operation fails. For example, if you specify a
|
||||
// session duration of 12 hours, but your administrator set the maximum session
|
||||
// duration to 6 hours, your operation fails. Role chaining limits your Amazon Web
|
||||
// Services CLI or Amazon Web Services API role session to a maximum of one hour.
|
||||
// When you use the AssumeRole API operation to assume a role, you can specify the
|
||||
// duration of your role session with the DurationSeconds parameter. You can
|
||||
// specify a parameter value of up to 43200 seconds (12 hours), depending on the
|
||||
// maximum session duration setting for your role. However, if you assume a role
|
||||
// using role chaining and provide a DurationSeconds parameter value greater than
|
||||
// one hour, the operation fails. To learn how to view the maximum value for your
|
||||
// role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// in the IAM User Guide. By default, the value is set to 3600 seconds. The
|
||||
// DurationSeconds parameter is separate from the duration of a console session
|
||||
// that you might request using the returned credentials. The request to the
|
||||
// federation endpoint for a console sign-in token takes a SessionDuration
|
||||
// duration to 6 hours, your operation fails.
|
||||
//
|
||||
// Role chaining limits your Amazon Web Services CLI or Amazon Web Services API
|
||||
// role session to a maximum of one hour. When you use the AssumeRole API
|
||||
// operation to assume a role, you can specify the duration of your role session
|
||||
// with the DurationSeconds parameter. You can specify a parameter value of up to
|
||||
// 43200 seconds (12 hours), depending on the maximum session duration setting for
|
||||
// your role. However, if you assume a role using role chaining and provide a
|
||||
// DurationSeconds parameter value greater than one hour, the operation fails. To
|
||||
// learn how to view the maximum value for your role, see [Update the maximum session duration for a role].
|
||||
//
|
||||
// By default, the value is set to 3600 seconds.
|
||||
//
|
||||
// The DurationSeconds parameter is separate from the duration of a console
|
||||
// session that you might request using the returned credentials. The request to
|
||||
// the federation endpoint for a console sign-in token takes a SessionDuration
|
||||
// parameter that specifies the maximum length of the console session. For more
|
||||
// information, see Creating a URL that Enables Federated Users to Access the
|
||||
// Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||
// in the IAM User Guide.
|
||||
// information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide.
|
||||
//
|
||||
// [Update the maximum session duration for a role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration
|
||||
// [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
|
||||
DurationSeconds *int32
|
||||
|
||||
// A unique identifier that might be required when you assume a role in another
|
||||
@@ -149,63 +192,82 @@ type AssumeRoleInput struct {
|
||||
// the administrator of the trusting account might send an external ID to the
|
||||
// administrator of the trusted account. That way, only someone with the ID can
|
||||
// assume the role, rather than everyone in the account. For more information about
|
||||
// the external ID, see How to Use an External ID When Granting Access to Your
|
||||
// Amazon Web Services Resources to a Third Party (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html)
|
||||
// in the IAM User Guide. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
// =,.@:/-
|
||||
// the external ID, see [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]in the IAM User Guide.
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: =,.@:/-
|
||||
//
|
||||
// [How to Use an External ID When Granting Access to Your Amazon Web Services Resources to a Third Party]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
|
||||
ExternalId *string
|
||||
|
||||
// An IAM policy in JSON format that you want to use as an inline session policy.
|
||||
//
|
||||
// This parameter is optional. Passing policies to this operation returns new
|
||||
// temporary credentials. The resulting session's permissions are the intersection
|
||||
// of the role's identity-based policy and the session policies. You can use the
|
||||
// role's temporary credentials in subsequent Amazon Web Services API calls to
|
||||
// access resources in the account that owns the role. You cannot use session
|
||||
// policies to grant more permissions than those allowed by the identity-based
|
||||
// policy of the role that is being assumed. For more information, see Session
|
||||
// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. The plaintext that you use for both inline and managed
|
||||
// session policies can't exceed 2,048 characters. The JSON policy characters can
|
||||
// be any ASCII character from the space character to the end of the valid
|
||||
// character list (\u0020 through \u00FF). It can also include the tab (\u0009),
|
||||
// linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web
|
||||
// Services conversion compresses the passed inline session policy, managed policy
|
||||
// ARNs, and session tags into a packed binary format that has a separate limit.
|
||||
// Your request can fail for this limit even if your plaintext meets the other
|
||||
// requirements. The PackedPolicySize response element indicates by percentage how
|
||||
// close the policies and tags for your request are to the upper size limit.
|
||||
// policy of the role that is being assumed. For more information, see [Session Policies]in the IAM
|
||||
// User Guide.
|
||||
//
|
||||
// The plaintext that you use for both inline and managed session policies can't
|
||||
// exceed 2,048 characters. The JSON policy characters can be any ASCII character
|
||||
// from the space character to the end of the valid character list (\u0020 through
|
||||
// \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage
|
||||
// return (\u000D) characters.
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// For more information about role session permissions, see [Session policies].
|
||||
//
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
Policy *string
|
||||
|
||||
// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
|
||||
// use as managed session policies. The policies must exist in the same account as
|
||||
// the role. This parameter is optional. You can provide up to 10 managed policy
|
||||
// ARNs. However, the plaintext that you use for both inline and managed session
|
||||
// policies can't exceed 2,048 characters. For more information about ARNs, see
|
||||
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
|
||||
// in the Amazon Web Services General Reference. An Amazon Web Services conversion
|
||||
// compresses the passed inline session policy, managed policy ARNs, and session
|
||||
// tags into a packed binary format that has a separate limit. Your request can
|
||||
// fail for this limit even if your plaintext meets the other requirements. The
|
||||
// PackedPolicySize response element indicates by percentage how close the policies
|
||||
// and tags for your request are to the upper size limit. Passing policies to this
|
||||
// operation returns new temporary credentials. The resulting session's permissions
|
||||
// are the intersection of the role's identity-based policy and the session
|
||||
// policies. You can use the role's temporary credentials in subsequent Amazon Web
|
||||
// Services API calls to access resources in the account that owns the role. You
|
||||
// cannot use session policies to grant more permissions than those allowed by the
|
||||
// identity-based policy of the role that is being assumed. For more information,
|
||||
// see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide.
|
||||
// the role.
|
||||
//
|
||||
// This parameter is optional. You can provide up to 10 managed policy ARNs.
|
||||
// However, the plaintext that you use for both inline and managed session policies
|
||||
// can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the
|
||||
// Amazon Web Services General Reference.
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// Passing policies to this operation returns new temporary credentials. The
|
||||
// resulting session's permissions are the intersection of the role's
|
||||
// identity-based policy and the session policies. You can use the role's temporary
|
||||
// credentials in subsequent Amazon Web Services API calls to access resources in
|
||||
// the account that owns the role. You cannot use session policies to grant more
|
||||
// permissions than those allowed by the identity-based policy of the role that is
|
||||
// being assumed. For more information, see [Session Policies]in the IAM User Guide.
|
||||
//
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
||||
PolicyArns []types.PolicyDescriptorType
|
||||
|
||||
// A list of previously acquired trusted context assertions in the format of a
|
||||
// JSON array. The trusted context assertion is signed and encrypted by Amazon Web
|
||||
// Services STS. The following is an example of a ProvidedContext value that
|
||||
// includes a single trusted context assertion and the ARN of the context provider
|
||||
// from which the trusted context assertion was generated.
|
||||
// [{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}]
|
||||
// Services STS.
|
||||
//
|
||||
// The following is an example of a ProvidedContext value that includes a single
|
||||
// trusted context assertion and the ARN of the context provider from which the
|
||||
// trusted context assertion was generated.
|
||||
//
|
||||
// [{"ProviderArn":"arn:aws:iam::aws:contextProvider/IdentityCenter","ContextAssertion":"trusted-context-assertion"}]
|
||||
ProvidedContexts []types.ProvidedContext
|
||||
|
||||
// The identification number of the MFA device that is associated with the user
|
||||
@@ -213,79 +275,99 @@ type AssumeRoleInput struct {
|
||||
// the role being assumed includes a condition that requires MFA authentication.
|
||||
// The value is either the serial number for a hardware device (such as
|
||||
// GAHT12345678 ) or an Amazon Resource Name (ARN) for a virtual device (such as
|
||||
// arn:aws:iam::123456789012:mfa/user ). The regex used to validate this parameter
|
||||
// is a string of characters consisting of upper- and lower-case alphanumeric
|
||||
// characters with no spaces. You can also include underscores or any of the
|
||||
// following characters: =,.@-
|
||||
// arn:aws:iam::123456789012:mfa/user ).
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: =,.@-
|
||||
SerialNumber *string
|
||||
|
||||
// The source identity specified by the principal that is calling the AssumeRole
|
||||
// operation. You can require users to specify a source identity when they assume a
|
||||
// role. You do this by using the sts:SourceIdentity condition key in a role trust
|
||||
// policy. You can use source identity information in CloudTrail logs to determine
|
||||
// who took actions with a role. You can use the aws:SourceIdentity condition key
|
||||
// to further control access to Amazon Web Services resources based on the value of
|
||||
// source identity. For more information about using source identity, see Monitor
|
||||
// and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// in the IAM User Guide. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
// =,.@-. You cannot use a value that begins with the text aws: . This prefix is
|
||||
// reserved for Amazon Web Services internal use.
|
||||
// operation. The source identity value persists across [chained role]sessions.
|
||||
//
|
||||
// You can require users to specify a source identity when they assume a role. You
|
||||
// do this by using the [sts:SourceIdentity]sts:SourceIdentity condition key in a role trust policy.
|
||||
// You can use source identity information in CloudTrail logs to determine who took
|
||||
// actions with a role. You can use the aws:SourceIdentity condition key to
|
||||
// further control access to Amazon Web Services resources based on the value of
|
||||
// source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in the
|
||||
// IAM User Guide.
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: +=,.@-. You cannot use a
|
||||
// value that begins with the text aws: . This prefix is reserved for Amazon Web
|
||||
// Services internal use.
|
||||
//
|
||||
// [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#iam-term-role-chaining
|
||||
// [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
|
||||
// [sts:SourceIdentity]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-sourceidentity
|
||||
SourceIdentity *string
|
||||
|
||||
// A list of session tags that you want to pass. Each session tag consists of a
|
||||
// key name and an associated value. For more information about session tags, see
|
||||
// Tagging Amazon Web Services STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. This parameter is optional. You can pass up to 50 session
|
||||
// tags. The plaintext session tag keys can’t exceed 128 characters, and the values
|
||||
// can’t exceed 256 characters. For these and additional limits, see IAM and STS
|
||||
// Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
|
||||
// inline session policy, managed policy ARNs, and session tags into a packed
|
||||
// binary format that has a separate limit. Your request can fail for this limit
|
||||
// even if your plaintext meets the other requirements. The PackedPolicySize
|
||||
// response element indicates by percentage how close the policies and tags for
|
||||
// your request are to the upper size limit. You can pass a session tag with the
|
||||
// same key as a tag that is already attached to the role. When you do, session
|
||||
// tags override a role tag with the same key. Tag key–value pairs are not case
|
||||
// sensitive, but case is preserved. This means that you cannot have separate
|
||||
// Department and department tag keys. Assume that the role has the Department =
|
||||
// Marketing tag and you pass the department = engineering session tag. Department
|
||||
// and department are not saved as separate tags, and the session tag passed in
|
||||
// the request takes precedence over the role tag. Additionally, if you used
|
||||
// temporary credentials to perform this operation, the new session inherits any
|
||||
// transitive session tags from the calling session. If you pass a session tag with
|
||||
// the same key as an inherited tag, the operation fails. To view the inherited
|
||||
// tags for a session, see the CloudTrail logs. For more information, see Viewing
|
||||
// Session Tags in CloudTrail (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs)
|
||||
// key name and an associated value. For more information about session tags, see [Tagging Amazon Web Services STS Sessions]
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// This parameter is optional. You can pass up to 50 session tags. The plaintext
|
||||
// session tag keys can’t exceed 128 characters, and the values can’t exceed 256
|
||||
// characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User Guide.
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// You can pass a session tag with the same key as a tag that is already attached
|
||||
// to the role. When you do, session tags override a role tag with the same key.
|
||||
//
|
||||
// Tag key–value pairs are not case sensitive, but case is preserved. This means
|
||||
// that you cannot have separate Department and department tag keys. Assume that
|
||||
// the role has the Department = Marketing tag and you pass the department =
|
||||
// engineering session tag. Department and department are not saved as separate
|
||||
// tags, and the session tag passed in the request takes precedence over the role
|
||||
// tag.
|
||||
//
|
||||
// Additionally, if you used temporary credentials to perform this operation, the
|
||||
// new session inherits any transitive session tags from the calling session. If
|
||||
// you pass a session tag with the same key as an inherited tag, the operation
|
||||
// fails. To view the inherited tags for a session, see the CloudTrail logs. For
|
||||
// more information, see [Viewing Session Tags in CloudTrail]in the IAM User Guide.
|
||||
//
|
||||
// [Tagging Amazon Web Services STS Sessions]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
||||
// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
||||
// [Viewing Session Tags in CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_ctlogs
|
||||
Tags []types.Tag
|
||||
|
||||
// The value provided by the MFA device, if the trust policy of the role being
|
||||
// assumed requires MFA. (In other words, if the policy includes a condition that
|
||||
// tests for MFA). If the role being assumed requires MFA and if the TokenCode
|
||||
// value is missing or expired, the AssumeRole call returns an "access denied"
|
||||
// error. The format for this parameter, as described by its regex pattern, is a
|
||||
// sequence of six numeric digits.
|
||||
// error.
|
||||
//
|
||||
// The format for this parameter, as described by its regex pattern, is a sequence
|
||||
// of six numeric digits.
|
||||
TokenCode *string
|
||||
|
||||
// A list of keys for session tags that you want to set as transitive. If you set
|
||||
// a tag key as transitive, the corresponding key and value passes to subsequent
|
||||
// sessions in a role chain. For more information, see Chaining Roles with Session
|
||||
// Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// in the IAM User Guide. This parameter is optional. When you set session tags as
|
||||
// transitive, the session policy and session tags packed binary limit is not
|
||||
// affected. If you choose not to specify a transitive tag key, then no tags are
|
||||
// passed from this session to any subsequent sessions.
|
||||
// sessions in a role chain. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide.
|
||||
//
|
||||
// This parameter is optional. The transitive status of a session tag does not
|
||||
// impact its packed binary size.
|
||||
//
|
||||
// If you choose not to specify a transitive tag key, then no tags are passed from
|
||||
// this session to any subsequent sessions.
|
||||
//
|
||||
// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining
|
||||
TransitiveTagKeys []string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// Contains the response to a successful AssumeRole request, including temporary
|
||||
// Amazon Web Services credentials that can be used to make Amazon Web Services
|
||||
// requests.
|
||||
// Contains the response to a successful AssumeRole request, including temporary Amazon Web
|
||||
// Services credentials that can be used to make Amazon Web Services requests.
|
||||
type AssumeRoleOutput struct {
|
||||
|
||||
// The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers
|
||||
@@ -296,9 +378,10 @@ type AssumeRoleOutput struct {
|
||||
AssumedRoleUser *types.AssumedRoleUser
|
||||
|
||||
// The temporary security credentials, which include an access key ID, a secret
|
||||
// access key, and a security (or session) token. The size of the security token
|
||||
// that STS API operations return is not fixed. We strongly recommend that you make
|
||||
// no assumptions about the maximum size.
|
||||
// access key, and a security (or session) token.
|
||||
//
|
||||
// The size of the security token that STS API operations return is not fixed. We
|
||||
// strongly recommend that you make no assumptions about the maximum size.
|
||||
Credentials *types.Credentials
|
||||
|
||||
// A percentage value that indicates the packed size of the session policies and
|
||||
@@ -308,17 +391,21 @@ type AssumeRoleOutput struct {
|
||||
PackedPolicySize *int32
|
||||
|
||||
// The source identity specified by the principal that is calling the AssumeRole
|
||||
// operation. You can require users to specify a source identity when they assume a
|
||||
// role. You do this by using the sts:SourceIdentity condition key in a role trust
|
||||
// policy. You can use source identity information in CloudTrail logs to determine
|
||||
// who took actions with a role. You can use the aws:SourceIdentity condition key
|
||||
// to further control access to Amazon Web Services resources based on the value of
|
||||
// source identity. For more information about using source identity, see Monitor
|
||||
// and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// in the IAM User Guide. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
// =,.@-
|
||||
// operation.
|
||||
//
|
||||
// You can require users to specify a source identity when they assume a role. You
|
||||
// do this by using the sts:SourceIdentity condition key in a role trust policy.
|
||||
// You can use source identity information in CloudTrail logs to determine who took
|
||||
// actions with a role. You can use the aws:SourceIdentity condition key to
|
||||
// further control access to Amazon Web Services resources based on the value of
|
||||
// source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in the
|
||||
// IAM User Guide.
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: =,.@-
|
||||
//
|
||||
// [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
|
||||
SourceIdentity *string
|
||||
|
||||
// Metadata pertaining to the operation's result.
|
||||
@@ -349,25 +436,28 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
|
||||
if err = addClientRequestID(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
|
||||
if err = addComputeContentLength(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResolveEndpointMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
|
||||
if err = addComputePayloadSHA256(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
if err = addRetry(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
if err = addRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
if err = addRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanRetryLoop(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
@@ -382,13 +472,19 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addTimeOffsetBuild(stack, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssumeRoleValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRole(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
if err = addRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
@@ -403,6 +499,18 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
404
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go
generated
vendored
404
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithSAML.go
generated
vendored
@@ -16,92 +16,132 @@ import (
|
||||
// mechanism for tying an enterprise identity store or directory to role-based
|
||||
// Amazon Web Services access without user-specific credentials or configuration.
|
||||
// For a comparison of AssumeRoleWithSAML with the other API operations that
|
||||
// produce temporary credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// in the IAM User Guide. The temporary security credentials returned by this
|
||||
// operation consist of an access key ID, a secret access key, and a security
|
||||
// token. Applications can use these temporary security credentials to sign calls
|
||||
// to Amazon Web Services services. Session Duration By default, the temporary
|
||||
// security credentials created by AssumeRoleWithSAML last for one hour. However,
|
||||
// you can use the optional DurationSeconds parameter to specify the duration of
|
||||
// your session. Your role session lasts for the duration that you specify, or
|
||||
// until the time specified in the SAML authentication response's
|
||||
// SessionNotOnOrAfter value, whichever is shorter. You can provide a
|
||||
// DurationSeconds value from 900 seconds (15 minutes) up to the maximum session
|
||||
// duration setting for the role. This setting can have a value from 1 hour to 12
|
||||
// hours. To learn how to view the maximum value for your role, see View the
|
||||
// Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// in the IAM User Guide. The maximum session duration limit applies when you use
|
||||
// the AssumeRole* API operations or the assume-role* CLI commands. However the
|
||||
// limit does not apply when you use those operations to create a console URL. For
|
||||
// more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
|
||||
// in the IAM User Guide. Role chaining (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining)
|
||||
// limits your CLI or Amazon Web Services API role session to a maximum of one
|
||||
// produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide.
|
||||
//
|
||||
// The temporary security credentials returned by this operation consist of an
|
||||
// access key ID, a secret access key, and a security token. Applications can use
|
||||
// these temporary security credentials to sign calls to Amazon Web Services
|
||||
// services.
|
||||
//
|
||||
// # Session Duration
|
||||
//
|
||||
// By default, the temporary security credentials created by AssumeRoleWithSAML
|
||||
// last for one hour. However, you can use the optional DurationSeconds parameter
|
||||
// to specify the duration of your session. Your role session lasts for the
|
||||
// duration that you specify, or until the time specified in the SAML
|
||||
// authentication response's SessionNotOnOrAfter value, whichever is shorter. You
|
||||
// can provide a DurationSeconds value from 900 seconds (15 minutes) up to the
|
||||
// maximum session duration setting for the role. This setting can have a value
|
||||
// from 1 hour to 12 hours. To learn how to view the maximum value for your role,
|
||||
// see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide. The maximum session duration limit applies when you
|
||||
// use the AssumeRole* API operations or the assume-role* CLI commands. However
|
||||
// the limit does not apply when you use those operations to create a console URL.
|
||||
// For more information, see [Using IAM Roles]in the IAM User Guide.
|
||||
//
|
||||
// [Role chaining]limits your CLI or Amazon Web Services API role session to a maximum of one
|
||||
// hour. When you use the AssumeRole API operation to assume a role, you can
|
||||
// specify the duration of your role session with the DurationSeconds parameter.
|
||||
// You can specify a parameter value of up to 43200 seconds (12 hours), depending
|
||||
// on the maximum session duration setting for your role. However, if you assume a
|
||||
// role using role chaining and provide a DurationSeconds parameter value greater
|
||||
// than one hour, the operation fails. Permissions The temporary security
|
||||
// credentials created by AssumeRoleWithSAML can be used to make API calls to any
|
||||
// Amazon Web Services service with the following exception: you cannot call the
|
||||
// STS GetFederationToken or GetSessionToken API operations. (Optional) You can
|
||||
// pass inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
|
||||
// use for both inline and managed session policies can't exceed 2,048 characters.
|
||||
// Passing policies to this operation returns new temporary credentials. The
|
||||
// resulting session's permissions are the intersection of the role's
|
||||
// identity-based policy and the session policies. You can use the role's temporary
|
||||
// credentials in subsequent Amazon Web Services API calls to access resources in
|
||||
// the account that owns the role. You cannot use session policies to grant more
|
||||
// permissions than those allowed by the identity-based policy of the role that is
|
||||
// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. Calling AssumeRoleWithSAML does not require the use of
|
||||
// Amazon Web Services security credentials. The identity of the caller is
|
||||
// validated by using keys in the metadata document that is uploaded for the SAML
|
||||
// provider entity for your identity provider. Calling AssumeRoleWithSAML can
|
||||
// result in an entry in your CloudTrail logs. The entry includes the value in the
|
||||
// NameID element of the SAML assertion. We recommend that you use a NameIDType
|
||||
// that is not associated with any personally identifiable information (PII). For
|
||||
// example, you could instead use the persistent identifier (
|
||||
// urn:oasis:names:tc:SAML:2.0:nameid-format:persistent ). Tags (Optional) You can
|
||||
// configure your IdP to pass attributes into your SAML assertion as session tags.
|
||||
// Each session tag consists of a key name and an associated value. For more
|
||||
// information about session tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. You can pass up to 50 session tags. The plaintext session
|
||||
// tag keys can’t exceed 128 characters and the values can’t exceed 256 characters.
|
||||
// For these and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
|
||||
// inline session policy, managed policy ARNs, and session tags into a packed
|
||||
// binary format that has a separate limit. Your request can fail for this limit
|
||||
// even if your plaintext meets the other requirements. The PackedPolicySize
|
||||
// response element indicates by percentage how close the policies and tags for
|
||||
// your request are to the upper size limit. You can pass a session tag with the
|
||||
// same key as a tag that is attached to the role. When you do, session tags
|
||||
// override the role's tags with the same key. An administrator must grant you the
|
||||
// permissions necessary to pass session tags. The administrator can also create
|
||||
// granular permissions to allow you to pass only specific session tags. For more
|
||||
// information, see Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// in the IAM User Guide. You can set the session tags as transitive. Transitive
|
||||
// tags persist during role chaining. For more information, see Chaining Roles
|
||||
// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// in the IAM User Guide. SAML Configuration Before your application can call
|
||||
// AssumeRoleWithSAML , you must configure your SAML identity provider (IdP) to
|
||||
// issue the claims required by Amazon Web Services. Additionally, you must use
|
||||
// Identity and Access Management (IAM) to create a SAML provider entity in your
|
||||
// Amazon Web Services account that represents your identity provider. You must
|
||||
// also create an IAM role that specifies this SAML provider in its trust policy.
|
||||
// than one hour, the operation fails.
|
||||
//
|
||||
// # Permissions
|
||||
//
|
||||
// The temporary security credentials created by AssumeRoleWithSAML can be used to
|
||||
// make API calls to any Amazon Web Services service with the following exception:
|
||||
// you cannot call the STS GetFederationToken or GetSessionToken API operations.
|
||||
//
|
||||
// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a
|
||||
// single JSON policy document to use as an inline session policy. You can also
|
||||
// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed
|
||||
// session policies. The plaintext that you use for both inline and managed session
|
||||
// policies can't exceed 2,048 characters. Passing policies to this operation
|
||||
// returns new temporary credentials. The resulting session's permissions are the
|
||||
// intersection of the role's identity-based policy and the session policies. You
|
||||
// can use the role's temporary credentials in subsequent Amazon Web Services API
|
||||
// calls to access resources in the account that owns the role. You cannot use
|
||||
// session policies to grant more permissions than those allowed by the
|
||||
// identity-based policy of the role that is being assumed. For more information,
|
||||
// see [Session Policies]in the IAM User Guide.
|
||||
//
|
||||
// Calling AssumeRoleWithSAML does not require the use of Amazon Web Services
|
||||
// security credentials. The identity of the caller is validated by using keys in
|
||||
// the metadata document that is uploaded for the SAML provider entity for your
|
||||
// identity provider.
|
||||
//
|
||||
// Calling AssumeRoleWithSAML can result in an entry in your CloudTrail logs. The
|
||||
// entry includes the value in the NameID element of the SAML assertion. We
|
||||
// recommend that you use a NameIDType that is not associated with any personally
|
||||
// identifiable information (PII). For example, you could instead use the
|
||||
// persistent identifier ( urn:oasis:names:tc:SAML:2.0:nameid-format:persistent ).
|
||||
//
|
||||
// # Tags
|
||||
//
|
||||
// (Optional) You can configure your IdP to pass attributes into your SAML
|
||||
// assertion as session tags. Each session tag consists of a key name and an
|
||||
// associated value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// You can pass up to 50 session tags. The plaintext session tag keys can’t exceed
|
||||
// 128 characters and the values can’t exceed 256 characters. For these and
|
||||
// additional limits, see [IAM and STS Character Limits]in the IAM User Guide.
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// You can pass a session tag with the same key as a tag that is attached to the
|
||||
// role. When you do, session tags override the role's tags with the same key.
|
||||
//
|
||||
// An administrator must grant you the permissions necessary to pass session tags.
|
||||
// The administrator can also create granular permissions to allow you to pass only
|
||||
// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide.
|
||||
//
|
||||
// You can set the session tags as transitive. Transitive tags persist during role
|
||||
// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide.
|
||||
//
|
||||
// # SAML Configuration
|
||||
//
|
||||
// Before your application can call AssumeRoleWithSAML , you must configure your
|
||||
// SAML identity provider (IdP) to issue the claims required by Amazon Web
|
||||
// Services. Additionally, you must use Identity and Access Management (IAM) to
|
||||
// create a SAML provider entity in your Amazon Web Services account that
|
||||
// represents your identity provider. You must also create an IAM role that
|
||||
// specifies this SAML provider in its trust policy.
|
||||
//
|
||||
// For more information, see the following resources:
|
||||
// - About SAML 2.0-based Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html)
|
||||
// in the IAM User Guide.
|
||||
// - Creating SAML Identity Providers (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html)
|
||||
// in the IAM User Guide.
|
||||
// - Configuring a Relying Party and Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html)
|
||||
// in the IAM User Guide.
|
||||
// - Creating a Role for SAML 2.0 Federation (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html)
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// [About SAML 2.0-based Federation]
|
||||
// - in the IAM User Guide.
|
||||
//
|
||||
// [Creating SAML Identity Providers]
|
||||
// - in the IAM User Guide.
|
||||
//
|
||||
// [Configuring a Relying Party and Claims]
|
||||
// - in the IAM User Guide.
|
||||
//
|
||||
// [Creating a Role for SAML 2.0 Federation]
|
||||
// - in the IAM User Guide.
|
||||
//
|
||||
// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
|
||||
// [Creating a Role for SAML 2.0 Federation]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-idp_saml.html
|
||||
// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
||||
// [Creating SAML Identity Providers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml.html
|
||||
// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
|
||||
// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html
|
||||
// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html
|
||||
// [Configuring a Relying Party and Claims]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_create_saml_relying-party.html
|
||||
// [Role chaining]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-role-chaining
|
||||
// [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
||||
// [About SAML 2.0-based Federation]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_saml.html
|
||||
// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining
|
||||
func (c *Client) AssumeRoleWithSAML(ctx context.Context, params *AssumeRoleWithSAMLInput, optFns ...func(*Options)) (*AssumeRoleWithSAMLOutput, error) {
|
||||
if params == nil {
|
||||
params = &AssumeRoleWithSAMLInput{}
|
||||
@@ -130,9 +170,11 @@ type AssumeRoleWithSAMLInput struct {
|
||||
// This member is required.
|
||||
RoleArn *string
|
||||
|
||||
// The base64 encoded SAML authentication response provided by the IdP. For more
|
||||
// information, see Configuring a Relying Party and Adding Claims (https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html)
|
||||
// in the IAM User Guide.
|
||||
// The base64 encoded SAML authentication response provided by the IdP.
|
||||
//
|
||||
// For more information, see [Configuring a Relying Party and Adding Claims] in the IAM User Guide.
|
||||
//
|
||||
// [Configuring a Relying Party and Adding Claims]: https://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html
|
||||
//
|
||||
// This member is required.
|
||||
SAMLAssertion *string
|
||||
@@ -146,92 +188,117 @@ type AssumeRoleWithSAMLInput struct {
|
||||
// than this setting, the operation fails. For example, if you specify a session
|
||||
// duration of 12 hours, but your administrator set the maximum session duration to
|
||||
// 6 hours, your operation fails. To learn how to view the maximum value for your
|
||||
// role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// in the IAM User Guide. By default, the value is set to 3600 seconds. The
|
||||
// DurationSeconds parameter is separate from the duration of a console session
|
||||
// that you might request using the returned credentials. The request to the
|
||||
// federation endpoint for a console sign-in token takes a SessionDuration
|
||||
// role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide.
|
||||
//
|
||||
// By default, the value is set to 3600 seconds.
|
||||
//
|
||||
// The DurationSeconds parameter is separate from the duration of a console
|
||||
// session that you might request using the returned credentials. The request to
|
||||
// the federation endpoint for a console sign-in token takes a SessionDuration
|
||||
// parameter that specifies the maximum length of the console session. For more
|
||||
// information, see Creating a URL that Enables Federated Users to Access the
|
||||
// Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||
// in the IAM User Guide.
|
||||
// information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide.
|
||||
//
|
||||
// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
|
||||
// [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
|
||||
DurationSeconds *int32
|
||||
|
||||
// An IAM policy in JSON format that you want to use as an inline session policy.
|
||||
//
|
||||
// This parameter is optional. Passing policies to this operation returns new
|
||||
// temporary credentials. The resulting session's permissions are the intersection
|
||||
// of the role's identity-based policy and the session policies. You can use the
|
||||
// role's temporary credentials in subsequent Amazon Web Services API calls to
|
||||
// access resources in the account that owns the role. You cannot use session
|
||||
// policies to grant more permissions than those allowed by the identity-based
|
||||
// policy of the role that is being assumed. For more information, see Session
|
||||
// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. The plaintext that you use for both inline and managed
|
||||
// session policies can't exceed 2,048 characters. The JSON policy characters can
|
||||
// be any ASCII character from the space character to the end of the valid
|
||||
// character list (\u0020 through \u00FF). It can also include the tab (\u0009),
|
||||
// linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web
|
||||
// Services conversion compresses the passed inline session policy, managed policy
|
||||
// ARNs, and session tags into a packed binary format that has a separate limit.
|
||||
// Your request can fail for this limit even if your plaintext meets the other
|
||||
// requirements. The PackedPolicySize response element indicates by percentage how
|
||||
// close the policies and tags for your request are to the upper size limit.
|
||||
// policy of the role that is being assumed. For more information, see [Session Policies]in the IAM
|
||||
// User Guide.
|
||||
//
|
||||
// The plaintext that you use for both inline and managed session policies can't
|
||||
// exceed 2,048 characters. The JSON policy characters can be any ASCII character
|
||||
// from the space character to the end of the valid character list (\u0020 through
|
||||
// \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage
|
||||
// return (\u000D) characters.
|
||||
//
|
||||
// For more information about role session permissions, see [Session policies].
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
Policy *string
|
||||
|
||||
// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
|
||||
// use as managed session policies. The policies must exist in the same account as
|
||||
// the role. This parameter is optional. You can provide up to 10 managed policy
|
||||
// ARNs. However, the plaintext that you use for both inline and managed session
|
||||
// policies can't exceed 2,048 characters. For more information about ARNs, see
|
||||
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
|
||||
// in the Amazon Web Services General Reference. An Amazon Web Services conversion
|
||||
// compresses the passed inline session policy, managed policy ARNs, and session
|
||||
// tags into a packed binary format that has a separate limit. Your request can
|
||||
// fail for this limit even if your plaintext meets the other requirements. The
|
||||
// PackedPolicySize response element indicates by percentage how close the policies
|
||||
// and tags for your request are to the upper size limit. Passing policies to this
|
||||
// operation returns new temporary credentials. The resulting session's permissions
|
||||
// are the intersection of the role's identity-based policy and the session
|
||||
// policies. You can use the role's temporary credentials in subsequent Amazon Web
|
||||
// Services API calls to access resources in the account that owns the role. You
|
||||
// cannot use session policies to grant more permissions than those allowed by the
|
||||
// identity-based policy of the role that is being assumed. For more information,
|
||||
// see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide.
|
||||
// the role.
|
||||
//
|
||||
// This parameter is optional. You can provide up to 10 managed policy ARNs.
|
||||
// However, the plaintext that you use for both inline and managed session policies
|
||||
// can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the
|
||||
// Amazon Web Services General Reference.
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// Passing policies to this operation returns new temporary credentials. The
|
||||
// resulting session's permissions are the intersection of the role's
|
||||
// identity-based policy and the session policies. You can use the role's temporary
|
||||
// credentials in subsequent Amazon Web Services API calls to access resources in
|
||||
// the account that owns the role. You cannot use session policies to grant more
|
||||
// permissions than those allowed by the identity-based policy of the role that is
|
||||
// being assumed. For more information, see [Session Policies]in the IAM User Guide.
|
||||
//
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
||||
PolicyArns []types.PolicyDescriptorType
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// Contains the response to a successful AssumeRoleWithSAML request, including
|
||||
// temporary Amazon Web Services credentials that can be used to make Amazon Web
|
||||
// Services requests.
|
||||
// Contains the response to a successful AssumeRoleWithSAML request, including temporary Amazon Web
|
||||
// Services credentials that can be used to make Amazon Web Services requests.
|
||||
type AssumeRoleWithSAMLOutput struct {
|
||||
|
||||
// The identifiers for the temporary security credentials that the operation
|
||||
// returns.
|
||||
AssumedRoleUser *types.AssumedRoleUser
|
||||
|
||||
// The value of the Recipient attribute of the SubjectConfirmationData element of
|
||||
// The value of the Recipient attribute of the SubjectConfirmationData element of
|
||||
// the SAML assertion.
|
||||
Audience *string
|
||||
|
||||
// The temporary security credentials, which include an access key ID, a secret
|
||||
// access key, and a security (or session) token. The size of the security token
|
||||
// that STS API operations return is not fixed. We strongly recommend that you make
|
||||
// no assumptions about the maximum size.
|
||||
// access key, and a security (or session) token.
|
||||
//
|
||||
// The size of the security token that STS API operations return is not fixed. We
|
||||
// strongly recommend that you make no assumptions about the maximum size.
|
||||
Credentials *types.Credentials
|
||||
|
||||
// The value of the Issuer element of the SAML assertion.
|
||||
Issuer *string
|
||||
|
||||
// A hash value based on the concatenation of the following:
|
||||
//
|
||||
// - The Issuer response value.
|
||||
//
|
||||
// - The Amazon Web Services account ID.
|
||||
//
|
||||
// - The friendly name (the last part of the ARN) of the SAML provider in IAM.
|
||||
//
|
||||
// The combination of NameQualifier and Subject can be used to uniquely identify a
|
||||
// user. The following pseudocode shows how the hash value is calculated: BASE64 (
|
||||
// SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) )
|
||||
// user.
|
||||
//
|
||||
// The following pseudocode shows how the hash value is calculated:
|
||||
//
|
||||
// BASE64 ( SHA1 ( "https://example.com/saml" + "123456789012" + "/MySAMLIdP" ) )
|
||||
NameQualifier *string
|
||||
|
||||
// A percentage value that indicates the packed size of the session policies and
|
||||
@@ -240,31 +307,37 @@ type AssumeRoleWithSAMLOutput struct {
|
||||
// allowed space.
|
||||
PackedPolicySize *int32
|
||||
|
||||
// The value in the SourceIdentity attribute in the SAML assertion. You can
|
||||
// require users to set a source identity value when they assume a role. You do
|
||||
// this by using the sts:SourceIdentity condition key in a role trust policy. That
|
||||
// way, actions that are taken with the role are associated with that user. After
|
||||
// the source identity is set, the value cannot be changed. It is present in the
|
||||
// request for all actions that are taken by the role and persists across chained
|
||||
// role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining)
|
||||
// sessions. You can configure your SAML identity provider to use an attribute
|
||||
// associated with your users, like user name or email, as the source identity when
|
||||
// calling AssumeRoleWithSAML . You do this by adding an attribute to the SAML
|
||||
// assertion. For more information about using source identity, see Monitor and
|
||||
// control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// in the IAM User Guide. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
// =,.@-
|
||||
// The value in the SourceIdentity attribute in the SAML assertion. The source
|
||||
// identity value persists across [chained role]sessions.
|
||||
//
|
||||
// You can require users to set a source identity value when they assume a role.
|
||||
// You do this by using the sts:SourceIdentity condition key in a role trust
|
||||
// policy. That way, actions that are taken with the role are associated with that
|
||||
// user. After the source identity is set, the value cannot be changed. It is
|
||||
// present in the request for all actions that are taken by the role and persists
|
||||
// across [chained role]sessions. You can configure your SAML identity provider to use an
|
||||
// attribute associated with your users, like user name or email, as the source
|
||||
// identity when calling AssumeRoleWithSAML . You do this by adding an attribute to
|
||||
// the SAML assertion. For more information about using source identity, see [Monitor and control actions taken with assumed roles]in
|
||||
// the IAM User Guide.
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: =,.@-
|
||||
//
|
||||
// [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts
|
||||
// [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
|
||||
SourceIdentity *string
|
||||
|
||||
// The value of the NameID element in the Subject element of the SAML assertion.
|
||||
Subject *string
|
||||
|
||||
// The format of the name ID, as defined by the Format attribute in the NameID
|
||||
// The format of the name ID, as defined by the Format attribute in the NameID
|
||||
// element of the SAML assertion. Typical examples of the format are transient or
|
||||
// persistent . If the format includes the prefix
|
||||
// urn:oasis:names:tc:SAML:2.0:nameid-format , that prefix is removed. For example,
|
||||
// persistent .
|
||||
//
|
||||
// If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format ,
|
||||
// that prefix is removed. For example,
|
||||
// urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient .
|
||||
// If the format includes any other prefix, the format is returned with no
|
||||
// modifications.
|
||||
@@ -298,22 +371,25 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
|
||||
if err = addClientRequestID(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
|
||||
if err = addComputeContentLength(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResolveEndpointMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
if err = addRetry(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
if err = addRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
if err = addRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanRetryLoop(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
@@ -328,13 +404,19 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addTimeOffsetBuild(stack, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssumeRoleWithSAMLValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithSAML(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
if err = addRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
@@ -349,6 +431,18 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
435
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go
generated
vendored
435
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoleWithWebIdentity.go
generated
vendored
@@ -14,105 +14,132 @@ import (
|
||||
// Returns a set of temporary security credentials for users who have been
|
||||
// authenticated in a mobile or web application with a web identity provider.
|
||||
// Example providers include the OAuth 2.0 providers Login with Amazon and
|
||||
// Facebook, or any OpenID Connect-compatible identity provider such as Google or
|
||||
// Amazon Cognito federated identities (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html)
|
||||
// . For mobile applications, we recommend that you use Amazon Cognito. You can use
|
||||
// Amazon Cognito with the Amazon Web Services SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/)
|
||||
// and the Amazon Web Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/)
|
||||
// to uniquely identify a user. You can also supply the user with a consistent
|
||||
// identity throughout the lifetime of an application. To learn more about Amazon
|
||||
// Cognito, see Amazon Cognito identity pools (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html)
|
||||
// in Amazon Cognito Developer Guide. Calling AssumeRoleWithWebIdentity does not
|
||||
// require the use of Amazon Web Services security credentials. Therefore, you can
|
||||
// distribute an application (for example, on mobile devices) that requests
|
||||
// temporary security credentials without including long-term Amazon Web Services
|
||||
// credentials in the application. You also don't need to deploy server-based proxy
|
||||
// services that use long-term Amazon Web Services credentials. Instead, the
|
||||
// identity of the caller is validated by using a token from the web identity
|
||||
// provider. For a comparison of AssumeRoleWithWebIdentity with the other API
|
||||
// operations that produce temporary credentials, see Requesting Temporary
|
||||
// Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// in the IAM User Guide. The temporary security credentials returned by this API
|
||||
// consist of an access key ID, a secret access key, and a security token.
|
||||
// Applications can use these temporary security credentials to sign calls to
|
||||
// Amazon Web Services service API operations. Session Duration By default, the
|
||||
// temporary security credentials created by AssumeRoleWithWebIdentity last for
|
||||
// one hour. However, you can use the optional DurationSeconds parameter to
|
||||
// specify the duration of your session. You can provide a value from 900 seconds
|
||||
// (15 minutes) up to the maximum session duration setting for the role. This
|
||||
// setting can have a value from 1 hour to 12 hours. To learn how to view the
|
||||
// maximum value for your role, see View the Maximum Session Duration Setting for
|
||||
// a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// in the IAM User Guide. The maximum session duration limit applies when you use
|
||||
// the AssumeRole* API operations or the assume-role* CLI commands. However the
|
||||
// limit does not apply when you use those operations to create a console URL. For
|
||||
// more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html)
|
||||
// in the IAM User Guide. Permissions The temporary security credentials created by
|
||||
// AssumeRoleWithWebIdentity can be used to make API calls to any Amazon Web
|
||||
// Services service with the following exception: you cannot call the STS
|
||||
// GetFederationToken or GetSessionToken API operations. (Optional) You can pass
|
||||
// inline or managed session policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
|
||||
// use for both inline and managed session policies can't exceed 2,048 characters.
|
||||
// Passing policies to this operation returns new temporary credentials. The
|
||||
// resulting session's permissions are the intersection of the role's
|
||||
// identity-based policy and the session policies. You can use the role's temporary
|
||||
// credentials in subsequent Amazon Web Services API calls to access resources in
|
||||
// the account that owns the role. You cannot use session policies to grant more
|
||||
// permissions than those allowed by the identity-based policy of the role that is
|
||||
// being assumed. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. Tags (Optional) You can configure your IdP to pass
|
||||
// attributes into your web identity token as session tags. Each session tag
|
||||
// consists of a key name and an associated value. For more information about
|
||||
// session tags, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. You can pass up to 50 session tags. The plaintext session
|
||||
// tag keys can’t exceed 128 characters and the values can’t exceed 256 characters.
|
||||
// For these and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
|
||||
// inline session policy, managed policy ARNs, and session tags into a packed
|
||||
// binary format that has a separate limit. Your request can fail for this limit
|
||||
// even if your plaintext meets the other requirements. The PackedPolicySize
|
||||
// response element indicates by percentage how close the policies and tags for
|
||||
// your request are to the upper size limit. You can pass a session tag with the
|
||||
// same key as a tag that is attached to the role. When you do, the session tag
|
||||
// overrides the role tag with the same key. An administrator must grant you the
|
||||
// permissions necessary to pass session tags. The administrator can also create
|
||||
// granular permissions to allow you to pass only specific session tags. For more
|
||||
// information, see Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// in the IAM User Guide. You can set the session tags as transitive. Transitive
|
||||
// tags persist during role chaining. For more information, see Chaining Roles
|
||||
// with Session Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining)
|
||||
// in the IAM User Guide. Identities Before your application can call
|
||||
// AssumeRoleWithWebIdentity , you must have an identity token from a supported
|
||||
// identity provider and create a role that the application can assume. The role
|
||||
// that your application assumes must trust the identity provider that is
|
||||
// associated with the identity token. In other words, the identity provider must
|
||||
// be specified in the role's trust policy. Calling AssumeRoleWithWebIdentity can
|
||||
// result in an entry in your CloudTrail logs. The entry includes the Subject (http://openid.net/specs/openid-connect-core-1_0.html#Claims)
|
||||
// of the provided web identity token. We recommend that you avoid using any
|
||||
// personally identifiable information (PII) in this field. For example, you could
|
||||
// instead use a GUID or a pairwise identifier, as suggested in the OIDC
|
||||
// specification (http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes)
|
||||
// . For more information about how to use web identity federation and the
|
||||
// Facebook, or any OpenID Connect-compatible identity provider such as Google or [Amazon Cognito federated identities].
|
||||
//
|
||||
// For mobile applications, we recommend that you use Amazon Cognito. You can use
|
||||
// Amazon Cognito with the [Amazon Web Services SDK for iOS Developer Guide]and the [Amazon Web Services SDK for Android Developer Guide] to uniquely identify a user. You can also
|
||||
// supply the user with a consistent identity throughout the lifetime of an
|
||||
// application.
|
||||
//
|
||||
// To learn more about Amazon Cognito, see [Amazon Cognito identity pools] in Amazon Cognito Developer Guide.
|
||||
//
|
||||
// Calling AssumeRoleWithWebIdentity does not require the use of Amazon Web
|
||||
// Services security credentials. Therefore, you can distribute an application (for
|
||||
// example, on mobile devices) that requests temporary security credentials without
|
||||
// including long-term Amazon Web Services credentials in the application. You also
|
||||
// don't need to deploy server-based proxy services that use long-term Amazon Web
|
||||
// Services credentials. Instead, the identity of the caller is validated by using
|
||||
// a token from the web identity provider. For a comparison of
|
||||
// AssumeRoleWithWebIdentity with the other API operations that produce temporary
|
||||
// credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide.
|
||||
//
|
||||
// The temporary security credentials returned by this API consist of an access
|
||||
// key ID, a secret access key, and a security token. Applications can use these
|
||||
// temporary security credentials to sign calls to Amazon Web Services service API
|
||||
// operations.
|
||||
//
|
||||
// # Session Duration
|
||||
//
|
||||
// By default, the temporary security credentials created by
|
||||
// AssumeRoleWithWebIdentity last for one hour. However, you can use the optional
|
||||
// DurationSeconds parameter to specify the duration of your session. You can
|
||||
// provide a value from 900 seconds (15 minutes) up to the maximum session duration
|
||||
// setting for the role. This setting can have a value from 1 hour to 12 hours. To
|
||||
// learn how to view the maximum value for your role, see [Update the maximum session duration for a role]in the IAM User Guide.
|
||||
// The maximum session duration limit applies when you use the AssumeRole* API
|
||||
// operations or the assume-role* CLI commands. However the limit does not apply
|
||||
// when you use those operations to create a console URL. For more information, see
|
||||
// [Using IAM Roles]in the IAM User Guide.
|
||||
//
|
||||
// # Permissions
|
||||
//
|
||||
// The temporary security credentials created by AssumeRoleWithWebIdentity can be
|
||||
// used to make API calls to any Amazon Web Services service with the following
|
||||
// exception: you cannot call the STS GetFederationToken or GetSessionToken API
|
||||
// operations.
|
||||
//
|
||||
// (Optional) You can pass inline or managed [session policies] to this operation. You can pass a
|
||||
// single JSON policy document to use as an inline session policy. You can also
|
||||
// specify up to 10 managed policy Amazon Resource Names (ARNs) to use as managed
|
||||
// session policies. The plaintext that you use for both inline and managed session
|
||||
// policies can't exceed 2,048 characters. Passing policies to this operation
|
||||
// returns new temporary credentials. The resulting session's permissions are the
|
||||
// intersection of the role's identity-based policy and the session policies. You
|
||||
// can use the role's temporary credentials in subsequent Amazon Web Services API
|
||||
// calls to access resources in the account that owns the role. You cannot use
|
||||
// session policies to grant more permissions than those allowed by the
|
||||
// identity-based policy of the role that is being assumed. For more information,
|
||||
// see [Session Policies]in the IAM User Guide.
|
||||
//
|
||||
// # Tags
|
||||
//
|
||||
// (Optional) You can configure your IdP to pass attributes into your web identity
|
||||
// token as session tags. Each session tag consists of a key name and an associated
|
||||
// value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User Guide.
|
||||
//
|
||||
// You can pass up to 50 session tags. The plaintext session tag keys can’t exceed
|
||||
// 128 characters and the values can’t exceed 256 characters. For these and
|
||||
// additional limits, see [IAM and STS Character Limits]in the IAM User Guide.
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// You can pass a session tag with the same key as a tag that is attached to the
|
||||
// role. When you do, the session tag overrides the role tag with the same key.
|
||||
//
|
||||
// An administrator must grant you the permissions necessary to pass session tags.
|
||||
// The administrator can also create granular permissions to allow you to pass only
|
||||
// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide.
|
||||
//
|
||||
// You can set the session tags as transitive. Transitive tags persist during role
|
||||
// chaining. For more information, see [Chaining Roles with Session Tags]in the IAM User Guide.
|
||||
//
|
||||
// # Identities
|
||||
//
|
||||
// Before your application can call AssumeRoleWithWebIdentity , you must have an
|
||||
// identity token from a supported identity provider and create a role that the
|
||||
// application can assume. The role that your application assumes must trust the
|
||||
// identity provider that is associated with the identity token. In other words,
|
||||
// the identity provider must be specified in the role's trust policy.
|
||||
//
|
||||
// Calling AssumeRoleWithWebIdentity can result in an entry in your CloudTrail
|
||||
// logs. The entry includes the [Subject]of the provided web identity token. We recommend
|
||||
// that you avoid using any personally identifiable information (PII) in this
|
||||
// field. For example, you could instead use a GUID or a pairwise identifier, as [suggested in the OIDC specification].
|
||||
//
|
||||
// For more information about how to use OIDC federation and the
|
||||
// AssumeRoleWithWebIdentity API, see the following resources:
|
||||
// - Using Web Identity Federation API Operations for Mobile Apps (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html)
|
||||
// and Federation Through a Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
|
||||
// .
|
||||
// - Web Identity Federation Playground (https://aws.amazon.com/blogs/aws/the-aws-web-identity-federation-playground/)
|
||||
// . Walk through the process of authenticating through Login with Amazon,
|
||||
// Facebook, or Google, getting temporary security credentials, and then using
|
||||
// those credentials to make a request to Amazon Web Services.
|
||||
// - Amazon Web Services SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/)
|
||||
// and Amazon Web Services SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/)
|
||||
// . These toolkits contain sample apps that show how to invoke the identity
|
||||
// providers. The toolkits then show how to use the information from these
|
||||
//
|
||||
// [Using Web Identity Federation API Operations for Mobile Apps]
|
||||
// - and [Federation Through a Web-based Identity Provider].
|
||||
//
|
||||
// [Amazon Web Services SDK for iOS Developer Guide]
|
||||
// - and [Amazon Web Services SDK for Android Developer Guide]. These toolkits contain sample apps that show how to invoke the
|
||||
// identity providers. The toolkits then show how to use the information from these
|
||||
// providers to get and use temporary security credentials.
|
||||
// - Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications)
|
||||
// . This article discusses web identity federation and shows an example of how to
|
||||
// use web identity federation to get access to content in Amazon S3.
|
||||
//
|
||||
// [Amazon Web Services SDK for iOS Developer Guide]: http://aws.amazon.com/sdkforios/
|
||||
// [Amazon Web Services SDK for Android Developer Guide]: http://aws.amazon.com/sdkforandroid/
|
||||
// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
||||
// [session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
|
||||
// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html
|
||||
// [Subject]: http://openid.net/specs/openid-connect-core-1_0.html#Claims
|
||||
// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html
|
||||
// [Amazon Cognito identity pools]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html
|
||||
// [Federation Through a Web-based Identity Provider]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity
|
||||
// [Using IAM Roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Amazon Cognito federated identities]: https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-identity.html
|
||||
// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
||||
// [Chaining Roles with Session Tags]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining
|
||||
// [Update the maximum session duration for a role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_update-role-settings.html#id_roles_update-session-duration
|
||||
// [Using Web Identity Federation API Operations for Mobile Apps]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_oidc_manual.html
|
||||
// [suggested in the OIDC specification]: http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes
|
||||
func (c *Client) AssumeRoleWithWebIdentity(ctx context.Context, params *AssumeRoleWithWebIdentityInput, optFns ...func(*Options)) (*AssumeRoleWithWebIdentityOutput, error) {
|
||||
if params == nil {
|
||||
params = &AssumeRoleWithWebIdentityInput{}
|
||||
@@ -132,6 +159,17 @@ type AssumeRoleWithWebIdentityInput struct {
|
||||
|
||||
// The Amazon Resource Name (ARN) of the role that the caller is assuming.
|
||||
//
|
||||
// Additional considerations apply to Amazon Cognito identity pools that assume [cross-account IAM roles].
|
||||
// The trust policies of these roles must accept the cognito-identity.amazonaws.com
|
||||
// service principal and must contain the cognito-identity.amazonaws.com:aud
|
||||
// condition key to restrict role assumption to users from your intended identity
|
||||
// pools. A policy that trusts Amazon Cognito identity pools without this condition
|
||||
// creates a risk that a user from an unintended identity pool can assume the role.
|
||||
// For more information, see [Trust policies for IAM roles in Basic (Classic) authentication]in the Amazon Cognito Developer Guide.
|
||||
//
|
||||
// [cross-account IAM roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies-cross-account-resource-access.html
|
||||
// [Trust policies for IAM roles in Basic (Classic) authentication]: https://docs.aws.amazon.com/cognito/latest/developerguide/iam-roles.html#trust-policies
|
||||
//
|
||||
// This member is required.
|
||||
RoleArn *string
|
||||
|
||||
@@ -139,10 +177,19 @@ type AssumeRoleWithWebIdentityInput struct {
|
||||
// identifier that is associated with the user who is using your application. That
|
||||
// way, the temporary security credentials that your application will use are
|
||||
// associated with that user. This session name is included as part of the ARN and
|
||||
// assumed role ID in the AssumedRoleUser response element. The regex used to
|
||||
// validate this parameter is a string of characters consisting of upper- and
|
||||
// lower-case alphanumeric characters with no spaces. You can also include
|
||||
// underscores or any of the following characters: =,.@-
|
||||
// assumed role ID in the AssumedRoleUser response element.
|
||||
//
|
||||
// For security purposes, administrators can view this field in [CloudTrail logs] to help identify
|
||||
// who performed an action in Amazon Web Services. Your administrator might require
|
||||
// that you specify your user name as the session name when you assume the role.
|
||||
// For more information, see [sts:RoleSessionName]sts:RoleSessionName .
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: =,.@-
|
||||
//
|
||||
// [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html#cloudtrail-integration_signin-tempcreds
|
||||
// [sts:RoleSessionName]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_iam-condition-keys.html#ck_rolesessionname
|
||||
//
|
||||
// This member is required.
|
||||
RoleSessionName *string
|
||||
@@ -150,8 +197,10 @@ type AssumeRoleWithWebIdentityInput struct {
|
||||
// The OAuth 2.0 access token or OpenID Connect ID token that is provided by the
|
||||
// identity provider. Your application must get this token by authenticating the
|
||||
// user who is using your application with a web identity provider before the
|
||||
// application makes an AssumeRoleWithWebIdentity call. Only tokens with RSA
|
||||
// algorithms (RS256) are supported.
|
||||
// application makes an AssumeRoleWithWebIdentity call. Timestamps in the token
|
||||
// must be formatted as either an integer or a long integer. Tokens must be signed
|
||||
// using either RSA keys (RS256, RS384, or RS512) or ECDSA keys (ES256, ES384, or
|
||||
// ES512).
|
||||
//
|
||||
// This member is required.
|
||||
WebIdentityToken *string
|
||||
@@ -162,73 +211,93 @@ type AssumeRoleWithWebIdentityInput struct {
|
||||
// higher than this setting, the operation fails. For example, if you specify a
|
||||
// session duration of 12 hours, but your administrator set the maximum session
|
||||
// duration to 6 hours, your operation fails. To learn how to view the maximum
|
||||
// value for your role, see View the Maximum Session Duration Setting for a Role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session)
|
||||
// in the IAM User Guide. By default, the value is set to 3600 seconds. The
|
||||
// DurationSeconds parameter is separate from the duration of a console session
|
||||
// that you might request using the returned credentials. The request to the
|
||||
// federation endpoint for a console sign-in token takes a SessionDuration
|
||||
// value for your role, see [View the Maximum Session Duration Setting for a Role]in the IAM User Guide.
|
||||
//
|
||||
// By default, the value is set to 3600 seconds.
|
||||
//
|
||||
// The DurationSeconds parameter is separate from the duration of a console
|
||||
// session that you might request using the returned credentials. The request to
|
||||
// the federation endpoint for a console sign-in token takes a SessionDuration
|
||||
// parameter that specifies the maximum length of the console session. For more
|
||||
// information, see Creating a URL that Enables Federated Users to Access the
|
||||
// Amazon Web Services Management Console (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html)
|
||||
// in the IAM User Guide.
|
||||
// information, see [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]in the IAM User Guide.
|
||||
//
|
||||
// [View the Maximum Session Duration Setting for a Role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html#id_roles_use_view-role-max-session
|
||||
// [Creating a URL that Enables Federated Users to Access the Amazon Web Services Management Console]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
|
||||
DurationSeconds *int32
|
||||
|
||||
// An IAM policy in JSON format that you want to use as an inline session policy.
|
||||
//
|
||||
// This parameter is optional. Passing policies to this operation returns new
|
||||
// temporary credentials. The resulting session's permissions are the intersection
|
||||
// of the role's identity-based policy and the session policies. You can use the
|
||||
// role's temporary credentials in subsequent Amazon Web Services API calls to
|
||||
// access resources in the account that owns the role. You cannot use session
|
||||
// policies to grant more permissions than those allowed by the identity-based
|
||||
// policy of the role that is being assumed. For more information, see Session
|
||||
// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. The plaintext that you use for both inline and managed
|
||||
// session policies can't exceed 2,048 characters. The JSON policy characters can
|
||||
// be any ASCII character from the space character to the end of the valid
|
||||
// character list (\u0020 through \u00FF). It can also include the tab (\u0009),
|
||||
// linefeed (\u000A), and carriage return (\u000D) characters. An Amazon Web
|
||||
// Services conversion compresses the passed inline session policy, managed policy
|
||||
// ARNs, and session tags into a packed binary format that has a separate limit.
|
||||
// Your request can fail for this limit even if your plaintext meets the other
|
||||
// requirements. The PackedPolicySize response element indicates by percentage how
|
||||
// close the policies and tags for your request are to the upper size limit.
|
||||
// policy of the role that is being assumed. For more information, see [Session Policies]in the IAM
|
||||
// User Guide.
|
||||
//
|
||||
// The plaintext that you use for both inline and managed session policies can't
|
||||
// exceed 2,048 characters. The JSON policy characters can be any ASCII character
|
||||
// from the space character to the end of the valid character list (\u0020 through
|
||||
// \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage
|
||||
// return (\u000D) characters.
|
||||
//
|
||||
// For more information about role session permissions, see [Session policies].
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Session policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
Policy *string
|
||||
|
||||
// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
|
||||
// use as managed session policies. The policies must exist in the same account as
|
||||
// the role. This parameter is optional. You can provide up to 10 managed policy
|
||||
// ARNs. However, the plaintext that you use for both inline and managed session
|
||||
// policies can't exceed 2,048 characters. For more information about ARNs, see
|
||||
// Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
|
||||
// in the Amazon Web Services General Reference. An Amazon Web Services conversion
|
||||
// compresses the passed inline session policy, managed policy ARNs, and session
|
||||
// tags into a packed binary format that has a separate limit. Your request can
|
||||
// fail for this limit even if your plaintext meets the other requirements. The
|
||||
// PackedPolicySize response element indicates by percentage how close the policies
|
||||
// and tags for your request are to the upper size limit. Passing policies to this
|
||||
// operation returns new temporary credentials. The resulting session's permissions
|
||||
// are the intersection of the role's identity-based policy and the session
|
||||
// policies. You can use the role's temporary credentials in subsequent Amazon Web
|
||||
// Services API calls to access resources in the account that owns the role. You
|
||||
// cannot use session policies to grant more permissions than those allowed by the
|
||||
// identity-based policy of the role that is being assumed. For more information,
|
||||
// see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide.
|
||||
// the role.
|
||||
//
|
||||
// This parameter is optional. You can provide up to 10 managed policy ARNs.
|
||||
// However, the plaintext that you use for both inline and managed session policies
|
||||
// can't exceed 2,048 characters. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the
|
||||
// Amazon Web Services General Reference.
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// Passing policies to this operation returns new temporary credentials. The
|
||||
// resulting session's permissions are the intersection of the role's
|
||||
// identity-based policy and the session policies. You can use the role's temporary
|
||||
// credentials in subsequent Amazon Web Services API calls to access resources in
|
||||
// the account that owns the role. You cannot use session policies to grant more
|
||||
// permissions than those allowed by the identity-based policy of the role that is
|
||||
// being assumed. For more information, see [Session Policies]in the IAM User Guide.
|
||||
//
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
||||
PolicyArns []types.PolicyDescriptorType
|
||||
|
||||
// The fully qualified host component of the domain name of the OAuth 2.0 identity
|
||||
// provider. Do not specify this value for an OpenID Connect identity provider.
|
||||
//
|
||||
// Currently www.amazon.com and graph.facebook.com are the only supported identity
|
||||
// providers for OAuth 2.0 access tokens. Do not include URL schemes and port
|
||||
// numbers. Do not specify this value for OpenID Connect ID tokens.
|
||||
// numbers.
|
||||
//
|
||||
// Do not specify this value for OpenID Connect ID tokens.
|
||||
ProviderId *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// Contains the response to a successful AssumeRoleWithWebIdentity request,
|
||||
// including temporary Amazon Web Services credentials that can be used to make
|
||||
// Amazon Web Services requests.
|
||||
// Contains the response to a successful AssumeRoleWithWebIdentity request, including temporary Amazon Web
|
||||
// Services credentials that can be used to make Amazon Web Services requests.
|
||||
type AssumeRoleWithWebIdentityOutput struct {
|
||||
|
||||
// The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers
|
||||
@@ -244,9 +313,10 @@ type AssumeRoleWithWebIdentityOutput struct {
|
||||
Audience *string
|
||||
|
||||
// The temporary security credentials, which include an access key ID, a secret
|
||||
// access key, and a security token. The size of the security token that STS API
|
||||
// operations return is not fixed. We strongly recommend that you make no
|
||||
// assumptions about the maximum size.
|
||||
// access key, and a security token.
|
||||
//
|
||||
// The size of the security token that STS API operations return is not fixed. We
|
||||
// strongly recommend that you make no assumptions about the maximum size.
|
||||
Credentials *types.Credentials
|
||||
|
||||
// A percentage value that indicates the packed size of the session policies and
|
||||
@@ -255,30 +325,34 @@ type AssumeRoleWithWebIdentityOutput struct {
|
||||
// allowed space.
|
||||
PackedPolicySize *int32
|
||||
|
||||
// The issuing authority of the web identity token presented. For OpenID Connect
|
||||
// The issuing authority of the web identity token presented. For OpenID Connect
|
||||
// ID tokens, this contains the value of the iss field. For OAuth 2.0 access
|
||||
// tokens, this contains the value of the ProviderId parameter that was passed in
|
||||
// the AssumeRoleWithWebIdentity request.
|
||||
Provider *string
|
||||
|
||||
// The value of the source identity that is returned in the JSON web token (JWT)
|
||||
// from the identity provider. You can require users to set a source identity value
|
||||
// when they assume a role. You do this by using the sts:SourceIdentity condition
|
||||
// key in a role trust policy. That way, actions that are taken with the role are
|
||||
// associated with that user. After the source identity is set, the value cannot be
|
||||
// changed. It is present in the request for all actions that are taken by the role
|
||||
// and persists across chained role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts#iam-term-role-chaining)
|
||||
// sessions. You can configure your identity provider to use an attribute
|
||||
// from the identity provider.
|
||||
//
|
||||
// You can require users to set a source identity value when they assume a role.
|
||||
// You do this by using the sts:SourceIdentity condition key in a role trust
|
||||
// policy. That way, actions that are taken with the role are associated with that
|
||||
// user. After the source identity is set, the value cannot be changed. It is
|
||||
// present in the request for all actions that are taken by the role and persists
|
||||
// across [chained role]sessions. You can configure your identity provider to use an attribute
|
||||
// associated with your users, like user name or email, as the source identity when
|
||||
// calling AssumeRoleWithWebIdentity . You do this by adding a claim to the JSON
|
||||
// web token. To learn more about OIDC tokens and claims, see Using Tokens with
|
||||
// User Pools (https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html)
|
||||
// in the Amazon Cognito Developer Guide. For more information about using source
|
||||
// identity, see Monitor and control actions taken with assumed roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html)
|
||||
// in the IAM User Guide. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
// =,.@-
|
||||
// web token. To learn more about OIDC tokens and claims, see [Using Tokens with User Pools]in the Amazon
|
||||
// Cognito Developer Guide. For more information about using source identity, see [Monitor and control actions taken with assumed roles]
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: =,.@-
|
||||
//
|
||||
// [chained role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html#id_roles_terms-and-concepts
|
||||
// [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
|
||||
// [Using Tokens with User Pools]: https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-with-identity-providers.html
|
||||
SourceIdentity *string
|
||||
|
||||
// The unique user identifier that is returned by the identity provider. This
|
||||
@@ -317,22 +391,25 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
|
||||
if err = addClientRequestID(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
|
||||
if err = addComputeContentLength(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResolveEndpointMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
if err = addRetry(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
if err = addRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
if err = addRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanRetryLoop(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
@@ -347,13 +424,19 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addTimeOffsetBuild(stack, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssumeRoleWithWebIdentityValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoleWithWebIdentity(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
if err = addRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
@@ -368,6 +451,18 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
220
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go
generated
vendored
Normal file
220
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_AssumeRoot.go
generated
vendored
Normal file
@@ -0,0 +1,220 @@
|
||||
// Code generated by smithy-go-codegen DO NOT EDIT.
|
||||
|
||||
package sts
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
// Returns a set of short term credentials you can use to perform privileged tasks
|
||||
// on a member account in your organization.
|
||||
//
|
||||
// Before you can launch a privileged session, you must have centralized root
|
||||
// access in your organization. For steps to enable this feature, see [Centralize root access for member accounts]in the IAM
|
||||
// User Guide.
|
||||
//
|
||||
// The STS global endpoint is not supported for AssumeRoot. You must send this
|
||||
// request to a Regional STS endpoint. For more information, see [Endpoints].
|
||||
//
|
||||
// You can track AssumeRoot in CloudTrail logs to determine what actions were
|
||||
// performed in a session. For more information, see [Track privileged tasks in CloudTrail]in the IAM User Guide.
|
||||
//
|
||||
// [Endpoints]: https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html#sts-endpoints
|
||||
// [Track privileged tasks in CloudTrail]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-track-privileged-tasks.html
|
||||
// [Centralize root access for member accounts]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_root-enable-root-access.html
|
||||
func (c *Client) AssumeRoot(ctx context.Context, params *AssumeRootInput, optFns ...func(*Options)) (*AssumeRootOutput, error) {
|
||||
if params == nil {
|
||||
params = &AssumeRootInput{}
|
||||
}
|
||||
|
||||
result, metadata, err := c.invokeOperation(ctx, "AssumeRoot", params, optFns, c.addOperationAssumeRootMiddlewares)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
out := result.(*AssumeRootOutput)
|
||||
out.ResultMetadata = metadata
|
||||
return out, nil
|
||||
}
|
||||
|
||||
type AssumeRootInput struct {
|
||||
|
||||
// The member account principal ARN or account ID.
|
||||
//
|
||||
// This member is required.
|
||||
TargetPrincipal *string
|
||||
|
||||
// The identity based policy that scopes the session to the privileged tasks that
|
||||
// can be performed. You can use one of following Amazon Web Services managed
|
||||
// policies to scope root session actions.
|
||||
//
|
||||
// [IAMAuditRootUserCredentials]
|
||||
//
|
||||
// [IAMCreateRootUserPassword]
|
||||
//
|
||||
// [IAMDeleteRootUserCredentials]
|
||||
//
|
||||
// [S3UnlockBucketPolicy]
|
||||
//
|
||||
// [SQSUnlockQueuePolicy]
|
||||
//
|
||||
// [IAMDeleteRootUserCredentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMDeleteRootUserCredentials
|
||||
// [IAMCreateRootUserPassword]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMCreateRootUserPassword
|
||||
// [IAMAuditRootUserCredentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-IAMAuditRootUserCredentials
|
||||
// [S3UnlockBucketPolicy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-S3UnlockBucketPolicy
|
||||
// [SQSUnlockQueuePolicy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/security-iam-awsmanpol.html#security-iam-awsmanpol-SQSUnlockQueuePolicy
|
||||
//
|
||||
// This member is required.
|
||||
TaskPolicyArn *types.PolicyDescriptorType
|
||||
|
||||
// The duration, in seconds, of the privileged session. The value can range from 0
|
||||
// seconds up to the maximum session duration of 900 seconds (15 minutes). If you
|
||||
// specify a value higher than this setting, the operation fails.
|
||||
//
|
||||
// By default, the value is set to 900 seconds.
|
||||
DurationSeconds *int32
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
type AssumeRootOutput struct {
|
||||
|
||||
// The temporary security credentials, which include an access key ID, a secret
|
||||
// access key, and a security token.
|
||||
//
|
||||
// The size of the security token that STS API operations return is not fixed. We
|
||||
// strongly recommend that you make no assumptions about the maximum size.
|
||||
Credentials *types.Credentials
|
||||
|
||||
// The source identity specified by the principal that is calling the AssumeRoot
|
||||
// operation.
|
||||
//
|
||||
// You can use the aws:SourceIdentity condition key to control access based on the
|
||||
// value of source identity. For more information about using source identity, see [Monitor and control actions taken with assumed roles]
|
||||
// in the IAM User Guide.
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: =,.@-
|
||||
//
|
||||
// [Monitor and control actions taken with assumed roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_monitor.html
|
||||
SourceIdentity *string
|
||||
|
||||
// Metadata pertaining to the operation's result.
|
||||
ResultMetadata middleware.Metadata
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
func (c *Client) addOperationAssumeRootMiddlewares(stack *middleware.Stack, options Options) (err error) {
|
||||
if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Serialize.Add(&awsAwsquery_serializeOpAssumeRoot{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = stack.Deserialize.Add(&awsAwsquery_deserializeOpAssumeRoot{}, middleware.After)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if err := addProtocolFinalizerMiddlewares(stack, options, "AssumeRoot"); 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 = addClientRequestID(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addComputeContentLength(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResolveEndpointMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addComputePayloadSHA256(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRetry(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanRetryLoop(stack, options); 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 = addTimeOffsetBuild(stack, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpAssumeRootValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssumeRoot(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = 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
|
||||
}
|
||||
if err = addSpanInitializeStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func newServiceMetadataMiddleware_opAssumeRoot(region string) *awsmiddleware.RegisterServiceMetadata {
|
||||
return &awsmiddleware.RegisterServiceMetadata{
|
||||
Region: region,
|
||||
ServiceID: ServiceID,
|
||||
OperationName: "AssumeRoot",
|
||||
}
|
||||
}
|
||||
81
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go
generated
vendored
81
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_DecodeAuthorizationMessage.go
generated
vendored
@@ -6,34 +6,44 @@ 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"
|
||||
)
|
||||
|
||||
// Decodes additional information about the authorization status of a request from
|
||||
// an encoded message returned in response to an Amazon Web Services request. For
|
||||
// example, if a user is not authorized to perform an operation that he or she has
|
||||
// requested, the request returns a Client.UnauthorizedOperation response (an HTTP
|
||||
// 403 response). Some Amazon Web Services operations additionally return an
|
||||
// encoded message that can provide details about this authorization failure. Only
|
||||
// certain Amazon Web Services operations return an encoded authorization message.
|
||||
// The documentation for an individual operation indicates whether that operation
|
||||
// returns an encoded message in addition to returning an HTTP code. The message is
|
||||
// encoded because the details of the authorization status can contain privileged
|
||||
// information that the user who requested the operation should not see. To decode
|
||||
// an authorization status message, a user must be granted permissions through an
|
||||
// IAM policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html)
|
||||
// to request the DecodeAuthorizationMessage ( sts:DecodeAuthorizationMessage )
|
||||
// action. The decoded message includes the following type of information:
|
||||
// an encoded message returned in response to an Amazon Web Services request.
|
||||
//
|
||||
// For example, if a user is not authorized to perform an operation that he or she
|
||||
// has requested, the request returns a Client.UnauthorizedOperation response (an
|
||||
// HTTP 403 response). Some Amazon Web Services operations additionally return an
|
||||
// encoded message that can provide details about this authorization failure.
|
||||
//
|
||||
// Only certain Amazon Web Services operations return an encoded authorization
|
||||
// message. The documentation for an individual operation indicates whether that
|
||||
// operation returns an encoded message in addition to returning an HTTP code.
|
||||
//
|
||||
// The message is encoded because the details of the authorization status can
|
||||
// contain privileged information that the user who requested the operation should
|
||||
// not see. To decode an authorization status message, a user must be granted
|
||||
// permissions through an IAM [policy]to request the DecodeAuthorizationMessage (
|
||||
// sts:DecodeAuthorizationMessage ) action.
|
||||
//
|
||||
// The decoded message includes the following type of information:
|
||||
//
|
||||
// - Whether the request was denied due to an explicit deny or due to the
|
||||
// absence of an explicit allow. For more information, see Determining Whether a
|
||||
// Request is Allowed or Denied (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow)
|
||||
// in the IAM User Guide.
|
||||
// absence of an explicit allow. For more information, see [Determining Whether a Request is Allowed or Denied]in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// - The principal who made the request.
|
||||
//
|
||||
// - The requested action.
|
||||
//
|
||||
// - The requested resource.
|
||||
//
|
||||
// - The values of condition keys in the context of the user's request.
|
||||
//
|
||||
// [Determining Whether a Request is Allowed or Denied]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-denyallow
|
||||
// [policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html
|
||||
func (c *Client) DecodeAuthorizationMessage(ctx context.Context, params *DecodeAuthorizationMessageInput, optFns ...func(*Options)) (*DecodeAuthorizationMessageOutput, error) {
|
||||
if params == nil {
|
||||
params = &DecodeAuthorizationMessageInput{}
|
||||
@@ -95,25 +105,28 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
|
||||
if err = addClientRequestID(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
|
||||
if err = addComputeContentLength(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResolveEndpointMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
|
||||
if err = addComputePayloadSHA256(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
if err = addRetry(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
if err = addRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
if err = addRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanRetryLoop(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
@@ -128,13 +141,19 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addTimeOffsetBuild(stack, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpDecodeAuthorizationMessageValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDecodeAuthorizationMessage(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
if err = addRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
@@ -149,6 +168,18 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
85
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go
generated
vendored
85
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetAccessKeyInfo.go
generated
vendored
@@ -6,28 +6,35 @@ 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"
|
||||
)
|
||||
|
||||
// Returns the account identifier for the specified access key ID. Access keys
|
||||
// consist of two parts: an access key ID (for example, AKIAIOSFODNN7EXAMPLE ) and
|
||||
// a secret access key (for example, wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY ).
|
||||
// For more information about access keys, see Managing Access Keys for IAM Users (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html)
|
||||
// in the IAM User Guide. When you pass an access key ID to this operation, it
|
||||
// returns the ID of the Amazon Web Services account to which the keys belong.
|
||||
// Access key IDs beginning with AKIA are long-term credentials for an IAM user or
|
||||
// the Amazon Web Services account root user. Access key IDs beginning with ASIA
|
||||
// are temporary credentials that are created using STS operations. If the account
|
||||
// in the response belongs to you, you can sign in as the root user and review your
|
||||
// root user access keys. Then, you can pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html)
|
||||
// to learn which IAM user owns the keys. To learn who requested the temporary
|
||||
// credentials for an ASIA access key, view the STS events in your CloudTrail logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html)
|
||||
// in the IAM User Guide. This operation does not indicate the state of the access
|
||||
// key. The key might be active, inactive, or deleted. Active keys might not have
|
||||
// permissions to perform an operation. Providing a deleted access key might return
|
||||
// an error that the key doesn't exist.
|
||||
// Returns the account identifier for the specified access key ID.
|
||||
//
|
||||
// Access keys consist of two parts: an access key ID (for example,
|
||||
// AKIAIOSFODNN7EXAMPLE ) and a secret access key (for example,
|
||||
// wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY ). For more information about access
|
||||
// keys, see [Managing Access Keys for IAM Users]in the IAM User Guide.
|
||||
//
|
||||
// When you pass an access key ID to this operation, it returns the ID of the
|
||||
// Amazon Web Services account to which the keys belong. Access key IDs beginning
|
||||
// with AKIA are long-term credentials for an IAM user or the Amazon Web Services
|
||||
// account root user. Access key IDs beginning with ASIA are temporary credentials
|
||||
// that are created using STS operations. If the account in the response belongs to
|
||||
// you, you can sign in as the root user and review your root user access keys.
|
||||
// Then, you can pull a [credentials report]to learn which IAM user owns the keys. To learn who
|
||||
// requested the temporary credentials for an ASIA access key, view the STS events
|
||||
// in your [CloudTrail logs]in the IAM User Guide.
|
||||
//
|
||||
// This operation does not indicate the state of the access key. The key might be
|
||||
// active, inactive, or deleted. Active keys might not have permissions to perform
|
||||
// an operation. Providing a deleted access key might return an error that the key
|
||||
// doesn't exist.
|
||||
//
|
||||
// [credentials report]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html
|
||||
// [CloudTrail logs]: https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html
|
||||
// [Managing Access Keys for IAM Users]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html
|
||||
func (c *Client) GetAccessKeyInfo(ctx context.Context, params *GetAccessKeyInfoInput, optFns ...func(*Options)) (*GetAccessKeyInfoOutput, error) {
|
||||
if params == nil {
|
||||
params = &GetAccessKeyInfoInput{}
|
||||
@@ -45,9 +52,10 @@ func (c *Client) GetAccessKeyInfo(ctx context.Context, params *GetAccessKeyInfoI
|
||||
|
||||
type GetAccessKeyInfoInput struct {
|
||||
|
||||
// The identifier of an access key. This parameter allows (through its regex
|
||||
// pattern) a string of characters that can consist of any upper- or lowercase
|
||||
// letter or digit.
|
||||
// The identifier of an access key.
|
||||
//
|
||||
// This parameter allows (through its regex pattern) a string of characters that
|
||||
// can consist of any upper- or lowercase letter or digit.
|
||||
//
|
||||
// This member is required.
|
||||
AccessKeyId *string
|
||||
@@ -88,25 +96,28 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
|
||||
if err = addClientRequestID(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
|
||||
if err = addComputeContentLength(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResolveEndpointMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
|
||||
if err = addComputePayloadSHA256(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
if err = addRetry(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
if err = addRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
if err = addRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanRetryLoop(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
@@ -121,13 +132,19 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addTimeOffsetBuild(stack, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpGetAccessKeyInfoValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessKeyInfo(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
if err = addRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
@@ -142,6 +159,18 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
61
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go
generated
vendored
61
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetCallerIdentity.go
generated
vendored
@@ -12,13 +12,15 @@ import (
|
||||
)
|
||||
|
||||
// Returns details about the IAM user or role whose credentials are used to call
|
||||
// the operation. No permissions are required to perform this operation. If an
|
||||
// administrator attaches a policy to your identity that explicitly denies access
|
||||
// to the sts:GetCallerIdentity action, you can still perform this operation.
|
||||
// Permissions are not required because the same information is returned when
|
||||
// access is denied. To view an example response, see I Am Not Authorized to
|
||||
// Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa)
|
||||
// in the IAM User Guide.
|
||||
// the operation.
|
||||
//
|
||||
// No permissions are required to perform this operation. If an administrator
|
||||
// attaches a policy to your identity that explicitly denies access to the
|
||||
// sts:GetCallerIdentity action, you can still perform this operation. Permissions
|
||||
// are not required because the same information is returned when access is denied.
|
||||
// To view an example response, see [I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice]in the IAM User Guide.
|
||||
//
|
||||
// [I Am Not Authorized to Perform: iam:DeleteVirtualMFADevice]: https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa
|
||||
func (c *Client) GetCallerIdentity(ctx context.Context, params *GetCallerIdentityInput, optFns ...func(*Options)) (*GetCallerIdentityOutput, error) {
|
||||
if params == nil {
|
||||
params = &GetCallerIdentityInput{}
|
||||
@@ -38,8 +40,8 @@ type GetCallerIdentityInput struct {
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// Contains the response to a successful GetCallerIdentity request, including
|
||||
// information about the entity making the request.
|
||||
// Contains the response to a successful GetCallerIdentity request, including information about the
|
||||
// entity making the request.
|
||||
type GetCallerIdentityOutput struct {
|
||||
|
||||
// The Amazon Web Services account ID number of the account that owns or contains
|
||||
@@ -51,8 +53,10 @@ type GetCallerIdentityOutput struct {
|
||||
|
||||
// The unique identifier of the calling entity. The exact value depends on the
|
||||
// type of entity that is making the call. The values returned are those listed in
|
||||
// the aws:userid column in the Principal table (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable)
|
||||
// found on the Policy Variables reference page in the IAM User Guide.
|
||||
// the aws:userid column in the [Principal table]found on the Policy Variables reference page in
|
||||
// the IAM User Guide.
|
||||
//
|
||||
// [Principal table]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable
|
||||
UserId *string
|
||||
|
||||
// Metadata pertaining to the operation's result.
|
||||
@@ -83,25 +87,28 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
|
||||
if err = addClientRequestID(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
|
||||
if err = addComputeContentLength(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResolveEndpointMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
|
||||
if err = addComputePayloadSHA256(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
if err = addRetry(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
if err = addRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
if err = addRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanRetryLoop(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
@@ -116,10 +123,16 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addTimeOffsetBuild(stack, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCallerIdentity(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
if err = addRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
@@ -134,6 +147,18 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
353
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go
generated
vendored
353
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetFederationToken.go
generated
vendored
@@ -6,7 +6,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
@@ -15,74 +14,100 @@ import (
|
||||
// Returns a set of temporary security credentials (consisting of an access key
|
||||
// ID, a secret access key, and a security token) for a user. A typical use is in a
|
||||
// proxy application that gets temporary security credentials on behalf of
|
||||
// distributed applications inside a corporate network. You must call the
|
||||
// GetFederationToken operation using the long-term security credentials of an IAM
|
||||
// user. As a result, this call is appropriate in contexts where those credentials
|
||||
// can be safeguarded, usually in a server-based application. For a comparison of
|
||||
// GetFederationToken with the other API operations that produce temporary
|
||||
// credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// in the IAM User Guide. Although it is possible to call GetFederationToken using
|
||||
// the security credentials of an Amazon Web Services account root user rather than
|
||||
// an IAM user that you create for the purpose of a proxy application, we do not
|
||||
// recommend it. For more information, see Safeguard your root user credentials
|
||||
// and don't use them for everyday tasks (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)
|
||||
// in the IAM User Guide. You can create a mobile-based or browser-based app that
|
||||
// can authenticate users using a web identity provider like Login with Amazon,
|
||||
// Facebook, Google, or an OpenID Connect-compatible identity provider. In this
|
||||
// case, we recommend that you use Amazon Cognito (http://aws.amazon.com/cognito/)
|
||||
// or AssumeRoleWithWebIdentity . For more information, see Federation Through a
|
||||
// Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
|
||||
// in the IAM User Guide. Session duration The temporary credentials are valid for
|
||||
// the specified duration, from 900 seconds (15 minutes) up to a maximum of 129,600
|
||||
// seconds (36 hours). The default session duration is 43,200 seconds (12 hours).
|
||||
// Temporary credentials obtained by using the root user credentials have a maximum
|
||||
// duration of 3,600 seconds (1 hour). Permissions You can use the temporary
|
||||
// credentials created by GetFederationToken in any Amazon Web Services service
|
||||
// with the following exceptions:
|
||||
// distributed applications inside a corporate network.
|
||||
//
|
||||
// You must call the GetFederationToken operation using the long-term security
|
||||
// credentials of an IAM user. As a result, this call is appropriate in contexts
|
||||
// where those credentials can be safeguarded, usually in a server-based
|
||||
// application. For a comparison of GetFederationToken with the other API
|
||||
// operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide.
|
||||
//
|
||||
// Although it is possible to call GetFederationToken using the security
|
||||
// credentials of an Amazon Web Services account root user rather than an IAM user
|
||||
// that you create for the purpose of a proxy application, we do not recommend it.
|
||||
// For more information, see [Safeguard your root user credentials and don't use them for everyday tasks]in the IAM User Guide.
|
||||
//
|
||||
// You can create a mobile-based or browser-based app that can authenticate users
|
||||
// using a web identity provider like Login with Amazon, Facebook, Google, or an
|
||||
// OpenID Connect-compatible identity provider. In this case, we recommend that you
|
||||
// use [Amazon Cognito]or AssumeRoleWithWebIdentity . For more information, see [Federation Through a Web-based Identity Provider] in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// # Session duration
|
||||
//
|
||||
// The temporary credentials are valid for the specified duration, from 900
|
||||
// seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default
|
||||
// session duration is 43,200 seconds (12 hours). Temporary credentials obtained by
|
||||
// using the root user credentials have a maximum duration of 3,600 seconds (1
|
||||
// hour).
|
||||
//
|
||||
// # Permissions
|
||||
//
|
||||
// You can use the temporary credentials created by GetFederationToken in any
|
||||
// Amazon Web Services service with the following exceptions:
|
||||
//
|
||||
// - You cannot call any IAM operations using the CLI or the Amazon Web Services
|
||||
// API. This limitation does not apply to console sessions.
|
||||
//
|
||||
// - You cannot call any STS operations except GetCallerIdentity .
|
||||
//
|
||||
// You can use temporary credentials for single sign-on (SSO) to the console. You
|
||||
// must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
|
||||
// use for both inline and managed session policies can't exceed 2,048 characters.
|
||||
// You can use temporary credentials for single sign-on (SSO) to the console.
|
||||
//
|
||||
// You must pass an inline or managed [session policy] to this operation. You can pass a single
|
||||
// JSON policy document to use as an inline session policy. You can also specify up
|
||||
// to 10 managed policy Amazon Resource Names (ARNs) to use as managed session
|
||||
// policies. The plaintext that you use for both inline and managed session
|
||||
// policies can't exceed 2,048 characters.
|
||||
//
|
||||
// Though the session policy parameters are optional, if you do not pass a policy,
|
||||
// then the resulting federated user session has no permissions. When you pass
|
||||
// session policies, the session permissions are the intersection of the IAM user
|
||||
// policies and the session policies that you pass. This gives you a way to further
|
||||
// restrict the permissions for a federated user. You cannot use session policies
|
||||
// to grant more permissions than those that are defined in the permissions policy
|
||||
// of the IAM user. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. For information about using GetFederationToken to create
|
||||
// temporary security credentials, see GetFederationToken—Federation Through a
|
||||
// Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken)
|
||||
// . You can use the credentials to access a resource that has a resource-based
|
||||
// of the IAM user. For more information, see [Session Policies]in the IAM User Guide. For
|
||||
// information about using GetFederationToken to create temporary security
|
||||
// credentials, see [GetFederationToken—Federation Through a Custom Identity Broker].
|
||||
//
|
||||
// You can use the credentials to access a resource that has a resource-based
|
||||
// policy. If that policy specifically references the federated user session in the
|
||||
// Principal element of the policy, the session has the permissions allowed by the
|
||||
// policy. These permissions are granted in addition to the permissions granted by
|
||||
// the session policies. Tags (Optional) You can pass tag key-value pairs to your
|
||||
// session. These are called session tags. For more information about session tags,
|
||||
// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. You can create a mobile-based or browser-based app that
|
||||
// can authenticate users using a web identity provider like Login with Amazon,
|
||||
// Facebook, Google, or an OpenID Connect-compatible identity provider. In this
|
||||
// case, we recommend that you use Amazon Cognito (http://aws.amazon.com/cognito/)
|
||||
// or AssumeRoleWithWebIdentity . For more information, see Federation Through a
|
||||
// Web-based Identity Provider (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity)
|
||||
// in the IAM User Guide. An administrator must grant you the permissions necessary
|
||||
// to pass session tags. The administrator can also create granular permissions to
|
||||
// allow you to pass only specific session tags. For more information, see
|
||||
// Tutorial: Using Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html)
|
||||
// in the IAM User Guide. Tag key–value pairs are not case sensitive, but case is
|
||||
// preserved. This means that you cannot have separate Department and department
|
||||
// tag keys. Assume that the user that you are federating has the Department =
|
||||
// Marketing tag and you pass the department = engineering session tag. Department
|
||||
// and department are not saved as separate tags, and the session tag passed in
|
||||
// the request takes precedence over the user tag.
|
||||
// the session policies.
|
||||
//
|
||||
// # Tags
|
||||
//
|
||||
// (Optional) You can pass tag key-value pairs to your session. These are called
|
||||
// session tags. For more information about session tags, see [Passing Session Tags in STS]in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// You can create a mobile-based or browser-based app that can authenticate users
|
||||
// using a web identity provider like Login with Amazon, Facebook, Google, or an
|
||||
// OpenID Connect-compatible identity provider. In this case, we recommend that you
|
||||
// use [Amazon Cognito]or AssumeRoleWithWebIdentity . For more information, see [Federation Through a Web-based Identity Provider] in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// An administrator must grant you the permissions necessary to pass session tags.
|
||||
// The administrator can also create granular permissions to allow you to pass only
|
||||
// specific session tags. For more information, see [Tutorial: Using Tags for Attribute-Based Access Control]in the IAM User Guide.
|
||||
//
|
||||
// Tag key–value pairs are not case sensitive, but case is preserved. This means
|
||||
// that you cannot have separate Department and department tag keys. Assume that
|
||||
// the user that you are federating has the Department = Marketing tag and you
|
||||
// pass the department = engineering session tag. Department and department are
|
||||
// not saved as separate tags, and the session tag passed in the request takes
|
||||
// precedence over the user tag.
|
||||
//
|
||||
// [Federation Through a Web-based Identity Provider]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity
|
||||
// [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Amazon Cognito]: http://aws.amazon.com/cognito/
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
||||
// [GetFederationToken—Federation Through a Custom Identity Broker]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken
|
||||
// [Safeguard your root user credentials and don't use them for everyday tasks]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials
|
||||
// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
|
||||
// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html
|
||||
// [Tutorial: Using Tags for Attribute-Based Access Control]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html
|
||||
func (c *Client) GetFederationToken(ctx context.Context, params *GetFederationTokenInput, optFns ...func(*Options)) (*GetFederationTokenOutput, error) {
|
||||
if params == nil {
|
||||
params = &GetFederationTokenInput{}
|
||||
@@ -103,10 +128,11 @@ type GetFederationTokenInput struct {
|
||||
// The name of the federated user. The name is used as an identifier for the
|
||||
// temporary security credentials (such as Bob ). For example, you can reference
|
||||
// the federated user name in a resource-based policy, such as in an Amazon S3
|
||||
// bucket policy. The regex used to validate this parameter is a string of
|
||||
// characters consisting of upper- and lower-case alphanumeric characters with no
|
||||
// spaces. You can also include underscores or any of the following characters:
|
||||
// =,.@-
|
||||
// bucket policy.
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: =,.@-
|
||||
//
|
||||
// This member is required.
|
||||
Name *string
|
||||
@@ -120,99 +146,127 @@ type GetFederationTokenInput struct {
|
||||
DurationSeconds *int32
|
||||
|
||||
// An IAM policy in JSON format that you want to use as an inline session policy.
|
||||
// You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. This parameter is
|
||||
// optional. However, if you do not pass any session policies, then the resulting
|
||||
// federated user session has no permissions. When you pass session policies, the
|
||||
// session permissions are the intersection of the IAM user policies and the
|
||||
// session policies that you pass. This gives you a way to further restrict the
|
||||
// permissions for a federated user. You cannot use session policies to grant more
|
||||
// permissions than those that are defined in the permissions policy of the IAM
|
||||
// user. For more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. The resulting credentials can be used to access a
|
||||
// resource that has a resource-based policy. If that policy specifically
|
||||
// references the federated user session in the Principal element of the policy,
|
||||
// the session has the permissions allowed by the policy. These permissions are
|
||||
// granted in addition to the permissions that are granted by the session policies.
|
||||
//
|
||||
// You must pass an inline or managed [session policy] to this operation. You can pass a single
|
||||
// JSON policy document to use as an inline session policy. You can also specify up
|
||||
// to 10 managed policy Amazon Resource Names (ARNs) to use as managed session
|
||||
// policies.
|
||||
//
|
||||
// This parameter is optional. However, if you do not pass any session policies,
|
||||
// then the resulting federated user session has no permissions.
|
||||
//
|
||||
// When you pass session policies, the session permissions are the intersection of
|
||||
// the IAM user policies and the session policies that you pass. This gives you a
|
||||
// way to further restrict the permissions for a federated user. You cannot use
|
||||
// session policies to grant more permissions than those that are defined in the
|
||||
// permissions policy of the IAM user. For more information, see [Session Policies]in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// The resulting credentials can be used to access a resource that has a
|
||||
// resource-based policy. If that policy specifically references the federated user
|
||||
// session in the Principal element of the policy, the session has the permissions
|
||||
// allowed by the policy. These permissions are granted in addition to the
|
||||
// permissions that are granted by the session policies.
|
||||
//
|
||||
// The plaintext that you use for both inline and managed session policies can't
|
||||
// exceed 2,048 characters. The JSON policy characters can be any ASCII character
|
||||
// from the space character to the end of the valid character list (\u0020 through
|
||||
// \u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage
|
||||
// return (\u000D) characters. An Amazon Web Services conversion compresses the
|
||||
// passed inline session policy, managed policy ARNs, and session tags into a
|
||||
// packed binary format that has a separate limit. Your request can fail for this
|
||||
// limit even if your plaintext meets the other requirements. The PackedPolicySize
|
||||
// response element indicates by percentage how close the policies and tags for
|
||||
// your request are to the upper size limit.
|
||||
Policy *string
|
||||
|
||||
// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
|
||||
// use as a managed session policy. The policies must exist in the same account as
|
||||
// the IAM user that is requesting federated access. You must pass an inline or
|
||||
// managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// to this operation. You can pass a single JSON policy document to use as an
|
||||
// inline session policy. You can also specify up to 10 managed policy Amazon
|
||||
// Resource Names (ARNs) to use as managed session policies. The plaintext that you
|
||||
// use for both inline and managed session policies can't exceed 2,048 characters.
|
||||
// You can provide up to 10 managed policy ARNs. For more information about ARNs,
|
||||
// see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
|
||||
// in the Amazon Web Services General Reference. This parameter is optional.
|
||||
// However, if you do not pass any session policies, then the resulting federated
|
||||
// user session has no permissions. When you pass session policies, the session
|
||||
// permissions are the intersection of the IAM user policies and the session
|
||||
// policies that you pass. This gives you a way to further restrict the permissions
|
||||
// for a federated user. You cannot use session policies to grant more permissions
|
||||
// than those that are defined in the permissions policy of the IAM user. For more
|
||||
// information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session)
|
||||
// in the IAM User Guide. The resulting credentials can be used to access a
|
||||
// resource that has a resource-based policy. If that policy specifically
|
||||
// references the federated user session in the Principal element of the policy,
|
||||
// the session has the permissions allowed by the policy. These permissions are
|
||||
// granted in addition to the permissions that are granted by the session policies.
|
||||
// return (\u000D) characters.
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
Policy *string
|
||||
|
||||
// The Amazon Resource Names (ARNs) of the IAM managed policies that you want to
|
||||
// use as a managed session policy. The policies must exist in the same account as
|
||||
// the IAM user that is requesting federated access.
|
||||
//
|
||||
// You must pass an inline or managed [session policy] to this operation. You can pass a single
|
||||
// JSON policy document to use as an inline session policy. You can also specify up
|
||||
// to 10 managed policy Amazon Resource Names (ARNs) to use as managed session
|
||||
// policies. The plaintext that you use for both inline and managed session
|
||||
// policies can't exceed 2,048 characters. You can provide up to 10 managed policy
|
||||
// ARNs. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web Services General
|
||||
// Reference.
|
||||
//
|
||||
// This parameter is optional. However, if you do not pass any session policies,
|
||||
// then the resulting federated user session has no permissions.
|
||||
//
|
||||
// When you pass session policies, the session permissions are the intersection of
|
||||
// the IAM user policies and the session policies that you pass. This gives you a
|
||||
// way to further restrict the permissions for a federated user. You cannot use
|
||||
// session policies to grant more permissions than those that are defined in the
|
||||
// permissions policy of the IAM user. For more information, see [Session Policies]in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// The resulting credentials can be used to access a resource that has a
|
||||
// resource-based policy. If that policy specifically references the federated user
|
||||
// session in the Principal element of the policy, the session has the permissions
|
||||
// allowed by the policy. These permissions are granted in addition to the
|
||||
// permissions that are granted by the session policies.
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// [session policy]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Session Policies]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session
|
||||
// [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
||||
PolicyArns []types.PolicyDescriptorType
|
||||
|
||||
// A list of session tags. Each session tag consists of a key name and an
|
||||
// associated value. For more information about session tags, see Passing Session
|
||||
// Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. This parameter is optional. You can pass up to 50 session
|
||||
// tags. The plaintext session tag keys can’t exceed 128 characters and the values
|
||||
// can’t exceed 256 characters. For these and additional limits, see IAM and STS
|
||||
// Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide. An Amazon Web Services conversion compresses the passed
|
||||
// inline session policy, managed policy ARNs, and session tags into a packed
|
||||
// binary format that has a separate limit. Your request can fail for this limit
|
||||
// even if your plaintext meets the other requirements. The PackedPolicySize
|
||||
// response element indicates by percentage how close the policies and tags for
|
||||
// your request are to the upper size limit. You can pass a session tag with the
|
||||
// same key as a tag that is already attached to the user you are federating. When
|
||||
// you do, session tags override a user tag with the same key. Tag key–value pairs
|
||||
// are not case sensitive, but case is preserved. This means that you cannot have
|
||||
// separate Department and department tag keys. Assume that the role has the
|
||||
// Department = Marketing tag and you pass the department = engineering session
|
||||
// tag. Department and department are not saved as separate tags, and the session
|
||||
// tag passed in the request takes precedence over the role tag.
|
||||
// associated value. For more information about session tags, see [Passing Session Tags in STS]in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// This parameter is optional. You can pass up to 50 session tags. The plaintext
|
||||
// session tag keys can’t exceed 128 characters and the values can’t exceed 256
|
||||
// characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User Guide.
|
||||
//
|
||||
// An Amazon Web Services conversion compresses the passed inline session policy,
|
||||
// managed policy ARNs, and session tags into a packed binary format that has a
|
||||
// separate limit. Your request can fail for this limit even if your plaintext
|
||||
// meets the other requirements. The PackedPolicySize response element indicates
|
||||
// by percentage how close the policies and tags for your request are to the upper
|
||||
// size limit.
|
||||
//
|
||||
// You can pass a session tag with the same key as a tag that is already attached
|
||||
// to the user you are federating. When you do, session tags override a user tag
|
||||
// with the same key.
|
||||
//
|
||||
// Tag key–value pairs are not case sensitive, but case is preserved. This means
|
||||
// that you cannot have separate Department and department tag keys. Assume that
|
||||
// the role has the Department = Marketing tag and you pass the department =
|
||||
// engineering session tag. Department and department are not saved as separate
|
||||
// tags, and the session tag passed in the request takes precedence over the role
|
||||
// tag.
|
||||
//
|
||||
// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
||||
// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
||||
Tags []types.Tag
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// Contains the response to a successful GetFederationToken request, including
|
||||
// temporary Amazon Web Services credentials that can be used to make Amazon Web
|
||||
// Services requests.
|
||||
// Contains the response to a successful GetFederationToken request, including temporary Amazon Web
|
||||
// Services credentials that can be used to make Amazon Web Services requests.
|
||||
type GetFederationTokenOutput struct {
|
||||
|
||||
// The temporary security credentials, which include an access key ID, a secret
|
||||
// access key, and a security (or session) token. The size of the security token
|
||||
// that STS API operations return is not fixed. We strongly recommend that you make
|
||||
// no assumptions about the maximum size.
|
||||
// access key, and a security (or session) token.
|
||||
//
|
||||
// The size of the security token that STS API operations return is not fixed. We
|
||||
// strongly recommend that you make no assumptions about the maximum size.
|
||||
Credentials *types.Credentials
|
||||
|
||||
// Identifiers for the federated user associated with the credentials (such as
|
||||
@@ -255,25 +309,28 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
|
||||
if err = addClientRequestID(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
|
||||
if err = addComputeContentLength(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResolveEndpointMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
|
||||
if err = addComputePayloadSHA256(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
if err = addRetry(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
if err = addRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
if err = addRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanRetryLoop(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
@@ -288,13 +345,19 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addTimeOffsetBuild(stack, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addOpGetFederationTokenValidationMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetFederationToken(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
if err = addRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
@@ -309,6 +372,18 @@ func (c *Client) addOperationGetFederationTokenMiddlewares(stack *middleware.Sta
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
140
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go
generated
vendored
140
vendor/github.com/aws/aws-sdk-go-v2/service/sts/api_op_GetSessionToken.go
generated
vendored
@@ -6,7 +6,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
|
||||
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go-v2/service/sts/types"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
@@ -16,43 +15,58 @@ import (
|
||||
// IAM user. The credentials consist of an access key ID, a secret access key, and
|
||||
// a security token. Typically, you use GetSessionToken if you want to use MFA to
|
||||
// protect programmatic calls to specific Amazon Web Services API operations like
|
||||
// Amazon EC2 StopInstances . MFA-enabled IAM users must call GetSessionToken and
|
||||
// submit an MFA code that is associated with their MFA device. Using the temporary
|
||||
// security credentials that the call returns, IAM users can then make programmatic
|
||||
// calls to API operations that require MFA authentication. An incorrect MFA code
|
||||
// causes the API to return an access denied error. For a comparison of
|
||||
// GetSessionToken with the other API operations that produce temporary
|
||||
// credentials, see Requesting Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html)
|
||||
// and Comparing the Amazon Web Services STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison)
|
||||
// in the IAM User Guide. No permissions are required for users to perform this
|
||||
// operation. The purpose of the sts:GetSessionToken operation is to authenticate
|
||||
// the user using MFA. You cannot use policies to control authentication
|
||||
// operations. For more information, see Permissions for GetSessionToken (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html)
|
||||
// in the IAM User Guide. Session Duration The GetSessionToken operation must be
|
||||
// called by using the long-term Amazon Web Services security credentials of an IAM
|
||||
// user. Credentials that are created by IAM users are valid for the duration that
|
||||
// you specify. This duration can range from 900 seconds (15 minutes) up to a
|
||||
// maximum of 129,600 seconds (36 hours), with a default of 43,200 seconds (12
|
||||
// hours). Credentials based on account credentials can range from 900 seconds (15
|
||||
// minutes) up to 3,600 seconds (1 hour), with a default of 1 hour. Permissions The
|
||||
// temporary security credentials created by GetSessionToken can be used to make
|
||||
// API calls to any Amazon Web Services service with the following exceptions:
|
||||
// Amazon EC2 StopInstances .
|
||||
//
|
||||
// MFA-enabled IAM users must call GetSessionToken and submit an MFA code that is
|
||||
// associated with their MFA device. Using the temporary security credentials that
|
||||
// the call returns, IAM users can then make programmatic calls to API operations
|
||||
// that require MFA authentication. An incorrect MFA code causes the API to return
|
||||
// an access denied error. For a comparison of GetSessionToken with the other API
|
||||
// operations that produce temporary credentials, see [Requesting Temporary Security Credentials]and [Compare STS credentials] in the IAM User Guide.
|
||||
//
|
||||
// No permissions are required for users to perform this operation. The purpose of
|
||||
// the sts:GetSessionToken operation is to authenticate the user using MFA. You
|
||||
// cannot use policies to control authentication operations. For more information,
|
||||
// see [Permissions for GetSessionToken]in the IAM User Guide.
|
||||
//
|
||||
// # Session Duration
|
||||
//
|
||||
// The GetSessionToken operation must be called by using the long-term Amazon Web
|
||||
// Services security credentials of an IAM user. Credentials that are created by
|
||||
// IAM users are valid for the duration that you specify. This duration can range
|
||||
// from 900 seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours),
|
||||
// with a default of 43,200 seconds (12 hours). Credentials based on account
|
||||
// credentials can range from 900 seconds (15 minutes) up to 3,600 seconds (1
|
||||
// hour), with a default of 1 hour.
|
||||
//
|
||||
// # Permissions
|
||||
//
|
||||
// The temporary security credentials created by GetSessionToken can be used to
|
||||
// make API calls to any Amazon Web Services service with the following exceptions:
|
||||
//
|
||||
// - You cannot call any IAM API operations unless MFA authentication
|
||||
// information is included in the request.
|
||||
//
|
||||
// - You cannot call any STS API except AssumeRole or GetCallerIdentity .
|
||||
//
|
||||
// The credentials that GetSessionToken returns are based on permissions
|
||||
// associated with the IAM user whose credentials were used to call the operation.
|
||||
// The temporary credentials have the same permissions as the IAM user. Although it
|
||||
// is possible to call GetSessionToken using the security credentials of an Amazon
|
||||
// Web Services account root user rather than an IAM user, we do not recommend it.
|
||||
// If GetSessionToken is called using root user credentials, the temporary
|
||||
// credentials have root user permissions. For more information, see Safeguard
|
||||
// your root user credentials and don't use them for everyday tasks (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials)
|
||||
// in the IAM User Guide For more information about using GetSessionToken to
|
||||
// create temporary credentials, see Temporary Credentials for Users in Untrusted
|
||||
// Environments (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken)
|
||||
// in the IAM User Guide.
|
||||
// The temporary credentials have the same permissions as the IAM user.
|
||||
//
|
||||
// Although it is possible to call GetSessionToken using the security credentials
|
||||
// of an Amazon Web Services account root user rather than an IAM user, we do not
|
||||
// recommend it. If GetSessionToken is called using root user credentials, the
|
||||
// temporary credentials have root user permissions. For more information, see [Safeguard your root user credentials and don't use them for everyday tasks]in
|
||||
// the IAM User Guide
|
||||
//
|
||||
// For more information about using GetSessionToken to create temporary
|
||||
// credentials, see [Temporary Credentials for Users in Untrusted Environments]in the IAM User Guide.
|
||||
//
|
||||
// [Permissions for GetSessionToken]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getsessiontoken.html
|
||||
// [Temporary Credentials for Users in Untrusted Environments]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken
|
||||
// [Safeguard your root user credentials and don't use them for everyday tasks]: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#lock-away-credentials
|
||||
// [Requesting Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html
|
||||
// [Compare STS credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_sts-comparison.html
|
||||
func (c *Client) GetSessionToken(ctx context.Context, params *GetSessionTokenInput, optFns ...func(*Options)) (*GetSessionTokenOutput, error) {
|
||||
if params == nil {
|
||||
params = &GetSessionTokenInput{}
|
||||
@@ -84,10 +98,11 @@ type GetSessionTokenInput struct {
|
||||
// number for a hardware device (such as GAHT12345678 ) or an Amazon Resource Name
|
||||
// (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user ). You
|
||||
// can find the device for an IAM user by going to the Amazon Web Services
|
||||
// Management Console and viewing the user's security credentials. The regex used
|
||||
// to validate this parameter is a string of characters consisting of upper- and
|
||||
// lower-case alphanumeric characters with no spaces. You can also include
|
||||
// underscores or any of the following characters: =,.@:/-
|
||||
// Management Console and viewing the user's security credentials.
|
||||
//
|
||||
// The regex used to validate this parameter is a string of characters consisting
|
||||
// of upper- and lower-case alphanumeric characters with no spaces. You can also
|
||||
// include underscores or any of the following characters: =,.@:/-
|
||||
SerialNumber *string
|
||||
|
||||
// The value provided by the MFA device, if MFA is required. If any policy
|
||||
@@ -95,22 +110,24 @@ type GetSessionTokenInput struct {
|
||||
// authentication is required, the user must provide a code when requesting a set
|
||||
// of temporary security credentials. A user who fails to provide the code receives
|
||||
// an "access denied" response when requesting resources that require MFA
|
||||
// authentication. The format for this parameter, as described by its regex
|
||||
// pattern, is a sequence of six numeric digits.
|
||||
// authentication.
|
||||
//
|
||||
// The format for this parameter, as described by its regex pattern, is a sequence
|
||||
// of six numeric digits.
|
||||
TokenCode *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
}
|
||||
|
||||
// Contains the response to a successful GetSessionToken request, including
|
||||
// temporary Amazon Web Services credentials that can be used to make Amazon Web
|
||||
// Services requests.
|
||||
// Contains the response to a successful GetSessionToken request, including temporary Amazon Web
|
||||
// Services credentials that can be used to make Amazon Web Services requests.
|
||||
type GetSessionTokenOutput struct {
|
||||
|
||||
// The temporary security credentials, which include an access key ID, a secret
|
||||
// access key, and a security (or session) token. The size of the security token
|
||||
// that STS API operations return is not fixed. We strongly recommend that you make
|
||||
// no assumptions about the maximum size.
|
||||
// access key, and a security (or session) token.
|
||||
//
|
||||
// The size of the security token that STS API operations return is not fixed. We
|
||||
// strongly recommend that you make no assumptions about the maximum size.
|
||||
Credentials *types.Credentials
|
||||
|
||||
// Metadata pertaining to the operation's result.
|
||||
@@ -141,25 +158,28 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err = addSetLoggerMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
|
||||
if err = addClientRequestID(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
|
||||
if err = addComputeContentLength(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addResolveEndpointMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
|
||||
if err = addComputePayloadSHA256(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRetryMiddlewares(stack, options); err != nil {
|
||||
if err = addRetry(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
|
||||
if err = addRawResponseToMetadata(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
|
||||
if err = addRecordResponseTiming(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanRetryLoop(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addClientUserAgent(stack, options); err != nil {
|
||||
@@ -174,10 +194,16 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addTimeOffsetBuild(stack, c); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addUserAgentRetryMode(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSessionToken(options.Region), middleware.Before); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
|
||||
if err = addRecursionDetection(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
|
||||
@@ -192,6 +218,18 @@ func (c *Client) addOperationGetSessionTokenMiddlewares(stack *middleware.Stack,
|
||||
if err = addDisableHTTPSMiddleware(stack, options); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanInitializeEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestStart(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
if err = addSpanBuildRequestEnd(stack); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
43
vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go
generated
vendored
43
vendor/github.com/aws/aws-sdk-go-v2/service/sts/auth.go
generated
vendored
@@ -8,11 +8,13 @@ import (
|
||||
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/metrics"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
"github.com/aws/smithy-go/tracing"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
)
|
||||
|
||||
func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) {
|
||||
func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) {
|
||||
params.Region = options.Region
|
||||
}
|
||||
|
||||
@@ -90,12 +92,12 @@ type AuthResolverParameters struct {
|
||||
Region string
|
||||
}
|
||||
|
||||
func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters {
|
||||
func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters {
|
||||
params := &AuthResolverParameters{
|
||||
Operation: operation,
|
||||
}
|
||||
|
||||
bindAuthParamsRegion(params, input, options)
|
||||
bindAuthParamsRegion(ctx, params, input, options)
|
||||
|
||||
return params
|
||||
}
|
||||
@@ -157,7 +159,10 @@ func (*resolveAuthSchemeMiddleware) ID() string {
|
||||
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)
|
||||
_, span := tracing.StartSpan(ctx, "ResolveAuthScheme")
|
||||
defer span.End()
|
||||
|
||||
params := bindAuthResolverParams(ctx, 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)
|
||||
@@ -169,6 +174,9 @@ func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in mid
|
||||
}
|
||||
|
||||
ctx = setResolvedAuthScheme(ctx, scheme)
|
||||
|
||||
span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID())
|
||||
span.End()
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
@@ -228,7 +236,10 @@ func (*getIdentityMiddleware) ID() string {
|
||||
func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
rscheme := getResolvedAuthScheme(ctx)
|
||||
innerCtx, span := tracing.StartSpan(ctx, "GetIdentity")
|
||||
defer span.End()
|
||||
|
||||
rscheme := getResolvedAuthScheme(innerCtx)
|
||||
if rscheme == nil {
|
||||
return out, metadata, fmt.Errorf("no resolved auth scheme")
|
||||
}
|
||||
@@ -238,12 +249,20 @@ func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middlewar
|
||||
return out, metadata, fmt.Errorf("no identity resolver")
|
||||
}
|
||||
|
||||
identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties)
|
||||
identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration",
|
||||
func() (smithyauth.Identity, error) {
|
||||
return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties)
|
||||
},
|
||||
func(o *metrics.RecordMetricOptions) {
|
||||
o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID())
|
||||
})
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("get identity: %w", err)
|
||||
}
|
||||
|
||||
ctx = setIdentity(ctx, identity)
|
||||
|
||||
span.End()
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
@@ -259,6 +278,7 @@ func getIdentity(ctx context.Context) smithyauth.Identity {
|
||||
}
|
||||
|
||||
type signRequestMiddleware struct {
|
||||
options Options
|
||||
}
|
||||
|
||||
func (*signRequestMiddleware) ID() string {
|
||||
@@ -268,6 +288,9 @@ func (*signRequestMiddleware) ID() string {
|
||||
func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "SignRequest")
|
||||
defer span.End()
|
||||
|
||||
req, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request)
|
||||
@@ -288,9 +311,15 @@ func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middlewar
|
||||
return out, metadata, fmt.Errorf("no signer")
|
||||
}
|
||||
|
||||
if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil {
|
||||
_, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) {
|
||||
return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties)
|
||||
}, func(o *metrics.RecordMetricOptions) {
|
||||
o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID())
|
||||
})
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("sign request: %w", err)
|
||||
}
|
||||
|
||||
span.End()
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
212
vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go
generated
vendored
212
vendor/github.com/aws/aws-sdk-go-v2/service/sts/deserializers.go
generated
vendored
@@ -16,12 +16,22 @@ import (
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
"github.com/aws/smithy-go/ptr"
|
||||
smithytime "github.com/aws/smithy-go/time"
|
||||
"github.com/aws/smithy-go/tracing"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"io"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func deserializeS3Expires(v string) (*time.Time, error) {
|
||||
t, err := smithytime.ParseHTTPDate(v)
|
||||
if err != nil {
|
||||
return nil, nil
|
||||
}
|
||||
return &t, nil
|
||||
}
|
||||
|
||||
type awsAwsquery_deserializeOpAssumeRole struct {
|
||||
}
|
||||
|
||||
@@ -37,6 +47,10 @@ func (m *awsAwsquery_deserializeOpAssumeRole) HandleDeserialize(ctx context.Cont
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
_, span := tracing.StartSpan(ctx, "OperationDeserializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
response, ok := out.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
||||
@@ -154,6 +168,10 @@ func (m *awsAwsquery_deserializeOpAssumeRoleWithSAML) HandleDeserialize(ctx cont
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
_, span := tracing.StartSpan(ctx, "OperationDeserializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
response, ok := out.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
||||
@@ -277,6 +295,10 @@ func (m *awsAwsquery_deserializeOpAssumeRoleWithWebIdentity) HandleDeserialize(c
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
_, span := tracing.StartSpan(ctx, "OperationDeserializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
response, ok := out.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
||||
@@ -388,6 +410,121 @@ func awsAwsquery_deserializeOpErrorAssumeRoleWithWebIdentity(response *smithyhtt
|
||||
}
|
||||
}
|
||||
|
||||
type awsAwsquery_deserializeOpAssumeRoot struct {
|
||||
}
|
||||
|
||||
func (*awsAwsquery_deserializeOpAssumeRoot) ID() string {
|
||||
return "OperationDeserializer"
|
||||
}
|
||||
|
||||
func (m *awsAwsquery_deserializeOpAssumeRoot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
|
||||
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
out, metadata, err = next.HandleDeserialize(ctx, in)
|
||||
if err != nil {
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
_, span := tracing.StartSpan(ctx, "OperationDeserializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
response, ok := out.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
||||
}
|
||||
|
||||
if response.StatusCode < 200 || response.StatusCode >= 300 {
|
||||
return out, metadata, awsAwsquery_deserializeOpErrorAssumeRoot(response, &metadata)
|
||||
}
|
||||
output := &AssumeRootOutput{}
|
||||
out.Result = output
|
||||
|
||||
var buff [1024]byte
|
||||
ringBuffer := smithyio.NewRingBuffer(buff[:])
|
||||
body := io.TeeReader(response.Body, ringBuffer)
|
||||
rootDecoder := xml.NewDecoder(body)
|
||||
t, err := smithyxml.FetchRootElement(rootDecoder)
|
||||
if err == io.EOF {
|
||||
return out, metadata, nil
|
||||
}
|
||||
if err != nil {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
return out, metadata, &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
}
|
||||
|
||||
decoder := smithyxml.WrapNodeDecoder(rootDecoder, t)
|
||||
t, err = decoder.GetElement("AssumeRootResult")
|
||||
if err != nil {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
err = &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
||||
err = awsAwsquery_deserializeOpDocumentAssumeRootOutput(&output, decoder)
|
||||
if err != nil {
|
||||
var snapshot bytes.Buffer
|
||||
io.Copy(&snapshot, ringBuffer)
|
||||
err = &smithy.DeserializationError{
|
||||
Err: fmt.Errorf("failed to decode response body, %w", err),
|
||||
Snapshot: snapshot.Bytes(),
|
||||
}
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
func awsAwsquery_deserializeOpErrorAssumeRoot(response *smithyhttp.Response, metadata *middleware.Metadata) error {
|
||||
var errorBuffer bytes.Buffer
|
||||
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
|
||||
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
|
||||
}
|
||||
errorBody := bytes.NewReader(errorBuffer.Bytes())
|
||||
|
||||
errorCode := "UnknownError"
|
||||
errorMessage := errorCode
|
||||
|
||||
errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if reqID := errorComponents.RequestID; len(reqID) != 0 {
|
||||
awsmiddleware.SetRequestIDMetadata(metadata, reqID)
|
||||
}
|
||||
if len(errorComponents.Code) != 0 {
|
||||
errorCode = errorComponents.Code
|
||||
}
|
||||
if len(errorComponents.Message) != 0 {
|
||||
errorMessage = errorComponents.Message
|
||||
}
|
||||
errorBody.Seek(0, io.SeekStart)
|
||||
switch {
|
||||
case strings.EqualFold("ExpiredTokenException", errorCode):
|
||||
return awsAwsquery_deserializeErrorExpiredTokenException(response, errorBody)
|
||||
|
||||
case strings.EqualFold("RegionDisabledException", errorCode):
|
||||
return awsAwsquery_deserializeErrorRegionDisabledException(response, errorBody)
|
||||
|
||||
default:
|
||||
genericError := &smithy.GenericAPIError{
|
||||
Code: errorCode,
|
||||
Message: errorMessage,
|
||||
}
|
||||
return genericError
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
type awsAwsquery_deserializeOpDecodeAuthorizationMessage struct {
|
||||
}
|
||||
|
||||
@@ -403,6 +540,10 @@ func (m *awsAwsquery_deserializeOpDecodeAuthorizationMessage) HandleDeserialize(
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
_, span := tracing.StartSpan(ctx, "OperationDeserializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
response, ok := out.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
||||
@@ -511,6 +652,10 @@ func (m *awsAwsquery_deserializeOpGetAccessKeyInfo) HandleDeserialize(ctx contex
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
_, span := tracing.StartSpan(ctx, "OperationDeserializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
response, ok := out.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
||||
@@ -616,6 +761,10 @@ func (m *awsAwsquery_deserializeOpGetCallerIdentity) HandleDeserialize(ctx conte
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
_, span := tracing.StartSpan(ctx, "OperationDeserializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
response, ok := out.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
||||
@@ -721,6 +870,10 @@ func (m *awsAwsquery_deserializeOpGetFederationToken) HandleDeserialize(ctx cont
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
_, span := tracing.StartSpan(ctx, "OperationDeserializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
response, ok := out.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
||||
@@ -835,6 +988,10 @@ func (m *awsAwsquery_deserializeOpGetSessionToken) HandleDeserialize(ctx context
|
||||
return out, metadata, err
|
||||
}
|
||||
|
||||
_, span := tracing.StartSpan(ctx, "OperationDeserializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.deserialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
response, ok := out.RawResponse.(*smithyhttp.Response)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
|
||||
@@ -2226,6 +2383,61 @@ func awsAwsquery_deserializeOpDocumentAssumeRoleWithWebIdentityOutput(v **Assume
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsAwsquery_deserializeOpDocumentAssumeRootOutput(v **AssumeRootOutput, decoder smithyxml.NodeDecoder) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
}
|
||||
var sv *AssumeRootOutput
|
||||
if *v == nil {
|
||||
sv = &AssumeRootOutput{}
|
||||
} else {
|
||||
sv = *v
|
||||
}
|
||||
|
||||
for {
|
||||
t, done, err := decoder.Token()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if done {
|
||||
break
|
||||
}
|
||||
originalDecoder := decoder
|
||||
decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t)
|
||||
switch {
|
||||
case strings.EqualFold("Credentials", t.Name.Local):
|
||||
nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t)
|
||||
if err := awsAwsquery_deserializeDocumentCredentials(&sv.Credentials, nodeDecoder); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
case strings.EqualFold("SourceIdentity", t.Name.Local):
|
||||
val, err := decoder.Value()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if val == nil {
|
||||
break
|
||||
}
|
||||
{
|
||||
xtv := string(val)
|
||||
sv.SourceIdentity = ptr.String(xtv)
|
||||
}
|
||||
|
||||
default:
|
||||
// Do nothing and ignore the unexpected tag element
|
||||
err = decoder.Decoder.Skip()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
}
|
||||
decoder = originalDecoder
|
||||
}
|
||||
*v = sv
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsAwsquery_deserializeOpDocumentDecodeAuthorizationMessageOutput(v **DecodeAuthorizationMessageOutput, decoder smithyxml.NodeDecoder) error {
|
||||
if v == nil {
|
||||
return fmt.Errorf("unexpected nil of type %T", v)
|
||||
|
||||
12
vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go
generated
vendored
12
vendor/github.com/aws/aws-sdk-go-v2/service/sts/doc.go
generated
vendored
@@ -3,9 +3,11 @@
|
||||
// Package sts provides the API client, operations, and parameter types for AWS
|
||||
// Security Token Service.
|
||||
//
|
||||
// Security Token Service Security Token Service (STS) enables you to request
|
||||
// temporary, limited-privilege credentials for users. This guide provides
|
||||
// descriptions of the STS API. For more information about using this service, see
|
||||
// Temporary Security Credentials (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html)
|
||||
// .
|
||||
// # Security Token Service
|
||||
//
|
||||
// Security Token Service (STS) enables you to request temporary,
|
||||
// limited-privilege credentials for users. This guide provides descriptions of the
|
||||
// STS API. For more information about using this service, see [Temporary Security Credentials].
|
||||
//
|
||||
// [Temporary Security Credentials]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html
|
||||
package sts
|
||||
|
||||
36
vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go
generated
vendored
36
vendor/github.com/aws/aws-sdk-go-v2/service/sts/endpoints.go
generated
vendored
@@ -17,6 +17,7 @@ import (
|
||||
smithyendpoints "github.com/aws/smithy-go/endpoints"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
"github.com/aws/smithy-go/ptr"
|
||||
"github.com/aws/smithy-go/tracing"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -217,6 +218,13 @@ func resolveBaseEndpoint(cfg aws.Config, o *Options) {
|
||||
}
|
||||
}
|
||||
|
||||
func bindRegion(region string) *string {
|
||||
if region == "" {
|
||||
return nil
|
||||
}
|
||||
return aws.String(endpoints.MapFIPSRegion(region))
|
||||
}
|
||||
|
||||
// EndpointParameters provides the parameters that influence how endpoints are
|
||||
// resolved.
|
||||
type EndpointParameters struct {
|
||||
@@ -299,6 +307,17 @@ func (p EndpointParameters) WithDefaults() EndpointParameters {
|
||||
return p
|
||||
}
|
||||
|
||||
type stringSlice []string
|
||||
|
||||
func (s stringSlice) Get(i int) *string {
|
||||
if i < 0 || i >= len(s) {
|
||||
return nil
|
||||
}
|
||||
|
||||
v := s[i]
|
||||
return &v
|
||||
}
|
||||
|
||||
// EndpointResolverV2 provides the interface for resolving service endpoints.
|
||||
type EndpointResolverV2 interface {
|
||||
// ResolveEndpoint attempts to resolve the endpoint with the provided options,
|
||||
@@ -1038,10 +1057,10 @@ type endpointParamsBinder interface {
|
||||
bindEndpointParams(*EndpointParameters)
|
||||
}
|
||||
|
||||
func bindEndpointParams(input interface{}, options Options) *EndpointParameters {
|
||||
func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters {
|
||||
params := &EndpointParameters{}
|
||||
|
||||
params.Region = aws.String(endpoints.MapFIPSRegion(options.Region))
|
||||
params.Region = bindRegion(options.Region)
|
||||
params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled)
|
||||
params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled)
|
||||
params.Endpoint = options.BaseEndpoint
|
||||
@@ -1064,6 +1083,9 @@ func (*resolveEndpointV2Middleware) ID() string {
|
||||
func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) (
|
||||
out middleware.FinalizeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "ResolveEndpoint")
|
||||
defer span.End()
|
||||
|
||||
if awsmiddleware.GetRequiresLegacyEndpoints(ctx) {
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
@@ -1077,12 +1099,17 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid
|
||||
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)
|
||||
params := bindEndpointParams(ctx, getOperationInput(ctx), m.options)
|
||||
endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration",
|
||||
func() (smithyendpoints.Endpoint, error) {
|
||||
return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params)
|
||||
})
|
||||
if err != nil {
|
||||
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
|
||||
}
|
||||
|
||||
span.SetProperty("client.call.resolved_endpoint", endpt.URI.String())
|
||||
|
||||
if endpt.URI.RawPath == "" && req.URL.RawPath != "" {
|
||||
endpt.URI.RawPath = endpt.URI.Path
|
||||
}
|
||||
@@ -1104,5 +1131,6 @@ func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in mid
|
||||
rscheme.SignerProperties.SetAll(&o.SignerProperties)
|
||||
}
|
||||
|
||||
span.End()
|
||||
return next.HandleFinalize(ctx, in)
|
||||
}
|
||||
|
||||
5
vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json
generated
vendored
5
vendor/github.com/aws/aws-sdk-go-v2/service/sts/generated.json
generated
vendored
@@ -5,8 +5,7 @@
|
||||
"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000",
|
||||
"github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding": "v1.0.5",
|
||||
"github.com/aws/aws-sdk-go-v2/service/internal/presigned-url": "v1.0.7",
|
||||
"github.com/aws/smithy-go": "v1.4.0",
|
||||
"github.com/google/go-cmp": "v0.5.4"
|
||||
"github.com/aws/smithy-go": "v1.4.0"
|
||||
},
|
||||
"files": [
|
||||
"api_client.go",
|
||||
@@ -14,6 +13,7 @@
|
||||
"api_op_AssumeRole.go",
|
||||
"api_op_AssumeRoleWithSAML.go",
|
||||
"api_op_AssumeRoleWithWebIdentity.go",
|
||||
"api_op_AssumeRoot.go",
|
||||
"api_op_DecodeAuthorizationMessage.go",
|
||||
"api_op_GetAccessKeyInfo.go",
|
||||
"api_op_GetCallerIdentity.go",
|
||||
@@ -31,6 +31,7 @@
|
||||
"options.go",
|
||||
"protocol_test.go",
|
||||
"serializers.go",
|
||||
"snapshot_test.go",
|
||||
"types/errors.go",
|
||||
"types/types.go",
|
||||
"validators.go"
|
||||
|
||||
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
2
vendor/github.com/aws/aws-sdk-go-v2/service/sts/go_module_metadata.go
generated
vendored
@@ -3,4 +3,4 @@
|
||||
package sts
|
||||
|
||||
// goModuleVersion is the tagged release for this module
|
||||
const goModuleVersion = "1.26.7"
|
||||
const goModuleVersion = "1.33.13"
|
||||
|
||||
19
vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go
generated
vendored
19
vendor/github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints/endpoints.go
generated
vendored
@@ -94,7 +94,7 @@ var partitionRegexp = struct {
|
||||
AwsUsGov *regexp.Regexp
|
||||
}{
|
||||
|
||||
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"),
|
||||
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"),
|
||||
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
|
||||
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
|
||||
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
|
||||
@@ -172,6 +172,12 @@ var defaultPartitions = endpoints.Partitions{
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-southeast-4",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-southeast-5",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "ap-southeast-7",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "aws-global",
|
||||
}: endpoints.Endpoint{
|
||||
@@ -219,6 +225,9 @@ var defaultPartitions = endpoints.Partitions{
|
||||
endpoints.EndpointKey{
|
||||
Region: "me-south-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "mx-central-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "sa-east-1",
|
||||
}: endpoints.Endpoint{},
|
||||
@@ -435,6 +444,14 @@ var defaultPartitions = endpoints.Partitions{
|
||||
},
|
||||
RegionRegex: partitionRegexp.AwsIsoF,
|
||||
IsRegionalized: true,
|
||||
Endpoints: endpoints.Endpoints{
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-isof-east-1",
|
||||
}: endpoints.Endpoint{},
|
||||
endpoints.EndpointKey{
|
||||
Region: "us-isof-south-1",
|
||||
}: endpoints.Endpoint{},
|
||||
},
|
||||
},
|
||||
{
|
||||
ID: "aws-us-gov",
|
||||
|
||||
39
vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go
generated
vendored
39
vendor/github.com/aws/aws-sdk-go-v2/service/sts/options.go
generated
vendored
@@ -9,7 +9,9 @@ import (
|
||||
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/metrics"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
"github.com/aws/smithy-go/tracing"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"net/http"
|
||||
)
|
||||
@@ -50,8 +52,10 @@ type Options struct {
|
||||
// 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.
|
||||
// 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
|
||||
@@ -64,23 +68,29 @@ type Options struct {
|
||||
// The logger writer interface to write logging messages to.
|
||||
Logger logging.Logger
|
||||
|
||||
// The client meter provider.
|
||||
MeterProvider metrics.MeterProvider
|
||||
|
||||
// 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.
|
||||
// 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.
|
||||
// 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
|
||||
@@ -95,10 +105,14 @@ type Options struct {
|
||||
// within your applications.
|
||||
RuntimeEnvironment aws.RuntimeEnvironment
|
||||
|
||||
// The client tracer provider.
|
||||
TracerProvider tracing.TracerProvider
|
||||
|
||||
// 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.
|
||||
// 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
|
||||
@@ -143,6 +157,7 @@ func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
|
||||
// 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) {
|
||||
|
||||
143
vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go
generated
vendored
143
vendor/github.com/aws/aws-sdk-go-v2/service/sts/serializers.go
generated
vendored
@@ -11,6 +11,7 @@ import (
|
||||
smithy "github.com/aws/smithy-go"
|
||||
"github.com/aws/smithy-go/encoding/httpbinding"
|
||||
"github.com/aws/smithy-go/middleware"
|
||||
"github.com/aws/smithy-go/tracing"
|
||||
smithyhttp "github.com/aws/smithy-go/transport/http"
|
||||
"path"
|
||||
)
|
||||
@@ -25,6 +26,10 @@ func (*awsAwsquery_serializeOpAssumeRole) ID() string {
|
||||
func (m *awsAwsquery_serializeOpAssumeRole) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "OperationSerializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
request, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
|
||||
@@ -76,6 +81,8 @@ func (m *awsAwsquery_serializeOpAssumeRole) HandleSerialize(ctx context.Context,
|
||||
}
|
||||
in.Request = request
|
||||
|
||||
endTimer()
|
||||
span.End()
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
@@ -89,6 +96,10 @@ func (*awsAwsquery_serializeOpAssumeRoleWithSAML) ID() string {
|
||||
func (m *awsAwsquery_serializeOpAssumeRoleWithSAML) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "OperationSerializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
request, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
|
||||
@@ -140,6 +151,8 @@ func (m *awsAwsquery_serializeOpAssumeRoleWithSAML) HandleSerialize(ctx context.
|
||||
}
|
||||
in.Request = request
|
||||
|
||||
endTimer()
|
||||
span.End()
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
@@ -153,6 +166,10 @@ func (*awsAwsquery_serializeOpAssumeRoleWithWebIdentity) ID() string {
|
||||
func (m *awsAwsquery_serializeOpAssumeRoleWithWebIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "OperationSerializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
request, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
|
||||
@@ -204,6 +221,78 @@ func (m *awsAwsquery_serializeOpAssumeRoleWithWebIdentity) HandleSerialize(ctx c
|
||||
}
|
||||
in.Request = request
|
||||
|
||||
endTimer()
|
||||
span.End()
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
type awsAwsquery_serializeOpAssumeRoot struct {
|
||||
}
|
||||
|
||||
func (*awsAwsquery_serializeOpAssumeRoot) ID() string {
|
||||
return "OperationSerializer"
|
||||
}
|
||||
|
||||
func (m *awsAwsquery_serializeOpAssumeRoot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "OperationSerializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
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.(*AssumeRootInput)
|
||||
_ = input
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
|
||||
}
|
||||
|
||||
operationPath := "/"
|
||||
if len(request.Request.URL.Path) == 0 {
|
||||
request.Request.URL.Path = operationPath
|
||||
} else {
|
||||
request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath)
|
||||
if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' {
|
||||
request.Request.URL.Path += "/"
|
||||
}
|
||||
}
|
||||
request.Request.Method = "POST"
|
||||
httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
|
||||
if err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded")
|
||||
|
||||
bodyWriter := bytes.NewBuffer(nil)
|
||||
bodyEncoder := query.NewEncoder(bodyWriter)
|
||||
body := bodyEncoder.Object()
|
||||
body.Key("Action").String("AssumeRoot")
|
||||
body.Key("Version").String("2011-06-15")
|
||||
|
||||
if err := awsAwsquery_serializeOpDocumentAssumeRootInput(input, bodyEncoder.Value); err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
|
||||
err = bodyEncoder.Encode()
|
||||
if err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
|
||||
if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
|
||||
if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil {
|
||||
return out, metadata, &smithy.SerializationError{Err: err}
|
||||
}
|
||||
in.Request = request
|
||||
|
||||
endTimer()
|
||||
span.End()
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
@@ -217,6 +306,10 @@ func (*awsAwsquery_serializeOpDecodeAuthorizationMessage) ID() string {
|
||||
func (m *awsAwsquery_serializeOpDecodeAuthorizationMessage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "OperationSerializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
request, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
|
||||
@@ -268,6 +361,8 @@ func (m *awsAwsquery_serializeOpDecodeAuthorizationMessage) HandleSerialize(ctx
|
||||
}
|
||||
in.Request = request
|
||||
|
||||
endTimer()
|
||||
span.End()
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
@@ -281,6 +376,10 @@ func (*awsAwsquery_serializeOpGetAccessKeyInfo) ID() string {
|
||||
func (m *awsAwsquery_serializeOpGetAccessKeyInfo) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "OperationSerializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
request, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
|
||||
@@ -332,6 +431,8 @@ func (m *awsAwsquery_serializeOpGetAccessKeyInfo) HandleSerialize(ctx context.Co
|
||||
}
|
||||
in.Request = request
|
||||
|
||||
endTimer()
|
||||
span.End()
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
@@ -345,6 +446,10 @@ func (*awsAwsquery_serializeOpGetCallerIdentity) ID() string {
|
||||
func (m *awsAwsquery_serializeOpGetCallerIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "OperationSerializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
request, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
|
||||
@@ -392,6 +497,8 @@ func (m *awsAwsquery_serializeOpGetCallerIdentity) HandleSerialize(ctx context.C
|
||||
}
|
||||
in.Request = request
|
||||
|
||||
endTimer()
|
||||
span.End()
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
@@ -405,6 +512,10 @@ func (*awsAwsquery_serializeOpGetFederationToken) ID() string {
|
||||
func (m *awsAwsquery_serializeOpGetFederationToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "OperationSerializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
request, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
|
||||
@@ -456,6 +567,8 @@ func (m *awsAwsquery_serializeOpGetFederationToken) HandleSerialize(ctx context.
|
||||
}
|
||||
in.Request = request
|
||||
|
||||
endTimer()
|
||||
span.End()
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
|
||||
@@ -469,6 +582,10 @@ func (*awsAwsquery_serializeOpGetSessionToken) ID() string {
|
||||
func (m *awsAwsquery_serializeOpGetSessionToken) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
|
||||
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
_, span := tracing.StartSpan(ctx, "OperationSerializer")
|
||||
endTimer := startMetricTimer(ctx, "client.call.serialization_duration")
|
||||
defer endTimer()
|
||||
defer span.End()
|
||||
request, ok := in.Request.(*smithyhttp.Request)
|
||||
if !ok {
|
||||
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
|
||||
@@ -520,6 +637,8 @@ func (m *awsAwsquery_serializeOpGetSessionToken) HandleSerialize(ctx context.Con
|
||||
}
|
||||
in.Request = request
|
||||
|
||||
endTimer()
|
||||
span.End()
|
||||
return next.HandleSerialize(ctx, in)
|
||||
}
|
||||
func awsAwsquery_serializeDocumentPolicyDescriptorListType(v []types.PolicyDescriptorType, value query.Value) error {
|
||||
@@ -772,6 +891,30 @@ func awsAwsquery_serializeOpDocumentAssumeRoleWithWebIdentityInput(v *AssumeRole
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsAwsquery_serializeOpDocumentAssumeRootInput(v *AssumeRootInput, value query.Value) error {
|
||||
object := value.Object()
|
||||
_ = object
|
||||
|
||||
if v.DurationSeconds != nil {
|
||||
objectKey := object.Key("DurationSeconds")
|
||||
objectKey.Integer(*v.DurationSeconds)
|
||||
}
|
||||
|
||||
if v.TargetPrincipal != nil {
|
||||
objectKey := object.Key("TargetPrincipal")
|
||||
objectKey.String(*v.TargetPrincipal)
|
||||
}
|
||||
|
||||
if v.TaskPolicyArn != nil {
|
||||
objectKey := object.Key("TaskPolicyArn")
|
||||
if err := awsAwsquery_serializeDocumentPolicyDescriptorType(v.TaskPolicyArn, objectKey); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func awsAwsquery_serializeOpDocumentDecodeAuthorizationMessageInput(v *DecodeAuthorizationMessageInput, value query.Value) error {
|
||||
object := value.Object()
|
||||
_ = object
|
||||
|
||||
30
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go
generated
vendored
30
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/errors.go
generated
vendored
@@ -65,9 +65,10 @@ func (e *IDPCommunicationErrorException) ErrorCode() string {
|
||||
func (e *IDPCommunicationErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// The identity provider (IdP) reported that authentication failed. This might be
|
||||
// because the claim is invalid. If this error is returned for the
|
||||
// AssumeRoleWithWebIdentity operation, it can also mean that the claim has expired
|
||||
// or has been explicitly revoked.
|
||||
// because the claim is invalid.
|
||||
//
|
||||
// If this error is returned for the AssumeRoleWithWebIdentity operation, it can
|
||||
// also mean that the claim has expired or has been explicitly revoked.
|
||||
type IDPRejectedClaimException struct {
|
||||
Message *string
|
||||
|
||||
@@ -94,8 +95,8 @@ func (e *IDPRejectedClaimException) ErrorCode() string {
|
||||
func (e *IDPRejectedClaimException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
|
||||
|
||||
// The error returned if the message passed to DecodeAuthorizationMessage was
|
||||
// invalid. This can happen if the token contains invalid characters, such as
|
||||
// linebreaks.
|
||||
// invalid. This can happen if the token contains invalid characters, such as line
|
||||
// breaks, or if the message has expired.
|
||||
type InvalidAuthorizationMessageException struct {
|
||||
Message *string
|
||||
|
||||
@@ -183,11 +184,13 @@ func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { retu
|
||||
// compresses the session policy document, session policy ARNs, and session tags
|
||||
// into a packed binary format that has a separate limit. The error message
|
||||
// indicates by percentage how close the policies and tags are to the upper size
|
||||
// limit. For more information, see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide. You could receive this error even though you meet other
|
||||
// defined session policy and session tag limits. For more information, see IAM
|
||||
// and STS Entity Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide.
|
||||
// limit. For more information, see [Passing Session Tags in STS]in the IAM User Guide.
|
||||
//
|
||||
// You could receive this error even though you meet other defined session policy
|
||||
// and session tag limits. For more information, see [IAM and STS Entity Character Limits]in the IAM User Guide.
|
||||
//
|
||||
// [Passing Session Tags in STS]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
||||
// [IAM and STS Entity Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-quotas.html#reference_iam-limits-entity-length
|
||||
type PackedPolicyTooLargeException struct {
|
||||
Message *string
|
||||
|
||||
@@ -215,9 +218,10 @@ func (e *PackedPolicyTooLargeException) ErrorFault() smithy.ErrorFault { return
|
||||
|
||||
// STS is not activated in the requested region for the account that is being
|
||||
// asked to generate credentials. The account administrator must use the IAM
|
||||
// console to activate STS in that region. For more information, see Activating
|
||||
// and Deactivating Amazon Web Services STS in an Amazon Web Services Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html)
|
||||
// in the IAM User Guide.
|
||||
// console to activate STS in that region. For more information, see [Activating and Deactivating STS in an Amazon Web Services Region]in the IAM
|
||||
// User Guide.
|
||||
//
|
||||
// [Activating and Deactivating STS in an Amazon Web Services Region]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html
|
||||
type RegionDisabledException struct {
|
||||
Message *string
|
||||
|
||||
|
||||
50
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go
generated
vendored
50
vendor/github.com/aws/aws-sdk-go-v2/service/sts/types/types.go
generated
vendored
@@ -11,10 +11,11 @@ import (
|
||||
// returns.
|
||||
type AssumedRoleUser struct {
|
||||
|
||||
// The ARN of the temporary security credentials that are returned from the
|
||||
// AssumeRole action. For more information about ARNs and how to use them in
|
||||
// policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
|
||||
// in the IAM User Guide.
|
||||
// The ARN of the temporary security credentials that are returned from the AssumeRole
|
||||
// action. For more information about ARNs and how to use them in policies, see [IAM Identifiers]in
|
||||
// the IAM User Guide.
|
||||
//
|
||||
// [IAM Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html
|
||||
//
|
||||
// This member is required.
|
||||
Arn *string
|
||||
@@ -61,8 +62,9 @@ type FederatedUser struct {
|
||||
|
||||
// The ARN that specifies the federated user that is associated with the
|
||||
// credentials. For more information about ARNs and how to use them in policies,
|
||||
// see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html)
|
||||
// in the IAM User Guide.
|
||||
// see [IAM Identifiers]in the IAM User Guide.
|
||||
//
|
||||
// [IAM Identifiers]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html
|
||||
//
|
||||
// This member is required.
|
||||
Arn *string
|
||||
@@ -81,9 +83,10 @@ type FederatedUser struct {
|
||||
type PolicyDescriptorType struct {
|
||||
|
||||
// The Amazon Resource Name (ARN) of the IAM managed policy to use as a session
|
||||
// policy for the role. For more information about ARNs, see Amazon Resource Names
|
||||
// (ARNs) and Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)
|
||||
// in the Amazon Web Services General Reference.
|
||||
// policy for the role. For more information about ARNs, see [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]in the Amazon Web
|
||||
// Services General Reference.
|
||||
//
|
||||
// [Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html
|
||||
Arn *string
|
||||
|
||||
noSmithyDocumentSerde
|
||||
@@ -107,23 +110,30 @@ type ProvidedContext struct {
|
||||
|
||||
// You can pass custom key-value pair attributes when you assume a role or
|
||||
// federate a user. These are called session tags. You can then use the session
|
||||
// tags to control access to resources. For more information, see Tagging Amazon
|
||||
// Web Services STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html)
|
||||
// in the IAM User Guide.
|
||||
// tags to control access to resources. For more information, see [Tagging Amazon Web Services STS Sessions]in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// [Tagging Amazon Web Services STS Sessions]: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html
|
||||
type Tag struct {
|
||||
|
||||
// The key for a session tag. You can pass up to 50 session tags. The plain text
|
||||
// session tag keys can’t exceed 128 characters. For these and additional limits,
|
||||
// see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide.
|
||||
// The key for a session tag.
|
||||
//
|
||||
// You can pass up to 50 session tags. The plain text session tag keys can’t
|
||||
// exceed 128 characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
||||
//
|
||||
// This member is required.
|
||||
Key *string
|
||||
|
||||
// The value for a session tag. You can pass up to 50 session tags. The plain text
|
||||
// session tag values can’t exceed 256 characters. For these and additional limits,
|
||||
// see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length)
|
||||
// in the IAM User Guide.
|
||||
// The value for a session tag.
|
||||
//
|
||||
// You can pass up to 50 session tags. The plain text session tag values can’t
|
||||
// exceed 256 characters. For these and additional limits, see [IAM and STS Character Limits]in the IAM User
|
||||
// Guide.
|
||||
//
|
||||
// [IAM and STS Character Limits]: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length
|
||||
//
|
||||
// This member is required.
|
||||
Value *string
|
||||
|
||||
42
vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go
generated
vendored
42
vendor/github.com/aws/aws-sdk-go-v2/service/sts/validators.go
generated
vendored
@@ -70,6 +70,26 @@ func (m *validateOpAssumeRoleWithWebIdentity) HandleInitialize(ctx context.Conte
|
||||
return next.HandleInitialize(ctx, in)
|
||||
}
|
||||
|
||||
type validateOpAssumeRoot struct {
|
||||
}
|
||||
|
||||
func (*validateOpAssumeRoot) ID() string {
|
||||
return "OperationInputValidation"
|
||||
}
|
||||
|
||||
func (m *validateOpAssumeRoot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
|
||||
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
|
||||
) {
|
||||
input, ok := in.Parameters.(*AssumeRootInput)
|
||||
if !ok {
|
||||
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
|
||||
}
|
||||
if err := validateOpAssumeRootInput(input); err != nil {
|
||||
return out, metadata, err
|
||||
}
|
||||
return next.HandleInitialize(ctx, in)
|
||||
}
|
||||
|
||||
type validateOpDecodeAuthorizationMessage struct {
|
||||
}
|
||||
|
||||
@@ -142,6 +162,10 @@ func addOpAssumeRoleWithWebIdentityValidationMiddleware(stack *middleware.Stack)
|
||||
return stack.Initialize.Add(&validateOpAssumeRoleWithWebIdentity{}, middleware.After)
|
||||
}
|
||||
|
||||
func addOpAssumeRootValidationMiddleware(stack *middleware.Stack) error {
|
||||
return stack.Initialize.Add(&validateOpAssumeRoot{}, middleware.After)
|
||||
}
|
||||
|
||||
func addOpDecodeAuthorizationMessageValidationMiddleware(stack *middleware.Stack) error {
|
||||
return stack.Initialize.Add(&validateOpDecodeAuthorizationMessage{}, middleware.After)
|
||||
}
|
||||
@@ -254,6 +278,24 @@ func validateOpAssumeRoleWithWebIdentityInput(v *AssumeRoleWithWebIdentityInput)
|
||||
}
|
||||
}
|
||||
|
||||
func validateOpAssumeRootInput(v *AssumeRootInput) error {
|
||||
if v == nil {
|
||||
return nil
|
||||
}
|
||||
invalidParams := smithy.InvalidParamsError{Context: "AssumeRootInput"}
|
||||
if v.TargetPrincipal == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("TargetPrincipal"))
|
||||
}
|
||||
if v.TaskPolicyArn == nil {
|
||||
invalidParams.Add(smithy.NewErrParamRequired("TaskPolicyArn"))
|
||||
}
|
||||
if invalidParams.Len() > 0 {
|
||||
return invalidParams
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
func validateOpDecodeAuthorizationMessageInput(v *DecodeAuthorizationMessageInput) error {
|
||||
if v == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user