mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
feat(s3tables): expose bucket encryption configuration (#8523)
S3 Tables now serves GetTableBucketEncryption, returning the encryption configuration CreateTableBucket stored, a configured KMS key ARN included. A bucket created without one, or loaded from an older snapshot, reports AES256. It is configuration readback only: Floci does not encrypt table data or use the KMS key, and updating or deleting a bucket's encryption configuration is not implemented. Co-authored-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
1 parent
7a98f47742
commit
b0a4cc41cb
6 files changed
+254
-1
No files matched your search
@@ -61,6 +61,14 @@ public class S3TablesController {
|
||||
return Response.ok(bucketRepresentation(service.getTableBucket(decode(tableBucketArn), region(headers)))).build();
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/buckets/{tableBucketARN}/encryption")
|
||||
public Response getTableBucketEncryption(@Context HttpHeaders headers,
|
||||
@Encoded @PathParam("tableBucketARN") String tableBucketArn) {
|
||||
return Response.ok(Map.of("encryptionConfiguration",
|
||||
service.getTableBucketEncryption(decode(tableBucketArn), region(headers)))).build();
|
||||
}
|
||||
|
||||
@DELETE
|
||||
@Path("/buckets/{tableBucketARN}")
|
||||
public Response deleteTableBucket(@Context HttpHeaders headers, @Encoded @PathParam("tableBucketARN") String tableBucketArn) {
|
||||
|
||||
@@ -67,6 +67,11 @@ public class S3TablesService {
|
||||
return bucket;
|
||||
}
|
||||
|
||||
public synchronized Object getTableBucketEncryption(String tableBucketArn, String region) {
|
||||
Object configuration = getTableBucket(tableBucketArn, region).getEncryptionConfiguration();
|
||||
return configuration == null ? Map.of("sseAlgorithm", "AES256") : configuration;
|
||||
}
|
||||
|
||||
public synchronized List<TableBucket> listTableBuckets(String prefix, String region) {
|
||||
return store.scan(key -> key.startsWith(region + "::")).stream()
|
||||
.filter(bucket -> prefix == null || bucket.getName().startsWith(prefix))
|
||||
|
||||
Reference in new issue
Block a user