-
Notifications
You must be signed in to change notification settings - Fork 598
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: add response-content-* parameters to signed url #578
Conversation
…arameters to signed url
directoryFile.getSignedUrl({ | ||
action: 'read', | ||
expires: Math.round(Date.now() / 1000) + 5, | ||
responseType: type |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I like this PR. The code looks ok. I'm curious about exploring the idea of exposing these options, specifically content-disposition header as something a little more user friendly. I've commented my concerns inline with the code. |
f36762a
to
3036086
Compare
I applied the changes we discussed. |
* prompt will be displayed when accessing the signed url and the file name | ||
* will be set to the provided value. If options.responseDisposition is set | ||
* this option is ignored. | ||
* @param {string=} options.responseDisposition - If you provide this value, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This is basically mergeable. Couple small issues above I noted. Nothing even slightly alarming. Looks really good :) |
@ryanseys Thanks for pointing that out, I added an assertion to check that console.warn is reset to the non-stub version. |
LGTM. Hopefully Travis will finish in the next millennium, and we'll merge this in. |
if (responseContentDisposition !== '') { | ||
console.warn([ | ||
'getSignedUrl: the promptSaveAs option is ignored', | ||
'when responseDisposition is provided.' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I removed the logging, the docs should already be clear enough. |
Thanks! Merged in via 8da19e3 |
* feat: Update OSConfig API PiperOrigin-RevId: 409204961 Source-Link: googleapis/googleapis@a85beae Source-Link: googleapis/googleapis-gen@b334c5d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjMzNGM1ZDdiNDVmNGFmMTEzM2FmOTcxNzg5MDQ4Mjk5YjY2ZGMzOSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release \*beep\* \*boop\* --- ## [3.22.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.21.0...v3.22.0) (2021-11-12) ### Features * Update OSConfig API ([#578](https://www.github.com/googleapis/nodejs-asset/issues/578)) ([8af0ac8](https://www.github.com/googleapis/nodejs-asset/commit/8af0ac8a915b8b72d379b4e2a14c888ef98dfcf1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
* feat: Update OSConfig API PiperOrigin-RevId: 409204961 Source-Link: googleapis/googleapis@a85beae Source-Link: googleapis/googleapis-gen@b334c5d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjMzNGM1ZDdiNDVmNGFmMTEzM2FmOTcxNzg5MDQ4Mjk5YjY2ZGMzOSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release \*beep\* \*boop\* --- ## [3.22.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.21.0...v3.22.0) (2021-11-12) ### Features * Update OSConfig API ([#578](https://www.github.com/googleapis/nodejs-asset/issues/578)) ([8af0ac8](https://www.github.com/googleapis/nodejs-asset/commit/8af0ac8a915b8b72d379b4e2a14c888ef98dfcf1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
* feat: Update OSConfig API PiperOrigin-RevId: 409204961 Source-Link: googleapis/googleapis@a85beae Source-Link: googleapis/googleapis-gen@b334c5d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjMzNGM1ZDdiNDVmNGFmMTEzM2FmOTcxNzg5MDQ4Mjk5YjY2ZGMzOSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release \*beep\* \*boop\* --- ## [3.22.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.21.0...v3.22.0) (2021-11-12) ### Features * Update OSConfig API ([#578](https://www.github.com/googleapis/nodejs-asset/issues/578)) ([8af0ac8](https://www.github.com/googleapis/nodejs-asset/commit/8af0ac8a915b8b72d379b4e2a14c888ef98dfcf1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release \*beep\* \*boop\* --- ### [3.3.6](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.5...v3.3.6) (2021-07-21) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#577](https://www.github.com/googleapis/nodejs-video-intelligence/issues/577)) ([53ba013](https://www.github.com/googleapis/nodejs-video-intelligence/commit/53ba01323adff17801b05c4d976368a691bc9f4b)) * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#579](https://www.github.com/googleapis/nodejs-video-intelligence/issues/579)) ([46cfd26](https://www.github.com/googleapis/nodejs-video-intelligence/commit/46cfd265981b58b04dcc26960a9f0961c424cd92)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^10.0.0` -> `^11.0.0`](https://renovatebot.com/diffs/npm/sinon/10.0.0/11.1.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>sinonjs/sinon</summary> ### [`v11.1.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1110--2021-05-25) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8) \================== - Add sinon.promise() implementation ([#​2369](https://togithub.com/sinonjs/sinon/issues/2369)) - Set wrappedMethod on getters/setters ([#​2378](https://togithub.com/sinonjs/sinon/issues/2378)) - \[Docs] Update fake-server usage & descriptions ([#​2365](https://togithub.com/sinonjs/sinon/issues/2365)) - Fake docs improvement ([#​2360](https://togithub.com/sinonjs/sinon/issues/2360)) - Update nise to 5.1.0 (fixed [#​2318](https://togithub.com/sinonjs/sinon/issues/2318)) ### [`v11.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1100--2021-05-24) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.1...v11.0.0) \================== - Explicitly use samsam 6.0.2 with fix for [#​2345](https://togithub.com/sinonjs/sinon/issues/2345) - Update most packages ([#​2371](https://togithub.com/sinonjs/sinon/issues/2371)) - Update compatibility docs ([#​2366](https://togithub.com/sinonjs/sinon/issues/2366)) - Update packages (includes breaking fake-timers change, see [#​2352](https://togithub.com/sinonjs/sinon/issues/2352)) - Warn of potential memory leaks ([#​2357](https://togithub.com/sinonjs/sinon/issues/2357)) - Fix clock test errors ### [`v10.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1001--2021-04-08) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.0...v10.0.1) \================== - Upgrade sinon components (bumps y18n to 4.0.1) - Bump y18n from 4.0.0 to 4.0.1 </details> --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-language).
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^10.0.0` -> `^11.0.0`](https://renovatebot.com/diffs/npm/sinon/10.0.0/11.1.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/compatibility-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/11.1.0/confidence-slim/10.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>sinonjs/sinon</summary> ### [`v11.1.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1110--2021-05-25) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8) \================== - Add sinon.promise() implementation ([#​2369](https://togithub.com/sinonjs/sinon/issues/2369)) - Set wrappedMethod on getters/setters ([#​2378](https://togithub.com/sinonjs/sinon/issues/2378)) - \[Docs] Update fake-server usage & descriptions ([#​2365](https://togithub.com/sinonjs/sinon/issues/2365)) - Fake docs improvement ([#​2360](https://togithub.com/sinonjs/sinon/issues/2360)) - Update nise to 5.1.0 (fixed [#​2318](https://togithub.com/sinonjs/sinon/issues/2318)) ### [`v11.0.0`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1100--2021-05-24) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.1...v11.0.0) \================== - Explicitly use samsam 6.0.2 with fix for [#​2345](https://togithub.com/sinonjs/sinon/issues/2345) - Update most packages ([#​2371](https://togithub.com/sinonjs/sinon/issues/2371)) - Update compatibility docs ([#​2366](https://togithub.com/sinonjs/sinon/issues/2366)) - Update packages (includes breaking fake-timers change, see [#​2352](https://togithub.com/sinonjs/sinon/issues/2352)) - Warn of potential memory leaks ([#​2357](https://togithub.com/sinonjs/sinon/issues/2357)) - Fix clock test errors ### [`v10.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGELOG.md#​1001--2021-04-08) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v10.0.0...v10.0.1) \================== - Upgrade sinon components (bumps y18n to 4.0.1) - Bump y18n from 4.0.0 to 4.0.1 </details> --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻️ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-language).
🤖 I have created a release \*beep\* \*boop\* --- ### [3.3.6](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.5...v3.3.6) (2021-07-21) ### Bug Fixes * **deps:** google-gax v2.17.1 ([#577](https://www.github.com/googleapis/nodejs-video-intelligence/issues/577)) ([53ba013](https://www.github.com/googleapis/nodejs-video-intelligence/commit/53ba01323adff17801b05c4d976368a691bc9f4b)) * Updating WORKSPACE files to use the newest version of the Typescript generator. ([#579](https://www.github.com/googleapis/nodejs-video-intelligence/issues/579)) ([46cfd26](https://www.github.com/googleapis/nodejs-video-intelligence/commit/46cfd265981b58b04dcc26960a9f0961c424cd92)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [3.1.1](googleapis/nodejs-iot@v3.1.0...v3.1.1) (2022-09-22) ### Bug Fixes * Allow passing gax instance to client constructor ([#584](googleapis/nodejs-iot#584)) ([4bbcd42](googleapis/nodejs-iot@4bbcd42)) * Better support for fallback mode ([#580](googleapis/nodejs-iot#580)) ([8a387d0](googleapis/nodejs-iot@8a387d0)) * Change import long to require ([#581](googleapis/nodejs-iot#581)) ([2ad4aac](googleapis/nodejs-iot@2ad4aac)) * **deps:** Update dependency @google-cloud/iot to v3 ([#576](googleapis/nodejs-iot#576)) ([12bf4a7](googleapis/nodejs-iot@12bf4a7)) * Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-iot/issues/1553)) ([#583](googleapis/nodejs-iot#583)) ([24729a5](googleapis/nodejs-iot@24729a5)) * Preserve default values in x-goog-request-params header ([#586](googleapis/nodejs-iot#586)) ([cced8e7](googleapis/nodejs-iot@cced8e7)) * Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-iot/issues/1546)) ([#582](googleapis/nodejs-iot#582)) ([c6bb3f9](googleapis/nodejs-iot@c6bb3f9)) * use google-gax v3.3.0 ([24729a5](googleapis/nodejs-iot@24729a5)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
* feat: Update OSConfig API PiperOrigin-RevId: 409204961 Source-Link: googleapis/googleapis@a85beae Source-Link: googleapis/googleapis-gen@b334c5d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjMzNGM1ZDdiNDVmNGFmMTEzM2FmOTcxNzg5MDQ4Mjk5YjY2ZGMzOSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release \*beep\* \*boop\* --- ## [3.22.0](https://www.github.com/googleapis/nodejs-asset/compare/v3.21.0...v3.22.0) (2021-11-12) ### Features * Update OSConfig API ([#578](https://www.github.com/googleapis/nodejs-asset/issues/578)) ([8af0ac8](https://www.github.com/googleapis/nodejs-asset/commit/8af0ac8a915b8b72d379b4e2a14c888ef98dfcf1)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 481650929 Source-Link: https://togithub.com/googleapis/googleapis/commit/62e82e76c6ab8405731c1dfc9edb604745beedfb Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/d6de38b5d51dafb942ccd1268d6d04eb6ff116af Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDZkZTM4YjVkNTFkYWZiOTQyY2NkMTI2OGQ2ZDA0ZWI2ZmYxMTZhZiJ9
This lets the user add the
response-content-type
andresponse-content-disposition
parameters to a signed url.It really is a minor addition but I think it might be useful (at least to me :)). It took me a while to find those two parameters in the docs so having them at hand might save some time to others.