Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factor out AWS_STS_REGIONAL_ENDPOINTS to allow customization #3257

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Changes from all commits
Commits
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
28 changes: 22 additions & 6 deletions botocore/configprovider.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,6 @@
'auto',
None,
),
'sts_regional_endpoints': (
'sts_regional_endpoints',
'AWS_STS_REGIONAL_ENDPOINTS',
'legacy',
None,
),
'retry_mode': ('retry_mode', 'AWS_RETRY_MODE', 'legacy', None),
'defaults_mode': ('defaults_mode', 'AWS_DEFAULTS_MODE', 'legacy', None),
# We can't have a default here for v1 because we need to defer to
Expand All @@ -175,6 +169,28 @@
None,
),
}

# Evaluate AWS_STS_REGIONAL_ENDPOINTS settings
try:
# This is not a public interface and is subject to abrupt breaking changes.
# Any usage is not advised or supported in external code bases.
from botocore.customizations.sts import (
sts_default_setting as _sts_default_setting,
)
except ImportError:
_sts_default_setting = 'legacy'

_STS_DEFAULT_SETTINGS = {
'sts_regional_endpoints': (
'sts_regional_endpoints',
'AWS_STS_REGIONAL_ENDPOINTS',
_sts_default_setting,
None,
),
}
BOTOCORE_DEFAUT_SESSION_VARIABLES.update(_STS_DEFAULT_SETTINGS)


# A mapping for the s3 specific configuration vars. These are the configuration
# vars that typically go in the s3 section of the config file. This mapping
# follows the same schema as the previous session variable mapping.
Expand Down
Loading