Make files public and private#390
Make files public and private#390ryanseys merged 1 commit intogoogleapis:masterfrom ryanseys:rs--make-public
Conversation
|
All sounds good to me. |
|
Cool beans, I'll add some tests to this bad boy. Might leave makePublic and makePrivate for buckets out for now as a way to break the problem down. |
test/storage/file.js
Outdated
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.
|
This should be good for a second look. I've added tests. I've omitted a test for testing makePrivate with |
lib/storage/file.js
Outdated
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.
|
PTAL. Sorry I squashed so you'll have to go back through your comments :( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
LGTM but I'll leave it unmerged for now to confirm the way it works is what @jgeewax had in mind. |
|
Yolo merge? |
|
YEP |
|
Woooooo! |
Update npm scripts: add clean, prelint, prefix; make sure that lint and fix are set properly. Use post-process feature of synthtool.
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@types/uuid](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | devDependencies | major | [`^7.0.2` -> `^8.0.0`](https://renovatebot.com/diffs/npm/@types%2fuuid/7.0.4/8.0.0) | --- ### 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-dns).
* build: switch to releasing with GitHub bot * chore: drop releaseType from yaml
* build: switch to releasing with GitHub bot * chore: drop releaseType from yaml
Included in this PR is my interpretation of how we should handle making Google Cloud Storage objects public and private.
I am not putting it under the
file.aclobject because if the user understand acls then they probably don't need to use these helper methods. These are slap-em-on permissions that require minimal configuration.Buckets, by default, apply a default ACL of
project-private, that is it is private only to the maintainers of the project. This is the "default" setting. By runningfile.makePrivate()we are reverting to this default. If you want to REALLY make it private, that is only to the object owner user, then you can pass in{ strict: true }(ideas on a better param name are welcome).makePrivate()removes all other permissions. It DNGAF.makePublic()just slaps onallUsers: READERpermission, maintaining all other permissions. It's nicer thanmakePrivate()in this regard.Edit: Added tests.