Skip to content

Commit

Permalink
Reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes-ucsc committed Dec 15, 2024
1 parent 1db6db7 commit a02ce84
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/azul/service/storage_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,25 @@ def get_presigned_url(self, key: str, file_name: Optional[str] = None) -> str:
"""
Return a pre-signed URL to the given key.
:param key: the key of the S3 object whose content a request to the signed URL will return
:param key: The key of the S3 object whose content a request to the
signed URL will return
:param file_name: the file name to be returned as part of a Content-Disposition header in the response to a
request to the signed URL. If None, no such header will be present in the response.
:param file_name: the file name to be returned as part of a
Content-Disposition header in the response to a
request to the signed URL. If None, no such header
will be present in the response.
"""
assert file_name is None or '"' not in file_name
assert file_name is None or '"' not in file_name, file_name
return self._s3.generate_presigned_url(
ClientMethod=self._s3.get_object.__name__,
Params={
'Bucket': self.bucket_name,
'Key': key,
**({} if file_name is None else {'ResponseContentDisposition': f'attachment;filename="{file_name}"'})
**(
{}
if file_name is None else
{'ResponseContentDisposition': f'attachment;filename="{file_name}"'}
)
})

def put_object_tagging(self, object_key: str, tagging: Tagging = None):
Expand Down

0 comments on commit a02ce84

Please sign in to comment.