MCPcopy Create free account
hub / github.com/aws/aws-cli / _default_get_make_request_args

Method _default_get_make_request_args

awscli/s3transfer/crt.py:838–890  ·  view source on GitHub ↗
(
        self,
        request_type,
        call_args,
        coordinator,
        future,
        on_done_before_calls,
        on_done_after_calls,
    )

Source from the content-addressed store, hash-verified

836 return make_request_args
837
838 def _default_get_make_request_args(
839 self,
840 request_type,
841 call_args,
842 coordinator,
843 future,
844 on_done_before_calls,
845 on_done_after_calls,
846 ):
847 make_request_args = {
848 'request': self._request_serializer.serialize_http_request(
849 request_type, future
850 ),
851 'type': getattr(
852 S3RequestType, request_type.upper(), S3RequestType.DEFAULT
853 ),
854 'on_done': self.get_crt_callback(
855 future, 'done', on_done_before_calls, on_done_after_calls
856 ),
857 'on_progress': self.get_crt_callback(future, 'progress'),
858 }
859
860 # For DEFAULT requests, CRT requires the official S3 operation name.
861 # So transform string like "delete_object" -> "DeleteObject".
862 if make_request_args['type'] == S3RequestType.DEFAULT:
863 make_request_args['operation_name'] = ''.join(
864 x.title() for x in request_type.split('_')
865 )
866
867 arn_handler = _S3ArnParamHandler()
868 if (
869 accesspoint_arn_details := arn_handler.handle_arn(call_args.bucket)
870 ) and accesspoint_arn_details['region'] == "":
871 # Configure our region to `*` to propogate in `x-amz-region-set`
872 # for multi-region support in MRAP accesspoints.
873 # use_double_uri_encode and should_normalize_uri_path are defaulted to be True
874 # But SDK already encoded the URI, and it's for S3, so set both to False
875 make_request_args['signing_config'] = AwsSigningConfig(
876 algorithm=AwsSigningAlgorithm.V4_ASYMMETRIC,
877 region="*",
878 use_double_uri_encode=False,
879 should_normalize_uri_path=False,
880 )
881 call_args.bucket = accesspoint_arn_details['resource_name']
882 elif is_s3express_bucket(call_args.bucket):
883 # use_double_uri_encode and should_normalize_uri_path are defaulted to be True
884 # But SDK already encoded the URI, and it's for S3, so set both to False
885 make_request_args['signing_config'] = AwsSigningConfig(
886 algorithm=AwsSigningAlgorithm.V4_S3EXPRESS,
887 use_double_uri_encode=False,
888 should_normalize_uri_path=False,
889 )
890 return make_request_args
891
892
893class RenameTempFileHandler:

Calls 6

get_crt_callbackMethod · 0.95
is_s3express_bucketFunction · 0.90
_S3ArnParamHandlerClass · 0.85
titleMethod · 0.80
handle_arnMethod · 0.45

Tested by

no test coverage detected