Skip to content
Snippets Groups Projects
Verified Commit 12c7fb3e authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: update packages

parent ff6f3c8b
No related branches found
No related tags found
No related merge requests found
Showing
with 240 additions and 2 deletions
# v1.30.1 (2025-04-03)
* No change notes available for this release.
# v1.30.0 (2025-03-27)
* **Feature**: This release adds AwsAdditionalDetails in the CreateTokenWithIAM API response.
# v1.29.2 (2025-03-24)
* No change notes available for this release.
# v1.29.1 (2025-03-04.2)
* **Bug Fix**: Add assurance test for operation order.
# v1.29.0 (2025-02-27)
* **Feature**: Track credential providers via User-Agent Feature ids
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.15 (2025-02-18)
* **Bug Fix**: Bump go version to 1.22
* **Dependency Update**: Updated to the latest SDK module versions
# v1.28.14 (2025-02-05)
* **Dependency Update**: Updated to the latest SDK module versions
......
......@@ -761,6 +761,37 @@ func addUserAgentRetryMode(stack *middleware.Stack, options Options) error {
return nil
}
type setCredentialSourceMiddleware struct {
ua *awsmiddleware.RequestUserAgent
options Options
}
func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" }
func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (
out middleware.BuildOutput, metadata middleware.Metadata, err error,
) {
asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource)
if !ok {
return next.HandleBuild(ctx, in)
}
providerSources := asProviderSource.ProviderSources()
for _, source := range providerSources {
m.ua.AddCredentialsSource(source)
}
return next.HandleBuild(ctx, in)
}
func addCredentialSource(stack *middleware.Stack, options Options) error {
ua, err := getOrAddRequestUserAgent(stack)
if err != nil {
return err
}
mw := setCredentialSourceMiddleware{ua: ua, options: options}
return stack.Build.Insert(&mw, "UserAgent", middleware.Before)
}
func resolveTracerProvider(options *Options) {
if options.TracerProvider == nil {
options.TracerProvider = &tracing.NopTracerProvider{}
......
......@@ -194,6 +194,9 @@ func (c *Client) addOperationCreateTokenMiddlewares(stack *middleware.Stack, opt
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpCreateTokenValidationMiddleware(stack); err != nil {
return err
}
......
......@@ -6,6 +6,7 @@ import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/service/ssooidc/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
......@@ -123,6 +124,11 @@ type CreateTokenWithIAMOutput struct {
// to a user.
AccessToken *string
// A structure containing information from the idToken . Only the identityContext
// is in it, which is a value extracted from the idToken . This provides direct
// access to identity information without requiring JWT parsing.
AwsAdditionalDetails *types.AwsAdditionalDetails
// Indicates the time in seconds when an access token will expire.
ExpiresIn int32
......@@ -226,6 +232,9 @@ func (c *Client) addOperationCreateTokenWithIAMMiddlewares(stack *middleware.Sta
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpCreateTokenWithIAMValidationMiddleware(stack); err != nil {
return err
}
......
......@@ -164,6 +164,9 @@ func (c *Client) addOperationRegisterClientMiddlewares(stack *middleware.Stack,
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpRegisterClientValidationMiddleware(stack); err != nil {
return err
}
......
......@@ -146,6 +146,9 @@ func (c *Client) addOperationStartDeviceAuthorizationMiddlewares(stack *middlewa
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpStartDeviceAuthorizationValidationMiddleware(stack); err != nil {
return err
}
......
......@@ -435,6 +435,11 @@ func awsRestjson1_deserializeOpDocumentCreateTokenWithIAMOutput(v **CreateTokenW
sv.AccessToken = ptr.String(jtv)
}
case "awsAdditionalDetails":
if err := awsRestjson1_deserializeDocumentAwsAdditionalDetails(&sv.AwsAdditionalDetails, value); err != nil {
return err
}
case "expiresIn":
if value != nil {
jtv, ok := value.(json.Number)
......@@ -1545,6 +1550,46 @@ func awsRestjson1_deserializeDocumentAuthorizationPendingException(v **types.Aut
return nil
}
func awsRestjson1_deserializeDocumentAwsAdditionalDetails(v **types.AwsAdditionalDetails, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AwsAdditionalDetails
if *v == nil {
sv = &types.AwsAdditionalDetails{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "identityContext":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected IdentityContext to be of type string, got %T instead", value)
}
sv.IdentityContext = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentExpiredTokenException(v **types.ExpiredTokenException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
......
......@@ -25,11 +25,12 @@
"protocol_test.go",
"serializers.go",
"snapshot_test.go",
"sra_operation_order_test.go",
"types/errors.go",
"types/types.go",
"validators.go"
],
"go": "1.15",
"go": "1.22",
"module": "github.com/aws/aws-sdk-go-v2/service/ssooidc",
"unstable": false
}
......@@ -3,4 +3,4 @@
package ssooidc
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.28.14"
const goModuleVersion = "1.30.1"
......@@ -87,6 +87,7 @@ func New() *Resolver {
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsEusc *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
......@@ -96,6 +97,7 @@ var partitionRegexp = struct {
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
......@@ -227,6 +229,14 @@ var defaultPartitions = endpoints.Partitions{
Region: "ap-southeast-4",
},
},
endpoints.EndpointKey{
Region: "ap-southeast-5",
}: endpoints.Endpoint{
Hostname: "oidc.ap-southeast-5.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "ap-southeast-5",
},
},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{
......@@ -426,6 +436,27 @@ var defaultPartitions = endpoints.Partitions{
},
},
},
{
ID: "aws-eusc",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "oidc-fips.{region}.amazonaws.eu",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "oidc.{region}.amazonaws.eu",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsEusc,
IsRegionalized: true,
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
......
......@@ -6,4 +6,17 @@ import (
smithydocument "github.com/aws/smithy-go/document"
)
// This structure contains Amazon Web Services-specific parameter extensions for
// the token endpoint responses and includes the identity context.
type AwsAdditionalDetails struct {
// STS context assertion that carries a user identifier to the Amazon Web Services
// service that it calls and can be used to obtain an identity-enhanced IAM role
// session. This value corresponds to the sts:identity_context claim in the ID
// token.
IdentityContext *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
# v1.33.19 (2025-04-10)
* No change notes available for this release.
# v1.33.18 (2025-04-03)
* No change notes available for this release.
# v1.33.17 (2025-03-04.2)
* **Bug Fix**: Add assurance test for operation order.
# v1.33.16 (2025-02-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.33.15 (2025-02-18)
* **Bug Fix**: Bump go version to 1.22
* **Dependency Update**: Updated to the latest SDK module versions
# v1.33.14 (2025-02-05)
* **Dependency Update**: Updated to the latest SDK module versions
......
......@@ -765,6 +765,37 @@ func addUserAgentRetryMode(stack *middleware.Stack, options Options) error {
return nil
}
type setCredentialSourceMiddleware struct {
ua *awsmiddleware.RequestUserAgent
options Options
}
func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" }
func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) (
out middleware.BuildOutput, metadata middleware.Metadata, err error,
) {
asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource)
if !ok {
return next.HandleBuild(ctx, in)
}
providerSources := asProviderSource.ProviderSources()
for _, source := range providerSources {
m.ua.AddCredentialsSource(source)
}
return next.HandleBuild(ctx, in)
}
func addCredentialSource(stack *middleware.Stack, options Options) error {
ua, err := getOrAddRequestUserAgent(stack)
if err != nil {
return err
}
mw := setCredentialSourceMiddleware{ua: ua, options: options}
return stack.Build.Insert(&mw, "UserAgent", middleware.Before)
}
func resolveTracerProvider(options *Options) {
if options.TracerProvider == nil {
options.TracerProvider = &tracing.NopTracerProvider{}
......
......@@ -478,6 +478,9 @@ func (c *Client) addOperationAssumeRoleMiddlewares(stack *middleware.Stack, opti
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpAssumeRoleValidationMiddleware(stack); err != nil {
return err
}
......
......@@ -410,6 +410,9 @@ func (c *Client) addOperationAssumeRoleWithSAMLMiddlewares(stack *middleware.Sta
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpAssumeRoleWithSAMLValidationMiddleware(stack); err != nil {
return err
}
......
......@@ -430,6 +430,9 @@ func (c *Client) addOperationAssumeRoleWithWebIdentityMiddlewares(stack *middlew
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpAssumeRoleWithWebIdentityValidationMiddleware(stack); err != nil {
return err
}
......
......@@ -175,6 +175,9 @@ func (c *Client) addOperationAssumeRootMiddlewares(stack *middleware.Stack, opti
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpAssumeRootValidationMiddleware(stack); err != nil {
return err
}
......
......@@ -147,6 +147,9 @@ func (c *Client) addOperationDecodeAuthorizationMessageMiddlewares(stack *middle
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpDecodeAuthorizationMessageValidationMiddleware(stack); err != nil {
return err
}
......
......@@ -138,6 +138,9 @@ func (c *Client) addOperationGetAccessKeyInfoMiddlewares(stack *middleware.Stack
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = addOpGetAccessKeyInfoValidationMiddleware(stack); err != nil {
return err
}
......
......@@ -129,6 +129,9 @@ func (c *Client) addOperationGetCallerIdentityMiddlewares(stack *middleware.Stac
if err = addUserAgentRetryMode(stack, options); err != nil {
return err
}
if err = addCredentialSource(stack, options); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCallerIdentity(options.Region), middleware.Before); err != nil {
return err
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment