Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checksums in CopyObjectResult #1608

Open
kzhsw opened this issue Jan 2, 2025 · 2 comments · May be fixed by #1609
Open

checksums in CopyObjectResult #1608

kzhsw opened this issue Jan 2, 2025 · 2 comments · May be fixed by #1609

Comments

@kzhsw
Copy link
Contributor

kzhsw commented Jan 2, 2025

In upstream S3 API, CopyObjectResult can return some checksum fields
https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html#API_CopyObject_ResponseSyntax

<CopyObjectResult>
   <ETag>string</ETag>
   <LastModified>timestamp</LastModified>
   <ChecksumCRC32>string</ChecksumCRC32>
   <ChecksumCRC32C>string</ChecksumCRC32C>
   <ChecksumSHA1>string</ChecksumSHA1>
   <ChecksumSHA256>string</ChecksumSHA256>
</CopyObjectResult>

But currently in this sdk, it's not possible to get this result if any, from the CopyObjectResult class.

public class CopyObjectResult {
@Element(name = "ETag")
private String etag;
@Element(name = "LastModified")
private ResponseDate lastModified;
public CopyObjectResult() {}

@balamurugana
Copy link
Member

Feel free to send a PR

@kzhsw
Copy link
Contributor Author

kzhsw commented Jan 2, 2025

It seems that there is no public api returning directly, so to return the results to user, ObjectWriteResponse class has to be changed, along with many apis that returns this.

kzhsw added a commit to kzhsw/minio-java that referenced this issue Jan 2, 2025
Currently `PutObject`, `CopyObject`, `CompleteMultipartUpload` could return checksums, but client api for `CopyObjectResult` and `ObjectWriteResponse` does not return it.
This commit adds checksums to `CopyObjectResult` and `ObjectWriteResponse` to allow users to get checksums if any.
Close minio#1608

References:
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#API_PutObject_ResponseSyntax>
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html#API_CompleteMultipartUpload_ResponseSyntax>
<https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html#API_CopyObject_ResponseSyntax>
@kzhsw kzhsw linked a pull request Jan 2, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants