From 127adc9ec1aa2316a3f323a074c2d1a8d7e86d31 Mon Sep 17 00:00:00 2001 From: Michael Graeb Date: Tue, 17 Oct 2023 15:50:59 -0700 Subject: [PATCH] Don't expose client-option compute_content_md5. It would be better as a request-option, but changing that would be a lot of work. Also, flexible-checksums are better in every way. So let's only expose those for now. --- awscrt/s3.py | 15 +-------------- source/s3_client.c | 5 +---- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/awscrt/s3.py b/awscrt/s3.py index b254a9f13..26432270a 100644 --- a/awscrt/s3.py +++ b/awscrt/s3.py @@ -141,14 +141,6 @@ class S3Client(NativeResource): throughput_target_gbps (Optional[float]): Throughput target in Gbps that we are trying to reach. (5 Gbps by default) - - compute_content_md5 (Optional[bool]): - Whether to calculate and add the "Content-MD5" header to upload - requests that could use it (no other checksum algorithm is being used, - and the header is not already present or the upload is being split - into parts). For single-part uploads, if the Content-MD5 header is - already present, it will remain unchanged. - (False by default) """ __slots__ = ('shutdown_event', '_region') @@ -163,8 +155,7 @@ def __init__( credential_provider=None, tls_connection_options=None, part_size=None, - throughput_target_gbps=None, - compute_content_md5=None): + throughput_target_gbps=None): assert isinstance(bootstrap, ClientBootstrap) or bootstrap is None assert isinstance(region, str) assert isinstance(signing_config, AwsSigningConfig) or signing_config is None @@ -195,9 +186,6 @@ def on_shutdown(): s3_client_core = _S3ClientCore(bootstrap, credential_provider, signing_config, tls_connection_options) - if compute_content_md5 is None: - compute_content_md5 = False - # C layer uses 0 to indicate defaults if tls_mode is None: tls_mode = 0 @@ -216,7 +204,6 @@ def on_shutdown(): tls_mode, part_size, throughput_target_gbps, - compute_content_md5, s3_client_core) def make_request( diff --git a/source/s3_client.c b/source/s3_client.c index c2f587114..4761c59ff 100644 --- a/source/s3_client.c +++ b/source/s3_client.c @@ -80,11 +80,10 @@ PyObject *aws_py_s3_client_new(PyObject *self, PyObject *args) { int tls_mode; /* i */ uint64_t part_size; /* K */ double throughput_target_gbps; /* d */ - int compute_content_md5; /* p - boolean predicate */ PyObject *py_core; /* O */ if (!PyArg_ParseTuple( args, - "OOOOOs#iKdpO", + "OOOOOs#iKdO", &bootstrap_py, &signing_config_py, &credential_provider_py, @@ -95,7 +94,6 @@ PyObject *aws_py_s3_client_new(PyObject *self, PyObject *args) { &tls_mode, &part_size, &throughput_target_gbps, - &compute_content_md5, &py_core)) { return NULL; } @@ -162,7 +160,6 @@ PyObject *aws_py_s3_client_new(PyObject *self, PyObject *args) { .part_size = part_size, .tls_connection_options = tls_options, .throughput_target_gbps = throughput_target_gbps, - .compute_content_md5 = compute_content_md5 != 0, .shutdown_callback = s_s3_client_shutdown, .shutdown_callback_user_data = s3_client, };