-
Notifications
You must be signed in to change notification settings - Fork 367
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
samples: upload without authentication #1711
Conversation
Here is the summary of changes. You are about to add 2 region tags.
This comment is generated by snippet-bot.
|
…s/nodejs-storage into shaffeeullah/uploadwithoutauth
Warning: This pull request is touching the following templated files:
|
samples/README.md
Outdated
@@ -1855,6 +1856,23 @@ __Usage:__ | |||
|
|||
|
|||
|
|||
### Upload Without Auth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upload without authenticating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is proper sentence case so it'll render correctly when added to docs. Also provides more detail as to what "auth" means.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is autogenerated by a bot and cannot be changed (without a ton of effort, like contacting the team that wrote the bot)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I can change the word "auth" to "authenticating" by renaming the file the sample is in. Do you think i should make that change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be best to make that change. "Upload without auth" seems like it could imply many things (upload without authenticating, upload without OAuth, etc)
samples/uploadWithoutAuth.js
Outdated
async function uploadWithoutAuthentication() { | ||
const file = storage.bucket(bucketName).file(destFileName); | ||
let location; // endpoint to which we should upload the file | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this sample should be split into two separate samples as to not overload, but it's readable so not completely against it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we separate this into two samples, we run the risk of someone missing one of the samples and only learning one way it could be done. It also depends on how the page is structured though. @cbonnie do you have thoughts here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can definitely split this up into two samples and make it clear (in writing) that there's two ways to do the task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could nest them in the same region block: https://cloud.google.com/storage/docs/listing-objects#code-samples is an example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh cool! i didnt realize that. thanks for this example. i will make this change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…oogleapis/nodejs-storage into shaffeeullah/uploadwithoutauth
}, | ||
}); | ||
|
||
// endpoint to which we should upload the file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Endpoint"
…feeullah/uploadwithoutauth
This is the canonical sample for uploading data without authentication.
Tests to be written once we decide on the format of the sample.
Related customer issue: googleapis/gcs-resumable-upload#201