Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlm committed Oct 27, 2023
1 parent d97bb82 commit 363b96c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 14 deletions.
26 changes: 12 additions & 14 deletions botocore/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,8 @@ def compute_client_args(
disable_request_compression=(
client_config.disable_request_compression
),
account_id_endpoint_mode=(
client_config.account_id_endpoint_mode
),
client_context_params=client_config.client_context_params,
account_id_endpoint_mode=client_config.account_id_endpoint_mode,
)
self._compute_retry_config(config_kwargs)
self._compute_connect_timeout(config_kwargs)
Expand Down Expand Up @@ -657,14 +656,16 @@ def _build_endpoint_resolver(
client_endpoint_url=endpoint_url,
legacy_endpoint_url=endpoint.host,
)
# botocore does not support client context parameters generically
# for every service. Instead, the s3 config section entries are
# available as client context parameters. In the future, endpoint
# rulesets of services other than s3/s3control may require client
# context parameters.
client_context = (
s3_config_raw if self._is_s3_service(service_name_raw) else {}
)
# Client context params for s3 conflict with the available settings
# in the `s3` parameter on the `Config` object. If the same parameter
# is set in both places, the value in the `s3` parameter takes priority.
if client_config is not None:
client_context = client_config.client_context_params or {}
else:
client_context = {}
if self._is_s3_service(service_name_raw):
client_context.update(s3_config_raw)

sig_version = (
client_config.signature_version
if client_config is not None
Expand Down Expand Up @@ -765,9 +766,6 @@ def compute_endpoint_resolver_builtin_defaults(
's3_disable_multiregion_access_points', False
),
EPRBuiltins.SDK_ENDPOINT: given_endpoint,
# account ID is calculated later if account based routing is
# enabled and configured for the service
EPRBuiltins.AWS_ACCOUNT_ID: None,
}

def _compute_user_agent_appid_config(self, config_kwargs):
Expand Down
10 changes: 10 additions & 0 deletions botocore/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ class Config:
Defaults to None.
:type client_context_params: dict
:param client_context_params: A dictionary of parameters specific to
individual services. If available, valid parameters can be found in
the ``Client Context Parameters`` section of the service client's
documentation. Invalid parameters or ones that are not used by the
specified service will be ignored.
Defaults to None.
:type account_id_endpoint_mode: str
:param account_id_endpoint_mode: Set account ID based endpoint behavior
for supported operations.
Expand Down Expand Up @@ -259,6 +268,7 @@ class Config:
('tcp_keepalive', None),
('request_min_compression_size_bytes', None),
('disable_request_compression', None),
('client_context_params', None),
('account_id_endpoint_mode', None),
]
)
Expand Down

0 comments on commit 363b96c

Please sign in to comment.