diff --git a/filestack/mixins/imagetransformation.py b/filestack/mixins/imagetransformation.py index 61332c8..09ac48d 100644 --- a/filestack/mixins/imagetransformation.py +++ b/filestack/mixins/imagetransformation.py @@ -155,10 +155,10 @@ def auto_image(self): def doc_to_images(self, pages=None, engine=None, format=None, quality=None, density=None, hidden_slides=None): return self._add_transform_task('doc_to_images', locals()) - + def smart_crop(self, mode=None, width=None, height=None, fill_color=None, coords=None): return self._add_transform_task('smart_crop', locals()) - + def pdfcreate(self, engine=None): return self._add_transform_task('pdfcreate', locals()) diff --git a/filestack/uploads/intelligent_ingestion.py b/filestack/uploads/intelligent_ingestion.py index fe15471..b3e5d09 100644 --- a/filestack/uploads/intelligent_ingestion.py +++ b/filestack/uploads/intelligent_ingestion.py @@ -62,7 +62,7 @@ def upload_part(apikey, filename, filepath, filesize, storage, start_response, p payload = payload_base.copy() payload.update({ 'size': len(chunk_data), - 'md5': b64encode(hashlib.md5(chunk_data).digest()).strip().decode('utf-8'), + 'md5': b64encode(hashlib.md5(chunk_data, usedforsecurity=False).digest()).strip().decode('utf-8'), 'offset': offset, 'fii': True }) diff --git a/filestack/uploads/multipart.py b/filestack/uploads/multipart.py index 855b64c..d761b2c 100644 --- a/filestack/uploads/multipart.py +++ b/filestack/uploads/multipart.py @@ -66,7 +66,7 @@ def upload_chunk(apikey, filename, storage, start_response, chunk): 'apikey': apikey, 'part': chunk.num, 'size': len(chunk.bytes), - 'md5': b64encode(hashlib.md5(chunk.bytes).digest()).strip().decode('utf-8'), + 'md5': b64encode(hashlib.md5(chunk.bytes, usedforsecurity=False).digest()).strip().decode('utf-8'), 'uri': start_response['uri'], 'region': start_response['region'], 'upload_id': start_response['upload_id'], @@ -113,10 +113,10 @@ def multipart_upload(apikey, filepath, file_obj, storage, params=None, security= chunks = make_chunks(filepath, file_obj, filesize) start_response = multipart_request(config.MULTIPART_START_URL, payload, params, security) upload_func = partial(upload_chunk, apikey, filename, storage, start_response) - + with ThreadPoolExecutor(max_workers=upload_processes) as executor: uploaded_parts = list(executor.map(upload_func, chunks)) - + location_url = start_response.pop('location_url') payload.update(start_response) payload['parts'] = uploaded_parts