Files
floci/src/test/java
Marius Volkhart 742bb8cf03 fix(s3): return default SSE-S3 from GetBucketEncryption instead of 404 (#1838)
* fix(s3): return default SSE-S3 from GetBucketEncryption instead of 404

Real S3 no longer 404s GetBucketEncryption for a bucket with no explicit
config: since 2023-01-05 every bucket has SSE-S3 (AES256) default encryption,
so GetBucketEncryption returns that config rather than
ServerSideEncryptionConfigurationNotFoundError.

  https://docs.aws.amazon.com/AmazonS3/latest/userguide/default-bucket-encryption.html
  "Amazon S3 now applies server-side encryption with Amazon S3 managed keys
   (SSE-S3) as the base level of encryption for every bucket in Amazon S3.
   Starting January 5, 2023, all new object uploads to Amazon S3 are
   automatically encrypted."

Floci still emulated the pre-2023 404-when-unset behavior.

Some software relies on the new behavior, such as AWS's AWS Controllers for K8s
s3-controller: its Bucket read-back catches the NotFound code but does not
return, then dereferences ServerSideEncryptionConfiguration.Rules on a nil
response (nil-pointer panic that loops the controller). ACK code for reference:

  https://github.com/aws-controllers-k8s/s3-controller/blob/v1.6.0/pkg/resource/bucket/hook.go

Return the AWS default SSE-S3 config when none is set; an explicit
PutBucketEncryption config is still echoed back, and a missing bucket still
404s NoSuchBucket. Mirrors GetBucketRequestPayment's existing default.

Closes #1836

* test(s3): cover GetBucketEncryption default after DeleteBucketEncryption

Greptile flagged the delete-then-get path was uncovered: after
DeleteBucketEncryption nulls the stored config, GetBucketEncryption must
fall back to the default SSE-S3 (AES256) rather than the prior KMS config
or a 404. Adds an ordered case exercising the ?encryption DELETE handler
plus the null-after-delete branch.
2026-07-11 15:19:27 -05:00
..