Skip to content

Update STS client to use new async config and fix failing container resolver tests - #79

Merged
arandito merged 3 commits into
aws:developfrom
arandito:update-sts-client-config
Aug 19, 2026
Merged

Update STS client to use new async config and fix failing container resolver tests#79
arandito merged 3 commits into
aws:developfrom
arandito:update-sts-client-config

Conversation

@arandito

Copy link
Copy Markdown
Contributor

Description

This PR makes two small runtime package updates:

aws-credentials-sts: adopts new async config API

Updates AssumeRoleCredentialsResolver to build its AsyncSTSClient from AsyncSTSConfig.resolve(...) instead of the deprecated synchronous Config. Config overrides (source credentials resolver, region, and optional transport) are now assembled into a dict and resolved asynchronously, with transport only set when an HTTP client is provided.

Warning

This depends on the parallel smithy-python change that deprecates the old Config in favor of AsyncSTSConfig (smithy-lang/smithy-python#758). It must be sim-shipped in the same release as that PR; releasing independently will break aws-credentials-sts (ImportError: cannot import name 'AsyncSTSConfig').

aws-credentials-http: normalize empty query strings

Fixes ContainerCredentialsResolver to pass query=parsed.query or None when resolving from AWS_CONTAINER_CREDENTIALS_FULL_URI. urlparse yields '' for a query-less URL, and the current URI no longer normalizes that to None, so the constructed request URI didn't match expectations.

Testing

Ran the container credentials resolver unit tests standalone:

cd packages/aws-credentials-http
uv run --no-project --python 3.12 \
  --with pytest --with pytest-asyncio \
  --with-editable . \
  python -m pytest tests/unit/test_resolvers.py -o asyncio_mode=auto

All 12 tests pass, including the four test_resolver_env_* cases that previously failed on the empty-query-string mismatch.

9 aws-credentials-sts resolver tests currently fail with ImportError: cannot import name 'AsyncSTSConfig' from 'aws_sdk_sts.config' until smithy-python#758 ships the new async config. Nothing to do here until that lands; they'll pass once the two are released together.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@arandito
arandito requested a review from a team as a code owner August 16, 2026 20:15
Alan4506
Alan4506 previously approved these changes Aug 18, 2026

@Alan4506 Alan4506 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks @arandito

@arandito
arandito merged commit a30554f into aws:develop Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants