Repository navigation
Add S3 ListBuckets, DeleteBucket and DeleteObjects - #202
Merged
Merged
Conversation
GET / lists buckets, with prefix, max-buckets and continuation-token.
DELETE /{bucket} deletes an empty bucket and refuses one with objects in
it with BucketNotEmpty; the journal records it as a NAMESPACE record with
op 2. POST /{bucket}?delete deletes up to 1000 keys in one batch. A PUT
checks its bucket again at the commit, since buckets can now go away.
Multipart upload moves to #201.
Fixes #159
saworbit
enabled auto-merge (squash)
November 14, 2026 01:37
4 tasks
This was referenced Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #159
GET /is ListBuckets:ListAllMyBucketsResultwith each bucket's name and creation date, in byte order. It takesprefix,max-buckets(1 to 10000) andcontinuation-token. Other parameters, such asbucket-region, getNotImplemented.DELETE /{bucket}is DeleteBucket. A bucket holding objects gets409 BucketNotEmpty. A key whose capsulespacectl deleteremoved reads as missing, so it doesn't count: it's unbound in the batch that deletes the bucket, and doesn't come back if the bucket is created again.DELETE /{bucket}?policyand other configuration deletes still getNotImplemented, so they can't delete the bucket.POST /{bucket}?deleteis DeleteObjects. All the deletes commit as one journalBATCH. Keys that aren't there count as deleted, as with DELETE.Quietreports only errors. A key given with a version id other thannullgets an error and is left alone, since there's no versioning. APOSTwithout?deletestill getsNotImplemented.Delete,Object,Key,VersionIdandQuiet, and ignoresETag,LastModifiedTimeandSize. It refuses comments, CDATA, a DOCTYPE, processing instructions, unknown elements or entities, characters XML can't carry, and more than 1000 objects, all withMalformedXML. So it never reads a document differently from an XML parser.NAMESPACErecord with op 2, which the format reserved for it (§5.5). The index and journal compaction both drop the namespace. A build from before this refuses a store that holds one.NoSuchBucketand leaves nothing.Tests: HTTP tests for ListBuckets paging, prefix and bad parameters; DeleteBucket on a full, empty and missing bucket, and creating it again; DeleteObjects with entities, duplicates, a versioned key, quiet mode, a broken document and a missing bucket. Lifecycle tests: a deleted bucket and a DeleteObjects survive a restart and a lost index, a dangling key doesn't come back, and a PUT racing DeleteBucket stores nothing. Parser unit tests cover what S3 clients send and 19 documents it must refuse. The journal compaction tests now delete namespaces too, without changing their random draws (see #188).
Fifteen mutants each fail a test: DeleteBucket ignoring live objects, leaving dangling keys or taking any query; the PUT skipping its commit-time bucket check; the index, compaction or decoder mishandling a namespace delete; ListBuckets ignoring the token or the prefix; DeleteObjects deleting versioned keys, ignoring Quiet or dropping a capsule twice; and the parser accepting comments, any element or control characters. Nothing tests DeleteBucket committing outside the lock. That race needs a hook to pause it between its check and its commit, and my attempt at that mutant still took the lock. I ran boto3 against
serve-s3:list_bucketsand its paginator,delete_objects,Bucket.objects.all().delete()anddelete_bucketwork. The AWS CLI isn't installed here, so it's still untested.Docs: CHANGELOG, on-disk-format §4.2, §5.5, §6 and §7, QUICKSTART_S3.