The ObjectContent::to_file() function was not working properly,
as it could not write in a temporary file (created with tokio::fs::File::open(),
which opens a file in read-only mode).
To solve this issue, modified the way temporary files are opened to be
able to write inside of it.
* Add an example to download a file
This new example demonstrates how to download an object and store its
content into a file.
---------
Co-authored-by: Henk-Jan Lebbink <henkjan.lebbink@gmail.com>
Co-authored-by: Jean Sainctavit <jean.sainctavit@qarnot-computing.com>
The `.ssl_cert_file()` option now can read files with multiple
certificate to trust. This is useful when using a single client instance
to access many minio servers.
Unexports `list_objects_v1`, `list_objects_v2` and
`list_object_versions` and associated request/response types.
These are not necessary as the higher level `list_objects()` can be used
instead for equivalent functionality.
Some events e.g. s3:Replication:OperationCompletedReplication send
'null' value in request_parameters and the deserialization can fail in
such cases ('deault' doesn't help here)
Marking this field as optional will ensure that such events can also be
deserialized without any error.
- Add validation for user-metadata keys.
- Ensure that options are passed to both single part PutObject and
Multipart upload when using the PutObjectContent higher level API.
URL encoding for S3 API requires that we do not encode '/' in addition
to the standard characters (`_-~.` and alphanumerics).
Also fixes a bug in error response parsing (bucket name was not parsed
correctly).
Also adds another put-object example accepting CLI args.
Also:
- fix some constraints to allow ObjectContent to be sent across async
tasks.
- use new Size enum instead of Option for specifying object content
sizes
- add tests for part size calculation and validations
For list-object-versions there was a bug that would return delete
markers after all versions of an object. The server response contains
the order of versions and delete markers according to recency and the
list objects client call should preserve this. This is fixed in this
change.
XML parsing was using the `take_child` call, that mutates a vector
removing an element in it. For a response containing N items, using
take_child on item, causes the XML parsing cost to be O(N^2) (so 1
million operations for a 1000 item list) - this change makes the parsing
cost linear.