Files
floci/src/main/java/io/github/hectorvent
ram-sarf f4a534c943 fix(s3): handle PutBucketRequestPayment instead of falling through to CreateBucket (#994)
PUT /{bucket}?requestPayment was not recognised as a sub-resource by
S3Controller, so the request fell through to the bucket-creation
handler. For any pre-existing bucket that returned
BucketAlreadyOwnedByYou (HTTP 409) — which broke real workloads such as
Terraform's aws_s3_bucket_request_payment_configuration on every
re-apply.

Add explicit handling for the requestPayment sub-resource, mirroring
the existing OwnershipControls / Acl flow:

- Bucket model gains a requestPaymentPayer field.
- S3Service.putBucketRequestPayment validates the bucket exists
  (NoSuchBucket / 404) and the payer value (BucketOwner | Requester);
  invalid payers return MalformedXML / 400 to match real S3.
- S3Service.getBucketRequestPayment returns the canonical
  RequestPaymentConfiguration XML, defaulting to BucketOwner when never
  set — real S3 never returns 404 for GetBucketRequestPayment.
- Controller dispatches PUT and GET ?requestPayment to the new methods.
  No DELETE handler is added; AWS does not expose one.

Regression test asserts the original Terraform-breaking case (a second
PUT on an existing bucket must return 200, not 409) along with default
GET, MalformedXML on invalid payer, and NoSuchBucket on missing bucket.
2026-05-22 17:51:15 -05:00
..