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

Aws::S3::PresignedPost does not support tagging field #2919

Open
2 tasks
casret opened this issue Sep 29, 2023 · 3 comments
Open
2 tasks

Aws::S3::PresignedPost does not support tagging field #2919

casret opened this issue Sep 29, 2023 · 3 comments
Labels
bug This issue is a bug. feature-request A feature should be added or improved. service-api General API label for AWS Services.

Comments

@casret
Copy link

casret commented Sep 29, 2023

Describe the feature

The PresignedPost does not seem to support the 'tagging' form field.

Use Case

I would like to require certain tags for objects that are uploaded in s3.

Proposed Solution

Ideally you would be able to pass a tagging: parameter what would take the same format as put_object_tagging from the s3 client.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

1.132.1

Environment details (OS name and version, etc.)

Ubuntu

@casret casret added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 29, 2023
@jterapin jterapin added investigating Issue is being investigated and removed needs-triage This issue or PR still needs to be triaged. labels Sep 29, 2023
@jterapin
Copy link
Contributor

Thank you for the ticket. We will investigate and let you know.

@jterapin
Copy link
Contributor

jterapin commented Oct 4, 2023

This is an ongoing bug on S3's side. There's an internal tracking ticket with S3 - which was already created when this #2762 came in. Until this S3 bug is resolved, we are blocked on implementing this feature since PresignedPost uses presigned_url.

In the meantime, I will follow up with S3 on the status.

@jterapin jterapin added service-api General API label for AWS Services. bug This issue is a bug. and removed investigating Issue is being investigated labels Oct 4, 2023
@sj26
Copy link

sj26 commented Dec 18, 2023

Also keen to see this fixed, so we can use it at Buildkite 🙏

Something like this sorta works to make the client side bit work, but it fails with a "400 Bad Request" from S3:

require "aws-sdk-s3"

# Aws' sdk doesn't natively support this in presigned posts, but is supported
# by the S3 API:
#
# https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html
#
Aws::S3::PresignedPost.class_eval do
  # @!method tagging(hash)
  #   Tagging hash to store with the uploaded object. Turns into a header:
  #
  #     x-amz-tagging: Key=Value1&Key2=Value2&...
  #
  #   The header will be hoisted into params for presigned forms.
  #
  #   @param [Hash<String,String>] hash
  #   @return [self]
  define_field(:tagging) do |hash|
    with("x-amz-tagging", hash.to_query)
    self
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. feature-request A feature should be added or improved. service-api General API label for AWS Services.
Projects
None yet
Development

No branches or pull requests

3 participants