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

storage: allow custom file encryption #1364

Merged
merged 2 commits into from
Jun 10, 2016

Conversation

stephenplusplus
Copy link
Contributor

@stephenplusplus stephenplusplus commented Jun 7, 2016

Fixes #1361

To Dos

  • Support a custom key (instead of generating one from a passphrase)
  • Support options.encryption in gcs-resumable-upload
  • Tests
    • System
    • Unit

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 7, 2016
@stephenplusplus stephenplusplus added api: storage Issues related to the Cloud Storage API. and removed cla: yes This human has signed the Contributor License Agreement. labels Jun 7, 2016
key: key,
hash: crypto.createHash('sha256').update(key, 'base64').digest('base64')
};
};

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@jgeewax
Copy link
Contributor

jgeewax commented Jun 8, 2016

Just to confirm, the goal here is to be able to set a key when uploading a file. Eventually we might want a key-derivation library involved, but for now this is just about setting a key on a per-file basis.

@stephenplusplus
Copy link
Contributor Author

Let me know how far off #1364 (comment) is from what you're looking for.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jun 8, 2016
@stephenplusplus
Copy link
Contributor Author

If we only support uploading a file, the user would be blocked out from other operations, like downloading it. The way this PR works is:

  • the user provides a passphrase to file.encrypt()
  • every API request made with a file object (file.download, .copy, .createWriteStream, etc) will pass the generated key so that these operations don't fail

* });
* });
*/
File.prototype.encrypt = function(code) {

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus stephenplusplus force-pushed the spp--1361 branch 2 times, most recently from 4f84239 to 87d040b Compare June 10, 2016 12:48
@stephenplusplus
Copy link
Contributor Author

@callmehiphop PTAL!

@callmehiphop
Copy link
Contributor

callmehiphop commented Jun 10, 2016

@stephenplusplus I think npm might have messed up your most recent release of gcs-resumable-upload, both travis and my local are failing to install v0.7.x, however v0.6.x still seems to be installing fine in master.

@stephenplusplus
Copy link
Contributor Author

Fixed... v0.7.1.

@callmehiphop
Copy link
Contributor

This might be a slightly off-topic question, but the upstream documentation for sending encryption keys also mentions a separate set of headers for rewrite operations, which we don't appear to support - any reason why that is?

@stephenplusplus
Copy link
Contributor Author

rewrite is new! At least, since we had a Storage deep dive. Mind making an issue to remind us to add support?

@callmehiphop
Copy link
Contributor

Done! #1373

@coveralls
Copy link

coveralls commented Jun 10, 2016

Coverage Status

Changes Unknown when pulling 6e1df56 on stephenplusplus:spp--1361 into * on GoogleCloudPlatform:master*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: storage Issues related to the Cloud Storage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants