Skip to content

Commit

Permalink
Factor out AWS_STS_REGIONAL_ENDPOINTS to allow customization (#3257)
Browse files Browse the repository at this point in the history
  • Loading branch information
nateprewitt committed Sep 18, 2024
1 parent e6067fb commit cdda202
Showing 1 changed file with 22 additions and 6 deletions.
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

0 comments on commit cdda202

Please sign in to comment.