Skip to content

Update storage client to latest. #393

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

Merged
merged 1 commit into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "1.4.14",
"@google-cloud/storage": "1.1.0",
"@google-cloud/storage": "1.1.1",
"ava": "0.19.1",
"nyc": "10.3.2",
"shelljs": "0.7.7"
Expand Down
11 changes: 4 additions & 7 deletions storage/encryption.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,12 @@ function downloadEncryptedFile (bucketName, srcFilename, destFilename, key) {
destination: destFilename
};

const file = storage
.bucket(bucketName)
.file(srcFilename);

file.setEncryptionKey(Buffer.from(key, 'base64'));

// Descrypts and downloads the file. This can only be done with the key used
// to encrypt and upload the file.
file
storage
.bucket(bucketName)
.file(srcFilename)
.setEncryptionKey(Buffer.from(key, 'base64'))
.download(options)
.then(() => {
console.log(`File ${srcFilename} downloaded to ${destFilename}.`);
Expand Down
4 changes: 2 additions & 2 deletions storage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test": "npm run unit-test && npm run system-test"
},
"dependencies": {
"@google-cloud/storage": "1.1.0",
"@google-cloud/storage": "1.1.1",
"googleapis": "19.0.0",
"moment": "2.18.1",
"safe-buffer": "5.0.1",
Expand All @@ -28,7 +28,7 @@
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "1.4.14",
"ava": "0.19.1",
"proxyquire": "1.7.11",
"proxyquire": "1.8.0",
"sinon": "2.2.0",
"uuid": "3.0.1"
},
Expand Down
73 changes: 15 additions & 58 deletions storage/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@
string-format-obj "^1.1.0"
through2 "^2.0.3"

"@google-cloud/[email protected].13":
version "1.4.13"
resolved "https://registry.yarnpkg.com/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-1.4.13.tgz#005556d8b93cb29f16018988e466cf0f9dc6d91f"
"@google-cloud/[email protected].14":
version "1.4.14"
resolved "https://registry.yarnpkg.com/@google-cloud/nodejs-repo-tools/-/nodejs-repo-tools-1.4.14.tgz#b778687bcd798ea172a01d2b92db43ad95a8b0ce"
dependencies:
ava "0.19.1"
colors "1.1.2"
Expand All @@ -76,9 +76,9 @@
supertest "3.0.0"
yargs "8.0.1"

"@google-cloud/[email protected].0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-1.1.0.tgz#5e905a1aed4c196d5ce75dcdb5e4cd7ce29a0860"
"@google-cloud/[email protected].1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-1.1.1.tgz#6590b5ce6e779556c9cc7043bd6449d6bc0781de"
dependencies:
"@google-cloud/common" "^0.13.0"
arrify "^1.0.0"
Expand Down Expand Up @@ -774,10 +774,6 @@ camelcase@^2.0.0:
version "2.1.1"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-2.1.1.tgz#7c1d16d679a1bbe59ca02cacecfb011e201f5a1f"

camelcase@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"

camelcase@^4.0.0, camelcase@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd"
Expand Down Expand Up @@ -2523,12 +2519,6 @@ os-homedir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"

os-locale@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-1.4.0.tgz#20f9f17ae29ed345e8bde583b13d2009803c14d9"
dependencies:
lcid "^1.0.0"

os-locale@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.0.0.tgz#15918ded510522b81ee7ae5a309d54f639fc39a4"
Expand Down Expand Up @@ -2746,6 +2736,14 @@ [email protected]:
module-not-found-error "^1.0.0"
resolve "~1.1.7"

[email protected]:
version "1.8.0"
resolved "https://registry.yarnpkg.com/proxyquire/-/proxyquire-1.8.0.tgz#02d514a5bed986f04cbb2093af16741535f79edc"
dependencies:
fill-keys "^1.0.2"
module-not-found-error "^1.0.0"
resolve "~1.1.7"

pseudomap@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
Expand Down Expand Up @@ -3110,19 +3108,6 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"

[email protected]:
version "2.1.0"
resolved "https://registry.yarnpkg.com/sinon/-/sinon-2.1.0.tgz#e057a9d2bf1b32f5d6dd62628ca9ee3961b0cafb"
dependencies:
diff "^3.1.0"
formatio "1.2.0"
lolex "^1.6.0"
native-promise-only "^0.8.1"
path-to-regexp "^1.7.0"
samsam "^1.1.3"
text-encoding "0.6.4"
type-detect "^4.0.0"

[email protected]:
version "2.2.0"
resolved "https://registry.yarnpkg.com/sinon/-/sinon-2.2.0.tgz#3b1b42ff5defcbf51a52a62aca6d61171b9fd262"
Expand Down Expand Up @@ -3242,7 +3227,7 @@ string-template@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/string-template/-/string-template-1.0.0.tgz#9e9f2233dc00f218718ec379a28a5673ecca8b96"

string-width@^1.0.1, string-width@^1.0.2:
string-width@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
dependencies:
Expand Down Expand Up @@ -3535,10 +3520,6 @@ [email protected]:
dependencies:
extsprintf "1.0.2"

which-module@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f"

which-module@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
Expand Down Expand Up @@ -3631,36 +3612,12 @@ yallist@^2.0.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"

yargs-parser@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a"
dependencies:
camelcase "^3.0.0"

yargs-parser@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9"
dependencies:
camelcase "^4.1.0"

[email protected]:
version "7.1.0"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8"
dependencies:
camelcase "^3.0.0"
cliui "^3.2.0"
decamelize "^1.1.1"
get-caller-file "^1.0.1"
os-locale "^1.4.0"
read-pkg-up "^1.0.1"
require-directory "^2.1.1"
require-main-filename "^1.0.1"
set-blocking "^2.0.0"
string-width "^1.0.2"
which-module "^1.0.0"
y18n "^3.2.1"
yargs-parser "^5.0.0"

[email protected]:
version "8.0.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.1.tgz#420ef75e840c1457a80adcca9bc6fa3849de51aa"
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
supertest "3.0.0"
yargs "8.0.1"

"@google-cloud/[email protected].0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-1.1.0.tgz#5e905a1aed4c196d5ce75dcdb5e4cd7ce29a0860"
"@google-cloud/[email protected].1":
version "1.1.1"
resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-1.1.1.tgz#6590b5ce6e779556c9cc7043bd6449d6bc0781de"
dependencies:
"@google-cloud/common" "^0.13.0"
arrify "^1.0.0"
Expand Down