Currently POST presigned URLs are used to upload files to S3, as this enables S3 to validate both the checksum and file size. However, this isn't supported by some S3-compatible storage systems (like PowerScale).
The server will be modified to support both. For a PUT presigned URL the value of fields will be null in the json (i.e. None in python). So in the python API:
fields is null: use a PUT,
fields has content: use a POST
The file simvue/api/objects/artifact/base.py needs to be updated. So this:
_response = sv_post(
url=_url,
headers={},
params={},
is_json=False,
timeout=timeout,
files={"file": file},
data=self._init_data.get("fields"),
)
needs to be replaced with something like:
if self._init_data.get("fields") is not None:
_response = sv_post(
url=_url,
headers={},
params={},
is_json=False,
timeout=timeout,
files={"file": file},
data=self._init_data.get("fields"),
)
else:
with open(file, "rb") as fh:
_response = requests.put(_url, data=fh)
Currently POST presigned URLs are used to upload files to S3, as this enables S3 to validate both the checksum and file size. However, this isn't supported by some S3-compatible storage systems (like PowerScale).
The server will be modified to support both. For a PUT presigned URL the value of
fieldswill benullin the json (i.e.Nonein python). So in the python API:fieldsisnull: use a PUT,fieldshas content: use a POSTThe file
simvue/api/objects/artifact/base.pyneeds to be updated. So this:needs to be replaced with something like: