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

Bucket Policy Only Samples #557

Merged
merged 11 commits into from
Jan 15, 2019
Merged

Bucket Policy Only Samples #557

merged 11 commits into from
Jan 15, 2019

Conversation

frankyn
Copy link
Member

@frankyn frankyn commented Dec 14, 2018

These are samples to support Bucket Policy Only Samples.

  • Tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

I can't assign you @chestercun, PTAL. Thank you.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 14, 2018
Copy link
Contributor

@JustinBeckwith JustinBeckwith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once the tests (linter) all pass

@@ -49,7 +49,7 @@ async function createBucket(bucketName) {
async function listBuckets() {
// [START storage_list_buckets]
// Imports the Google Cloud client library
const {Storage} = require('@google-cloud/storage');
const { Storage } = require('@google-cloud/storage');

This comment was marked as spam.

@frankyn frankyn added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Dec 14, 2018
@frankyn
Copy link
Member Author

frankyn commented Dec 14, 2018

@JustinBeckwith silly question. This feature has a lockedTime in RFC 3339 format. I suspect the client should help developers convert this into a Date object. WDYT? I'm not a Node.js expert.

true
);
const [metadata] = await bucket.getMetadata();
assert.strictEqual(metadata.iamConfiguration.bucketPolicyOnly.enabled, true);

This comment was marked as spam.

This comment was marked as spam.

@jkwlui
Copy link
Member

jkwlui commented Dec 14, 2018

@frankyn looks like we've never return Date object for datetime strings in nodejs-storage.

@stephenplusplus have we ever discussed whether to convert datetime strings to Date object in handwritten libraries before?

@stephenplusplus
Copy link
Contributor

Sorry I missed this question. I think our rule has been to simplify a handwritten response format as best we can, and leave the API's raw response format as it came.

Considering a made-up method:

file.getUsefulInfo((err, info, apiResponse) => {
  info.createdAt === Date('...')
  info.size === Number(8800)

  apiResponse.createdAt === 'long-string-of-numbers'
  apiResponse.size === '8800'
})

So, if a method exists and we can be more helpful by returning a handwritten response, we should be. For the apiResponse, I think we should leave it be, as opposed to iterating over it with best effort type conversion, as we might run into some unintentional side effects.

@frankyn
Copy link
Member Author

frankyn commented Jan 8, 2019

Thanks @stephenplusplus and @kinwa91! Let's keep as-is. I'll resolve conflicts and merge after the workaround in this PR is no longer needed, e.g. Tomorrow EOD (Wednesday).

@frankyn frankyn removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Jan 11, 2019
@frankyn
Copy link
Member Author

frankyn commented Jan 15, 2019

@kinwa91 are you okay if I merge?

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