Skip to content

Commit 87ef2ea

Browse files
authored
docs(storage): redirect users to bucket methods for SignedURL and PostPolicy (#5832)
1 parent eec76b7 commit 87ef2ea

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

storage/post_policy_v4.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ func conditionStatusCodeOnSuccess(statusCode int) PostPolicyV4Condition {
239239

240240
// GenerateSignedPostPolicyV4 generates a PostPolicyV4 value from bucket, object and opts.
241241
// The generated URL and fields will then allow an unauthenticated client to perform multipart uploads.
242+
// If initializing a Storage Client, instead use the Bucket.GenerateSignedPostPolicyV4
243+
// method which uses the Client's credentials to handle authentication.
242244
func GenerateSignedPostPolicyV4(bucket, object string, opts *PostPolicyV4Options) (*PostPolicyV4, error) {
243245
if bucket == "" {
244246
return nil, errors.New("storage: bucket must be non-empty")

storage/storage.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,8 @@ func v4SanitizeHeaders(hdrs []string) []string {
569569
// access to a restricted resource for a limited time without needing a
570570
// Google account or signing in. For more information about signed URLs, see
571571
// https://cloud.google.com/storage/docs/accesscontrol#signed_urls_query_string_authentication
572+
// If initializing a Storage Client, instead use the Bucket.SignedURL method
573+
// which uses the Client's credentials to handle authentication.
572574
func SignedURL(bucket, object string, opts *SignedURLOptions) (string, error) {
573575
now := utcNow()
574576
if err := validateOptions(opts, now); err != nil {

0 commit comments

Comments
 (0)