Files
floci/docs
Priamo Germosen 36b315d77b fix(s3): refuse Object Lock settings on a bucket without Object Lock (#5969)
PutObjectRetention, GetObjectRetention, PutObjectLegalHold and
GetObjectLegalHold on a bucket without Object Lock set or returned the
setting with a 200. S3 refuses them with 400 InvalidRequest, "Bucket is
missing Object Lock Configuration", as LocalStack's AWS-validated
recordings show, and Floci now does too, before it looks for the key.
A legal hold without a status is still refused as malformed first, as
recorded.

PutObject, CopyObject and CreateMultipartUpload applied a mode, a
retain-until date or a legal hold of ON on such a bucket as well, and
since deletes enforce the lock there too, a COMPLIANCE object in it
could not be deleted until its date passed. They are refused the same
way. No AWS document or recording covers object creation; moto refuses
the same headers with InvalidRequest under its own message, so the
recorded one is used. A legal hold of OFF sets no lock and is still
accepted.

In a bucket with Object Lock, GetObjectRetention and GetObjectLegalHold
of an object without a retention or a legal hold answered 200, with no
mode or with OFF. S3 was recorded answering both with 404
NoSuchObjectLockConfiguration, which they answer now.

PutObjectRetention saved a mode without a date, a date without a mode,
or a mode S3 does not know. S3 was recorded refusing a mode without a
date, and an unknown mode, with 400 MalformedXML, and a date without a
mode would now read as no retention at all, so all three are refused
that way. A retention naming neither still removes it.
2026-10-19 07:43:15 -05:00
..
2026-03-15 17:43:56 -05:00