Skip to content

Commit 1dd91f7

Browse files
authored
Merge branch 'master' into forbid-new-connections-once-aexited
2 parents b904ba1 + d4eeb84 commit 1dd91f7

File tree

18 files changed

+581
-485
lines changed

18 files changed

+581
-485
lines changed

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ jobs:
124124
REF_NAME: ${{ github.ref_name }}
125125
- name: Publish distribution 📦 to PyPI
126126
# yamllint disable-line rule:line-length
127-
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
127+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

.github/workflows/reusable-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
persist-credentials: false
2222
- name: Install uv
2323
# yamllint disable-line rule:line-length
24-
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v6.6.0
24+
uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 # v6.6.1
2525
with:
2626
# yamllint disable-line rule:line-length
2727
enable-cache: | # zizmor: ignore[cache-poisoning] cache is disabled when publishing to prevent poisoning

.github/workflows/reusable-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
submodules: true
4747
- name: Install uv
4848
# yamllint disable-line rule:line-length
49-
uses: astral-sh/setup-uv@4959332f0f014c5280e7eac8b70c90cb574c9f9b # v6.6.0
49+
uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 # v6.6.1
5050
with:
5151
python-version: ${{ inputs.python-version }}
5252
enable-cache: ${{ inputs.enable-cache }}
@@ -68,7 +68,7 @@ jobs:
6868
uv run make mototest
6969
- name: Upload coverage to Codecov
7070
# yamllint disable-line rule:line-length
71-
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5.5.0
71+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
7272
with:
7373
token: ${{ secrets.codecov-token }} # not required for public repos
7474
files: ./coverage.xml

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
timeout-minutes: 5
2323

2424
steps:
25-
- uses: actions/stale@v9
25+
- uses: actions/stale@v10
2626
with:
2727
stale-issue-message: >-
2828
This issue has been marked as stale because it has been inactive for

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
args: [--fix]
1818
- id: ruff-format
1919
- repo: https://github.com/astral-sh/uv-pre-commit
20-
rev: 0.8.11
20+
rev: 0.8.15
2121
hooks:
2222
- id: uv-lock
2323
- repo: https://github.com/adrienverge/yamllint

aiobotocore/credentials.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
from copy import deepcopy
66

77
import botocore.compat
8+
import dateutil.parser
89
from botocore import UNSIGNED
9-
from botocore.compat import compat_shell_split
10+
from botocore.compat import compat_shell_split, total_seconds
1011
from botocore.config import Config
1112
from botocore.credentials import (
1213
_DEFAULT_ADVISORY_REFRESH_TIMEOUT,
@@ -1048,7 +1049,16 @@ async def _get_credentials(self):
10481049
initial_token_data = self._token_provider.load_token()
10491050
token = (await initial_token_data.get_frozen_token()).token
10501051
else:
1051-
token = self._token_loader(self._start_url)['accessToken']
1052+
token_dict = self._token_loader(self._start_url)
1053+
token = token_dict['accessToken']
1054+
1055+
# raise an UnauthorizedSSOTokenError if the loaded legacy token
1056+
# is expired to save a call to GetRoleCredentials with an
1057+
# expired token.
1058+
expiration = dateutil.parser.parse(token_dict['expiresAt'])
1059+
remaining = total_seconds(expiration - self._time_fetcher())
1060+
if remaining <= 0:
1061+
raise UnauthorizedSSOTokenError()
10521062

10531063
kwargs = {
10541064
'roleName': self._role_name,

aiobotocore/discovery.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ async def describe_endpoint(self, **kwargs):
3333
if not self._always_discover and not discovery_required:
3434
# Discovery set to only run on required operations
3535
logger.debug(
36-
f'Optional discovery disabled. Skipping discovery for Operation: {operation}'
36+
'Optional discovery disabled. Skipping discovery for Operation: %s',
37+
operation,
3738
)
3839
return None
3940

aiobotocore/httpchecksum.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ async def handle_checksum_body(
196196
return
197197

198198
logger.debug(
199-
f'Skipping checksum validation. Response did not contain one of the '
200-
f'following algorithms: {algorithms}.'
199+
'Skipping checksum validation. Response did not contain one of the following algorithms: %s.',
200+
algorithms,
201201
)
202202

203203

aiobotocore/regions.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async def construct_endpoint(
2727
operation_model, call_args, request_context
2828
)
2929
LOG.debug(
30-
f'Calling endpoint provider with parameters: {provider_params}'
30+
'Calling endpoint provider with parameters: %s', provider_params
3131
)
3232
try:
3333
provider_result = self._provider.resolve_endpoint(
@@ -41,10 +41,14 @@ async def construct_endpoint(
4141
raise
4242
else:
4343
raise botocore_exception from ex
44-
LOG.debug(f'Endpoint provider result: {provider_result.url}')
44+
LOG.debug('Endpoint provider result: %s', provider_result.url)
4545

4646
# The endpoint provider does not support non-secure transport.
47-
if not self._use_ssl and provider_result.url.startswith('https://'):
47+
if (
48+
not self._use_ssl
49+
and provider_result.url.startswith('https://')
50+
and 'Endpoint' not in provider_params
51+
):
4852
provider_result = provider_result._replace(
4953
url=f'http://{provider_result.url[8:]}'
5054
)

aiobotocore/session.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,9 @@ async def _create_client(
191191
aws_session_token, aws_account_id
192192
):
193193
logger.debug(
194-
f"Ignoring the following credential-related values which were set without "
195-
f"an access key id and secret key on the session or client: {ignored_credentials}"
194+
"Ignoring the following credential-related values which were set without "
195+
"an access key id and secret key on the session or client: %s",
196+
ignored_credentials,
196197
)
197198
credentials = await self.get_credentials()
198199
auth_token = self.get_auth_token()

0 commit comments

Comments
 (0)