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

allow making a bucket public/private #429

Merged

Conversation

stephenplusplus
Copy link
Contributor

Evolves: #418

This introduces:

bucket.makePublic([options], callback)

options

options.includeFiles

Type: boolean
Default: false

Run file.makePublic() against every in the bucket.

options.force

Type: boolean
Default: false

Queue errors occurred while making files public until all files have been processed.

callback(error, [files])

Type: function

error can be null, Error, or Error[].

If you don't specify includeFiles: true, files doesn't exist. If you did, it contains all files successfully made public.

bucket.makePrivate([options], callback)

options

options.strict

Type: boolean
Default: false

Make the bucket private to only the owner user. Otherwise, it will be private to the project.

options.includeFiles

Type: boolean
Default: false

Run file.makePrivate() against every in the bucket.

options.force

Type: boolean
Default: false

Queue errors occurred while making files public until all files have been processed.

callback(error, [files])

Type: function

error can be null, Error, or Error[].

If you don't specify includeFiles: true, files doesn't exist. If you did, it contains all files successfully made private.

Todos

  • Regression tests
  • Unit Tests
  • Docs
  • Add options.auto to apply a predefinedObjectACL on the bucket to allow new files to be created with the same permissions. (this behavior will become default)

Issues

  1. bucket#makePrivate with strict: true always throws an error forbidden before it finishes, because it somehow doesn't recognize my account using service account key json to authenticate as an owner. Any idea how I can become the root owner of the bucket? (applies to @ryanseys and me as well)

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 5, 2015
@stephenplusplus stephenplusplus added api: storage Issues related to the Cloud Storage API. don't merge labels Mar 5, 2015
@stephenplusplus stephenplusplus added this to the Storage Stable milestone Mar 5, 2015
@ryanseys
Copy link
Contributor

ryanseys commented Mar 5, 2015

So thoughts on private issues... we could just remove strict: true? Private to the project seems like smarter than private to specific user anyway.

@stephenplusplus
Copy link
Contributor Author

Makes sense to me.

@ryanseys
Copy link
Contributor

ryanseys commented Mar 5, 2015

make-it-so-captain

@stephenplusplus stephenplusplus force-pushed the spp--bucket-makepublicprivate branch 2 times, most recently from c0ce479 to bd7b3e2 Compare March 10, 2015 18:01
@stephenplusplus
Copy link
Contributor Author

2/3 todos done. Regarding the last one:

Add options.auto to apply a predefinedObjectACL on the bucket to allow new files to be created with the same permissions.

Should we just do this by default? Seems if I say "make my bucket private", it should shut people out until I re-open it (same logic in reverse as well).

@ryanseys
Copy link
Contributor

I'd say yes for auto by default.

@stephenplusplus
Copy link
Contributor Author

(saying that to myself)

async.parallel([
setPredefinedAcl,
addAclPermissions,
makeFilesPublic

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.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus stephenplusplus force-pushed the spp--bucket-makepublicprivate branch 2 times, most recently from b398773 to caea1d6 Compare March 23, 2015 19:02
@stephenplusplus
Copy link
Contributor Author

PTAL!


function addAclPermissions(done) {
// Allow reading bucket contents while preserving original permissions.
self.acl.default.add({

This comment was marked as spam.

@ryanseys
Copy link
Contributor

🚢 it. (after tests pass)

ryanseys added a commit that referenced this pull request Mar 23, 2015
…ivate

allow making a bucket public/private
@ryanseys ryanseys merged commit 60f1ab2 into googleapis:master Mar 23, 2015
sofisl pushed a commit that referenced this pull request Sep 15, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/ba2d388f-b3b2-4ad7-a163-0c6b4d86894f/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@05de3e1
sofisl pushed a commit that referenced this pull request Sep 27, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [null-loader](https://togithub.com/webpack-contrib/null-loader) | devDependencies | major | [`^3.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/null-loader/3.0.0/4.0.0) |

---

### Release Notes

<details>
<summary>webpack-contrib/null-loader</summary>

### [`v4.0.0`](https://togithub.com/webpack-contrib/null-loader/blob/master/CHANGELOG.md#&#8203;400-httpsgithubcomwebpack-contribnull-loadercomparev300v400-2020-04-15)

[Compare Source](https://togithub.com/webpack-contrib/null-loader/compare/v3.0.0...v4.0.0)

##### Bug Fixes

-   support `webpack@5`

##### ⚠ BREAKING CHANGES

-   minimum required Nodejs version is `10.13`

</details>

---

### Renovate configuration

:date: **Schedule**: "after 9am and before 3pm" (UTC).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

:no_bell: **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#googleapis/nodejs-video-intelligence).
sofisl pushed a commit that referenced this pull request Oct 12, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/9f8e7599-f87d-4fac-8f3a-a2e1781c33be/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 361273630
Source-Link: googleapis/googleapis@5477122
sofisl pushed a commit that referenced this pull request Oct 13, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/9f8e7599-f87d-4fac-8f3a-a2e1781c33be/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 361273630
Source-Link: googleapis/googleapis@5477122
sofisl pushed a commit that referenced this pull request Nov 9, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [null-loader](https://togithub.com/webpack-contrib/null-loader) | devDependencies | major | [`^3.0.0` -> `^4.0.0`](https://renovatebot.com/diffs/npm/null-loader/3.0.0/4.0.0) |

---

### Release Notes

<details>
<summary>webpack-contrib/null-loader</summary>

### [`v4.0.0`](https://togithub.com/webpack-contrib/null-loader/blob/master/CHANGELOG.md#&#8203;400-httpsgithubcomwebpack-contribnull-loadercomparev300v400-2020-04-15)

[Compare Source](https://togithub.com/webpack-contrib/null-loader/compare/v3.0.0...v4.0.0)

##### Bug Fixes

-   support `webpack@5`

##### ⚠ BREAKING CHANGES

-   minimum required Nodejs version is `10.13`

</details>

---

### Renovate configuration

:date: **Schedule**: "after 9am and before 3pm" (UTC).

:vertical_traffic_light: **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

:recycle: **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

:no_bell: **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#googleapis/nodejs-video-intelligence).
sofisl pushed a commit that referenced this pull request Nov 11, 2022
…429)

This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/0901f4c4-aa35-478b-ad7f-b996019d3c27/targets

- [ ] To automatically regenerate this PR, check this box.

Source-Link: googleapis/synthtool@8cf6d28
sofisl pushed a commit that referenced this pull request Nov 11, 2022
sofisl pushed a commit that referenced this pull request Nov 11, 2022
* chore(main): release 4.3.0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this pull request Jan 24, 2023
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
sofisl pushed a commit that referenced this pull request Jan 25, 2023
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
sofisl pushed a commit that referenced this pull request Sep 14, 2023
Co-authored-by: gcf-merge-on-green[bot] <60162190+gcf-merge-on-green[bot]@users.noreply.github.com>

Source-Author: F. Hinkelmann <[email protected]>
Source-Date: Wed Sep 30 14:13:57 2020 -0400
Source-Repo: googleapis/synthtool
Source-Sha: 079dcce498117f9570cebe6e6cff254b38ba3860
Source-Link: googleapis/synthtool@079dcce
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.

3 participants