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

Download the contents from a encrypted object to a given file. #736

Merged
merged 1 commit into from
Dec 14, 2018

Conversation

sinhaashish
Copy link
Contributor

New method introduced to get the Encrypted Object and write to
a file .
getObject(String bucketName, String objectName, ServerSideEncryption sse, String fileName)

balamurugana
balamurugana previously approved these changes Dec 12, 2018
* @param bucketName Bucket name.
* @param objectName Object name in the bucket.
* @param sse encryption metadata.
* @param fileName file named.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo
named => name or maybe even file name to download into

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

api/src/main/java/io/minio/MinioClient.java Show resolved Hide resolved
|| (sse.getType() == ServerSideEncryption.Type.SSE_KMS)) {
throw new InvalidArgumentException("Invalid encryption option specified for encryption type " + sse.getType());
} else if ((sse.getType() == ServerSideEncryption.Type.SSE_C) && (!this.baseUrl.isHttps())) {
throw new InvalidArgumentException("SSE_C provided keys must be made over a secure connection.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSE_C => SSE-C

In Amazon terminology, SSE-C is "Server-Side Encryption with Customer provided encryption keys".
So, "SSE-Cprovidedkeys ..." doesn't make sense.

Probably, "SSE_C provided keys ..." can be replaced with "SSE-C keys ... or something.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Modified.

// already downloaded. nothing to do
return;
} else if (fileSize > length) {
throw new InvalidArgumentException("'" + fileName + "': object size " + length + " is smaller than file size "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"'" + fileName + "': object size " + length + " is smaller than file size " + fileSize

IMHO, this message is confusing. At least it confused me. I thought fileName has the object size length.

Would it be clearer if it is changed something like:
"Source object, '" + objectName + "', size:" + length + " is smaller than the destination file, '" + fileName + "', size:" + fileSize ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

docs/API.md Outdated

`public void getObject(String bucketName, String objectName, ServerSideEncryption sse, String fileName)`

Download the contents from a encrypted objectName to a given file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo
a encrypted => an encrypted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

altered

docs/API.md Outdated
| ``bucketName`` | _String_ | Name of the bucket. |
| ``objectName`` | _String_ | Object name in the bucket. |
| ``sse`` | _ServerSideEncryption_ | Form of server-side encryption [ServerSideEncryption](http://minio.github.io/minio-java/io/minio/ServerSideEncryption.html). |
| ``fileName`` | _String_ | File name. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe File name to download into

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

docs/API.md Outdated
| | ``org.xmlpull.v1.XmlPullParserException`` : upon parsing response XML. |
| | ``ErrorResponseException`` : upon unsuccessful execution. |
| | ``InternalException`` : upon internal library error. |
| | ``InvalidArgumentException`` : upon invalid value is passed to a method. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe:
upon invalid value is passed to a method. => upon passing of an invalid to a method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

New method introduced to get the Encrypted Object and write to
a file .
getObject(String bucketName, String objectName, ServerSideEncryption sse, String fileName)
@ebozduman
Copy link
Contributor

ebozduman commented Dec 13, 2018

There was a Travis failure about socket timeout during a functional test.
I manually ran the functional tests and did not see any problem. So, restarted the Travis test run and it recovered.

Copy link
Contributor

@ebozduman ebozduman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kannappanr kannappanr merged commit 53d80d9 into minio:master Dec 14, 2018
@sinhaashish sinhaashish deleted the FGetObject branch January 23, 2019 10:38
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 this pull request may close these issues.

4 participants