-
Notifications
You must be signed in to change notification settings - Fork 2k
Add Cloud Storage encryption samples and tests. #165
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,21 +27,27 @@ var downloadFilePath = path.join(__dirname, '../resources/downloaded.txt'); | |
|
|
||
| describe('storage:encryption', function () { | ||
| var key; | ||
|
|
||
| before(function (done) { | ||
| // Create an key to use throughout the test | ||
| key = program.generateEncryptionKey(); | ||
| // Create a test bucket | ||
| storage.createBucket(bucketName, done); | ||
| }); | ||
|
|
||
| after(function (done) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explain what this does with a comment? (e.g. "Reset GCS bucket after running all tests" or something.)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added comments |
||
| try { | ||
| // Delete the downloaded file | ||
| fs.unlinkSync(downloadFilePath); | ||
| } catch (err) { | ||
| console.log(err); | ||
| } | ||
| // Delete any files that were uploaded | ||
| storage.bucket(bucketName).deleteFiles({ force: true }, function (err) { | ||
| if (err) { | ||
| return done(err); | ||
| } | ||
| // Delete the test bucket | ||
| storage.bucket(bucketName).delete(done); | ||
| }); | ||
| }); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,7 +123,7 @@ describe('storage:encryption', function () { | |
|
|
||
| describe('downloadEncryptedFile', function () { | ||
| var fileName = 'test.txt'; | ||
| it('should upload a file', function () { | ||
| it('should download a file', function () { | ||
| var sample = getSample(); | ||
|
|
||
| sample.program.downloadEncryptedFile(bucketName, fileName, fileName, 'key', function (err) { | ||
|
|
@@ -181,6 +181,7 @@ describe('storage:encryption', function () { | |
| }); | ||
|
|
||
| describe('rotateEncryptionKey', function () { | ||
| it('should be implemented'); | ||
| it('should rotate an encryption key', function () { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May want to put an it ('should be implemented') here.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added |
||
| var sample = getSample(); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar nit: create a key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed