Skip to content

POST Object : Getting issues with V4 #8138

Description

@chvreddy

Thanks for stopping by to let us know something could be better!

Environment details

Environment details
OS: MAC
Ruby version: ruby 2.4.9p362 (2019-10-02 revision 67824) [x86_64-darwin19]
Gem name and version: gem 'google-cloud-storage', '1.29.1'

Steps to reproduce

Code example

ruby

V4 process using Post Object throws error:

STEPS TO PRODUCE:

conditions = [ ["starts-with", "$key", ""] ]

result = self.class.bucket.generate_signed_post_policy_v4("#{inbox_prefix}#{Time.current.to_i}_${filename}", signer: gcs_signed_url(nil, nil, "POST"), issuer: ENV["GCS_SERVICE_ACCOUNT"], expires: 10, conditions: conditions )

result.fields.merge!(success_action_redirect: success_action_redirect)

["starts-with", "$key", ""]: means the key value can start with anything right?
error:

<Error>
<Code>InvalidPolicyDocument</Code>
<Message>The content of the form does not meet the conditions specified in the policy document.</Message>
<Details>Invalid condition: [["starts-with","$key",""]]</Details>
</Error>

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions