mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 23:59:27 -05:00
* fix(s3): place the encryption condition keys on a put, and on a part from its upload A policy on s3:x-amz-server-side-encryption or s3:x-amz-server-side-encryption-aws-kms-key-id read neither key, so a Deny under a negated operator refused every put, encrypted or not. A PutObject, CopyObject or CreateMultipartUpload now carries both from its headers, each value as sent, in the enforcement filter and in S3's own bucket policy check. A part or a completion sends neither header and carries what its upload recorded when it was created. A part naming an upload not held answers NoSuchUpload, as S3 does under such a policy. * fix(s3): check as an object write a PUT or POST naming an upload but not routed as a part The enforcement filter let through a request naming an upload not held, and judged one naming a held upload by that upload's encryption, on uploadId alone. A PUT with no partNumber, or a POST asking for a new upload, creates an object or an upload whatever that parameter says, so it skipped IAM or read the wrong encryption. Both now match the routes S3Controller takes as a part or a completion. A part copy naming an upload not held stays checked, since it names a source. * test(s3): put the multipart encryption cases beside kmsOnlyBucket The multipart cases copied S3BucketPolicyEnforcementIntegrationTest's two-statement KMS-only policy and BUCKET_KEY. They now sit beside kmsOnlyBucket and reuse it, with the policy written once (putKmsOnlyPolicy). The two cases whose upload is opened before the policy stands use a bucket with no default encryption, as before: S3 records the bucket's default on an upload that asks for none, where Floci records only what the request asks for.