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: add response-content-* parameters to signed url #578

Closed
wants to merge 4 commits into from

Conversation

mziccard
Copy link
Contributor

This lets the user add the response-content-type and response-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.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 10, 2015
directoryFile.getSignedUrl({
action: 'read',
expires: Math.round(Date.now() / 1000) + 5,
responseType: type

This comment was marked as spam.

@ryanseys
Copy link
Contributor

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.

@mziccard
Copy link
Contributor Author

I applied the changes we discussed.
As usual, please, double check them as it has been a long day :)

* 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.

@ryanseys
Copy link
Contributor

This is basically mergeable. Couple small issues above I noted. Nothing even slightly alarming. Looks really good :)

@mziccard
Copy link
Contributor Author

@ryanseys Thanks for pointing that out, I added an assertion to check that console.warn is reset to the non-stub version.
I also made the docs less wordy :)

@ryanseys
Copy link
Contributor

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.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@mziccard
Copy link
Contributor Author

I removed the logging, the docs should already be clear enough.

@stephenplusplus
Copy link
Contributor

Thanks! Merged in via 8da19e3

chingor13 pushed a commit that referenced this pull request Aug 22, 2022
* 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>
chingor13 pushed a commit that referenced this pull request Aug 22, 2022
* 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>
chingor13 pushed a commit that referenced this pull request Aug 22, 2022
* 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>
sofisl pushed a commit that referenced this pull request Oct 11, 2022
[![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://github.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://github.com/sinonjs/sinon/blob/master/CHANGELOG.md#&#8203;1110--2021-05-25)

[Compare Source](https://github.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8)

\==================

-   Add sinon.promise() implementation ([#&#8203;2369](https://github.com/sinonjs/sinon/issues/2369))
-   Set wrappedMethod on getters/setters ([#&#8203;2378](https://github.com/sinonjs/sinon/issues/2378))
-   \[Docs] Update fake-server usage & descriptions ([#&#8203;2365](https://github.com/sinonjs/sinon/issues/2365))
-   Fake docs improvement ([#&#8203;2360](https://github.com/sinonjs/sinon/issues/2360))
-   Update nise to 5.1.0 (fixed [#&#8203;2318](https://github.com/sinonjs/sinon/issues/2318))

### [`v11.0.0`](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md#&#8203;1100--2021-05-24)

[Compare Source](https://github.com/sinonjs/sinon/compare/v10.0.1...v11.0.0)

\==================

-   Explicitly use samsam 6.0.2 with fix for [#&#8203;2345](https://github.com/sinonjs/sinon/issues/2345)
-   Update most packages ([#&#8203;2371](https://github.com/sinonjs/sinon/issues/2371))
-   Update compatibility docs ([#&#8203;2366](https://github.com/sinonjs/sinon/issues/2366))
-   Update packages (includes breaking fake-timers change, see [#&#8203;2352](https://github.com/sinonjs/sinon/issues/2352))
-   Warn of potential memory leaks ([#&#8203;2357](https://github.com/sinonjs/sinon/issues/2357))
-   Fix clock test errors

### [`v10.0.1`](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md#&#8203;1001--2021-04-08)

[Compare Source](https://github.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).
sofisl pushed a commit that referenced this pull request Oct 13, 2022
[![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://github.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://github.com/sinonjs/sinon/blob/master/CHANGELOG.md#&#8203;1110--2021-05-25)

[Compare Source](https://github.com/sinonjs/sinon/compare/v11.0.0...31be9a5d5a4762ef01cb195f29024616dfee9ce8)

\==================

-   Add sinon.promise() implementation ([#&#8203;2369](https://github.com/sinonjs/sinon/issues/2369))
-   Set wrappedMethod on getters/setters ([#&#8203;2378](https://github.com/sinonjs/sinon/issues/2378))
-   \[Docs] Update fake-server usage & descriptions ([#&#8203;2365](https://github.com/sinonjs/sinon/issues/2365))
-   Fake docs improvement ([#&#8203;2360](https://github.com/sinonjs/sinon/issues/2360))
-   Update nise to 5.1.0 (fixed [#&#8203;2318](https://github.com/sinonjs/sinon/issues/2318))

### [`v11.0.0`](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md#&#8203;1100--2021-05-24)

[Compare Source](https://github.com/sinonjs/sinon/compare/v10.0.1...v11.0.0)

\==================

-   Explicitly use samsam 6.0.2 with fix for [#&#8203;2345](https://github.com/sinonjs/sinon/issues/2345)
-   Update most packages ([#&#8203;2371](https://github.com/sinonjs/sinon/issues/2371))
-   Update compatibility docs ([#&#8203;2366](https://github.com/sinonjs/sinon/issues/2366))
-   Update packages (includes breaking fake-timers change, see [#&#8203;2352](https://github.com/sinonjs/sinon/issues/2352))
-   Warn of potential memory leaks ([#&#8203;2357](https://github.com/sinonjs/sinon/issues/2357))
-   Fix clock test errors

### [`v10.0.1`](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md#&#8203;1001--2021-04-08)

[Compare Source](https://github.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).
sofisl pushed a commit that referenced this pull request Nov 10, 2022
sofisl pushed a commit that referenced this pull request Nov 11, 2022
🤖 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).
sofisl pushed a commit that referenced this pull request Nov 11, 2022
* 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>
sofisl pushed a commit that referenced this pull request Nov 11, 2022
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 481650929

Source-Link: https://github.com/googleapis/googleapis/commit/62e82e76c6ab8405731c1dfc9edb604745beedfb

Source-Link: https://github.com/googleapis/googleapis-gen/commit/d6de38b5d51dafb942ccd1268d6d04eb6ff116af
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDZkZTM4YjVkNTFkYWZiOTQyY2NkMTI2OGQ2ZDA0ZWI2ZmYxMTZhZiJ9
sofisl pushed a commit that referenced this pull request Jan 24, 2023
sofisl pushed a commit that referenced this pull request Jan 25, 2023
sofisl pushed a commit that referenced this pull request Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants