Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Change Log

## Unreleased

### Features

* Generated clients support the `smithy.api#httpBearerAuth` trait. A service that
models it gets `token` and `token_identity_resolver` configuration settings,
and an operation whose selected auth scheme is bearer auth sends an
`Authorization: Bearer` header. Auth scheme selection is unchanged: the first
scheme in an operation's effective auth list that the client supports is used,
so a service that lists SigV4 before bearer auth keeps signing with SigV4. AWS
clients default `token_identity_resolver` during setup: a configured `token`
is used through a static resolver, otherwise the default token identity chain
is consulted, so neither needs a resolver wired by hand.

## v0.7.0

### Breaking Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"src/awsjson10_client/_private/endpoints.py": "7d515fe771678e82ddbe07798d6b7e48c25c6c9bec19cec9318deb0bc5064ead",
"src/awsjson10_client/_private/schemas.py": "0e254d9f031858bb9894d35adbceb708ad3d77db5030ce91ff0c4e150ba04657",
"src/awsjson10_client/aio/__init__.py": "e2072bcfa8185b3654fd315c0b92205140c5d22ddfc4ac50c80bb9089bda8d75",
"src/awsjson10_client/aio/client.py": "73a0aa14e302d9f6c78e8a3b1826fff1ef3b9400924427994060e13c6284e25b",
"src/awsjson10_client/aio/client.py": "c1aa051a7134d273207f087fca9a82a49c82499733743989814db9692bdfc570",
"src/awsjson10_client/aio/config.py": "e0cad1296e2f5ff787dc36970a313b4d513a7e41657ad4378c066eebd2f79ff8",
"src/awsjson10_client/aio/user_agent.py": "8e17f04fa14a0e1721e55beefbfa640c838b53be7c231f020d2ff3ed2f63f20a",
"src/awsjson10_client/client.py": "563cbfe08624995592db27c00cec6e842b9cb36b91cf4f01117a71504eb2fdb8",
"src/awsjson10_client/client.py": "11a93375acec68f90242a5230c4f0b41bd38fe99a3e58e8ff116c56c7aa613b3",
"src/awsjson10_client/config.py": "61faff2b618079bb89719d418f14bac84981983d65fbc9fa587cb61a4779ff41",
"src/awsjson10_client/models.py": "d184b6f8288bd787f23c6f119a0a1259e1a468fb487c3d9c2c710825d390636a",
"src/awsjson10_client/models.pyi": "fc5bc36883b8b0851132826edfa5b51dbf7a2023e94b357dccac383878ff9d02",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Unpack, cast, overload

from smithy_aws_core.aio.identity.chain import AsyncIdentityChain
from smithy_aws_core.config.merged_config import MergedConfig
from smithy_aws_core.config.types import ConfigSource
from smithy_aws_core.identity.components import AWSCredentialsIdentity
from smithy_core.aio.client import AsyncClient
Expand Down Expand Up @@ -663,17 +664,23 @@ async def _new_config(self) -> AsyncJSONRPC10Config:

async def _post_setup(self, config: AsyncJSONRPC10Config) -> None:
if config.aws_credentials_identity_resolver is None:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = await config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
config_file, profile_name = await self._profile_overrides(config)
config.aws_credentials_identity_resolver = await AsyncIdentityChain.create(
AWSCredentialsIdentity,
config_file=config_file,
profile_name=profile_name,
region_override=config.region,
http_client=cast(AsyncHTTPClient | None, config.transport),
)

async def _profile_overrides(
self, config: AsyncJSONRPC10Config
) -> tuple[MergedConfig | None, str | None]:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = await config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
return config_file, profile_name
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from typing import Unpack, cast, overload

from smithy_aws_core.config.merged_config import MergedConfig
from smithy_aws_core.config.types import ConfigSource
from smithy_aws_core.identity.chain.resolver import IdentityChain
from smithy_aws_core.identity.components import AWSCredentialsIdentity
Expand Down Expand Up @@ -663,17 +664,23 @@ def _new_config(self) -> JSONRPC10Config:

def _post_setup(self, config: JSONRPC10Config) -> None:
if config.aws_credentials_identity_resolver is None:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
config_file, profile_name = self._profile_overrides(config)
config.aws_credentials_identity_resolver = IdentityChain.create(
AWSCredentialsIdentity,
config_file=config_file,
profile_name=profile_name,
region_override=config.region,
http_client=cast(HTTPClient | None, config.transport),
)

def _profile_overrides(
self, config: JSONRPC10Config
) -> tuple[MergedConfig | None, str | None]:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
return config_file, profile_name
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"src/awsjson11_client/_private/endpoints.py": "7d515fe771678e82ddbe07798d6b7e48c25c6c9bec19cec9318deb0bc5064ead",
"src/awsjson11_client/_private/schemas.py": "39f6fcaed62547b27d149c3a2eb7c591b05d140eb4b63520b5c49ecf30e17c99",
"src/awsjson11_client/aio/__init__.py": "d4cd42353a6f80219be93c41d60c27b752e90e223bf4f37d0162c9456fdb48e5",
"src/awsjson11_client/aio/client.py": "baf961512a50ce2dab0ee2bc6d9189d8bd785edcbf2efb46b531343caa66a85f",
"src/awsjson11_client/aio/client.py": "f3b8546d09c34019151871a1160e6f6f60b001fa5c4885e6aff34c99f8db9a74",
"src/awsjson11_client/aio/config.py": "699e202d28d8d0943b4e07ed41c08ee772f174a88017e8e0f1e435a2d193b1f8",
"src/awsjson11_client/aio/user_agent.py": "61bfd1fdbc339bc5b696baee392aa7428d6cd663c950c64d0658e7d188c53762",
"src/awsjson11_client/client.py": "2a140fab0f809dfd001ffb2bbb713c76967faae423f190fc000f894c28633f8f",
"src/awsjson11_client/client.py": "7d5d9bad6a5deae31ac8cc3382a8c3156adf3684227ff1374efb4dd3a8fde54a",
"src/awsjson11_client/config.py": "c02462cacf45deaaa602692fe7157d1c8136ca016b850dbac9e77b7368e1b503",
"src/awsjson11_client/models.py": "3e666b01d5b536476b4d0b990b8f39a73bd9479484bc931e08f684fbeae68f73",
"src/awsjson11_client/models.pyi": "a018f0bbb86538b80a7a59a84ebba899a773a18a3a38a905d1a14501a76ae736",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Unpack, cast, overload

from smithy_aws_core.aio.identity.chain import AsyncIdentityChain
from smithy_aws_core.config.merged_config import MergedConfig
from smithy_aws_core.config.types import ConfigSource
from smithy_aws_core.identity.components import AWSCredentialsIdentity
from smithy_core.aio.client import AsyncClient
Expand Down Expand Up @@ -729,17 +730,23 @@ async def _new_config(self) -> AsyncJsonProtocolConfig:

async def _post_setup(self, config: AsyncJsonProtocolConfig) -> None:
if config.aws_credentials_identity_resolver is None:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = await config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
config_file, profile_name = await self._profile_overrides(config)
config.aws_credentials_identity_resolver = await AsyncIdentityChain.create(
AWSCredentialsIdentity,
config_file=config_file,
profile_name=profile_name,
region_override=config.region,
http_client=cast(AsyncHTTPClient | None, config.transport),
)

async def _profile_overrides(
self, config: AsyncJsonProtocolConfig
) -> tuple[MergedConfig | None, str | None]:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = await config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
return config_file, profile_name
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from typing import Unpack, cast, overload

from smithy_aws_core.config.merged_config import MergedConfig
from smithy_aws_core.config.types import ConfigSource
from smithy_aws_core.identity.chain.resolver import IdentityChain
from smithy_aws_core.identity.components import AWSCredentialsIdentity
Expand Down Expand Up @@ -729,17 +730,23 @@ def _new_config(self) -> JsonProtocolConfig:

def _post_setup(self, config: JsonProtocolConfig) -> None:
if config.aws_credentials_identity_resolver is None:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
config_file, profile_name = self._profile_overrides(config)
config.aws_credentials_identity_resolver = IdentityChain.create(
AWSCredentialsIdentity,
config_file=config_file,
profile_name=profile_name,
region_override=config.region,
http_client=cast(HTTPClient | None, config.transport),
)

def _profile_overrides(
self, config: JsonProtocolConfig
) -> tuple[MergedConfig | None, str | None]:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
return config_file, profile_name
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"src/awsquery_client/_private/schemas_0.py": "96539de684f03d833c79986ea8455d88a33452a8939d0c24b2ed04297c7a0ba8",
"src/awsquery_client/_private/schemas_1.py": "86827c7b2d76df0d807fef2eaea9a2adff341e1c9654d614660390cb0a74c4a4",
"src/awsquery_client/aio/__init__.py": "5e4e7a9c5f95792a358199470b872eba950c87bbb217ef90ef0d989be262c98e",
"src/awsquery_client/aio/client.py": "b7f8bc1f885231936bae89e7265bc4550dc75021bd35a25390a4051e67779460",
"src/awsquery_client/aio/client.py": "7319bee1816d0360a0abc52081365b9c2a6eacb2e352eb3d66a2c2078faf6f23",
"src/awsquery_client/aio/config.py": "9cf69159d776b5d488d682a9fdeb18da7362475418a521facfa30acd0321674d",
"src/awsquery_client/aio/user_agent.py": "5a444990482102365629342212190546cd5ad1a570875d1a5302fc1ceafe927c",
"src/awsquery_client/client.py": "fb813213eb1fe084b23a8d6f21322460b0a067a41cdb3bf8195da800249e68fc",
"src/awsquery_client/client.py": "863af7ca0d9d23acf801674eff74c3d79a6c7ddd733a3981913063f1b2366177",
"src/awsquery_client/config.py": "eeaeb33b4efc999d912a1bf4ecc856d9f1acf38fc43098e6e3eae4c2c93f2345",
"src/awsquery_client/models.py": "ba8d5724acbbfa51527fe38b734a9fe445374669c6e5bc45b68ef42729992e7a",
"src/awsquery_client/models.pyi": "8fc34c50f68078076864f73385f35c82e005bd2547c1bae448a4ed618cfa04ec",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Unpack, cast, overload

from smithy_aws_core.aio.identity.chain import AsyncIdentityChain
from smithy_aws_core.config.merged_config import MergedConfig
from smithy_aws_core.config.types import ConfigSource
from smithy_aws_core.identity.components import AWSCredentialsIdentity
from smithy_core.aio.client import AsyncClient
Expand Down Expand Up @@ -1325,17 +1326,23 @@ async def _new_config(self) -> AsyncQueryProtocolConfig:

async def _post_setup(self, config: AsyncQueryProtocolConfig) -> None:
if config.aws_credentials_identity_resolver is None:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = await config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
config_file, profile_name = await self._profile_overrides(config)
config.aws_credentials_identity_resolver = await AsyncIdentityChain.create(
AWSCredentialsIdentity,
config_file=config_file,
profile_name=profile_name,
region_override=config.region,
http_client=cast(AsyncHTTPClient | None, config.transport),
)

async def _profile_overrides(
self, config: AsyncQueryProtocolConfig
) -> tuple[MergedConfig | None, str | None]:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = await config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
return config_file, profile_name
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from typing import Unpack, cast, overload

from smithy_aws_core.config.merged_config import MergedConfig
from smithy_aws_core.config.types import ConfigSource
from smithy_aws_core.identity.chain.resolver import IdentityChain
from smithy_aws_core.identity.components import AWSCredentialsIdentity
Expand Down Expand Up @@ -1325,17 +1326,23 @@ def _new_config(self) -> QueryProtocolConfig:

def _post_setup(self, config: QueryProtocolConfig) -> None:
if config.aws_credentials_identity_resolver is None:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
config_file, profile_name = self._profile_overrides(config)
config.aws_credentials_identity_resolver = IdentityChain.create(
AWSCredentialsIdentity,
config_file=config_file,
profile_name=profile_name,
region_override=config.region,
http_client=cast(HTTPClient | None, config.transport),
)

def _profile_overrides(
self, config: QueryProtocolConfig
) -> tuple[MergedConfig | None, str | None]:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
return config_file, profile_name
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
"src/ec2query_client/_private/schemas_0.py": "fd38636fd4686fab8a18471c718b8c4afe46e8febf745b1d047dd41c0c2bf0b3",
"src/ec2query_client/_private/schemas_1.py": "9a1cf238ab2cfcb1fbab3df7acccaacd1ace61baa9de9fd4430f1f5df57649c0",
"src/ec2query_client/aio/__init__.py": "6df0f4c936c7a0cbfe94ba3b1c86421accf3f9245fa221f2c4eb614475815417",
"src/ec2query_client/aio/client.py": "1dc7c650e2bc805ba35de0190635d6cd2bab44889fb8f5523261ae937e5c054c",
"src/ec2query_client/aio/client.py": "a48db31c07c1e01f9e52923b876331d1c2530492ae234aab5d8a98dba3fc30b0",
"src/ec2query_client/aio/config.py": "b6835785884b8f77ef3cde79a971ae4af1a8d339325631500fa45f8f3709e64d",
"src/ec2query_client/aio/user_agent.py": "31e71334b85dd5aed20999fc242b81a701dde1f5ac05fc09240b283fa3cb2487",
"src/ec2query_client/client.py": "4bdaace39de24d50047da804ed029f4dd4e06fe4d4f94250ae8ec95737675d80",
"src/ec2query_client/client.py": "c3f61fcf30b6a8a3e807105328603e25badddf42b6896e3a0d952a04d595d669",
"src/ec2query_client/config.py": "c67f2a35e85a5c525026b14e4840abe7aa1649d8b9f268715a0fee496405581d",
"src/ec2query_client/models.py": "5940a13b794437fdb3e2c07beed5113568acea02b15386c567cb264eaaa2d265",
"src/ec2query_client/models.pyi": "d8c4f4a7ee329c145f60143cc5714c60490c58ca65a56151d4270f69360dec4d",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from typing import Unpack, cast, overload

from smithy_aws_core.aio.identity.chain import AsyncIdentityChain
from smithy_aws_core.config.merged_config import MergedConfig
from smithy_aws_core.config.types import ConfigSource
from smithy_aws_core.identity.components import AWSCredentialsIdentity
from smithy_core.aio.client import AsyncClient
Expand Down Expand Up @@ -1012,17 +1013,23 @@ async def _new_config(self) -> AsyncEC2ProtocolConfig:

async def _post_setup(self, config: AsyncEC2ProtocolConfig) -> None:
if config.aws_credentials_identity_resolver is None:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = await config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
config_file, profile_name = await self._profile_overrides(config)
config.aws_credentials_identity_resolver = await AsyncIdentityChain.create(
AWSCredentialsIdentity,
config_file=config_file,
profile_name=profile_name,
region_override=config.region,
http_client=cast(AsyncHTTPClient | None, config.transport),
)

async def _profile_overrides(
self, config: AsyncEC2ProtocolConfig
) -> tuple[MergedConfig | None, str | None]:
config_context = config.resolution_context()
config_file = None
profile_name = None
if config_context is not None:
config_file = await config_context.parsed_profiles()
if config_context.profile_source is ConfigSource.OVERRIDE:
profile_name = config_context.profile_name
return config_file, profile_name
Loading
Loading