mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
* fix(s3): route the accelerate subresource instead of falling through
PUT /{bucket}?accelerate fell through to CreateBucket: outside the
default region it failed with BucketAlreadyOwnedByYou, and inside it
the idempotent-create path returned a silent 200 without storing
anything, so PutBucketAccelerateConfiguration could not be applied
either way. GET /{bucket}?accelerate fell through to ListObjects and
returned a ListBucketResult, which the SDK silently parses as "not
configured". DELETE /{bucket}?accelerate fell through to DeleteBucket
and deleted an empty bucket outright.
Store the Transfer Acceleration status on the bucket, following the
requestPayment pair as the closest-shaped precedent: PUT requires the
body to parse to the AccelerateConfiguration root (checked with a new
XmlParser.rootElementName primitive, so an absent, truncated, non-XML
or wrong-root body is MalformedXML on every branch) and validates
Enabled/Suspended, while a configuration without the optional Status
element is accepted and leaves the stored state unchanged; GET
returns the stored status, or an AccelerateConfiguration with no
Status element for a bucket that has never been configured; DELETE,
which AWS does not define for this subresource, returns
MethodNotAllowed instead of falling through.
Closes #2295
* fix(s3): resolve accelerate requests to their own IAM actions
The subresource override in IamActionRegistry covered only acl and
tagging, so with auth enforcement enabled a PUT /{bucket}?accelerate
resolved to s3:CreateBucket through the generic bucket rule - a
principal allowed only to create buckets could reconfigure
acceleration on an existing bucket. Map bucket-level GET and PUT to
their own actions instead.
The mapping applies only when the path is bucket-level and no acl or
tagging parameter is present: the object routes ignore ?accelerate,
so an object request keeps resolving to its object action, and a
stricter acl or tagging resolution can never be downgraded by
appending an inert parameter. A bare DELETE stays on the rule table,
since AWS defines no delete action for this subresource.
* fix(s3): yield the accelerate IAM mapping to earlier subresources
A request carrying ?accelerate plus a subresource the controller
dispatches earlier - ?requestPayment, say - executes that other
operation while resolving to the accelerate action, so a principal
holding only the accelerate permission could read or change an
unrelated configuration. Wire-probed: PUT with both parameters
stores the request-payment payer, not an acceleration state.
The accelerate mapping now yields whenever such a subresource rides
along, falling back to the standard rule table - exactly what a
plain ?requestPayment request resolves to today. The yield lists
are method-aware because the dispatch chains are: ?uploads blocks
accelerate on GET but is inert on PUT, where accelerate still
executes and keeps its own action.