Skip to content

Refuse PUTs into missing buckets, check new bucket names, and move the health check - #187

Merged
saworbit merged 1 commit into
mainfrom
fix/bucket-names
Nov 13, 2026
Merged

saworbit merged 1 commit into
mainfrom
fix/bucket-names

Conversation

@saworbit

Copy link
Copy Markdown
Owner

Fixes #164

  • An S3 PUT into a bucket that doesn't exist fails with 404 NoSuchBucket, as in S3. It used to create the bucket, so a typo made a bucket you couldn't find or remove. The check runs before the body is stored.
  • A new bucket's name must follow S3's rules: 3 to 63 lowercase letters, digits, dots and hyphens, starting and ending with a letter or digit, no .., and not an IP address. Otherwise InvalidBucketName, with a message that says the rules.
  • Buckets an older build created keep working for reads, writes, listing and deletes, and creating one again is still not an error. Only new names are checked.
  • The health check moved from /health to /-/health. A new bucket's name can't start with -, so it can't hide a bucket. A bucket named health lists like any other.
  • I kept no auto create flag. The quick start now creates its bucket first, and so does the boto3 snippet.

Tests: new HTTP tests cover a PUT into a missing bucket (404, data log unchanged), the naming rules, old bucket names, and the health route. Existing tests now create their buckets first, and the one and two letter bucket names in them became valid names. Eight mutants each fail a test: no bucket check on PUT, no name check, and dropping the IP, double dot, edge or length rule. Also checking old names on create, and the health route back at /health. I ran the quick start, curl and boto3 by hand against serve-s3.

Docs: CHANGELOG, QUICKSTART_S3, and the write table in on-disk-format §6.

…e health check

An S3 PUT into a bucket that doesn't exist now fails with NoSuchBucket,
as in S3, instead of creating the bucket. A new bucket's name must follow
S3's naming rules. Buckets an older build created keep working. The health
check moved to /-/health, so a bucket named health can be listed.

Fixes #164
@saworbit
saworbit enabled auto-merge (squash) November 13, 2026 21:33
@saworbit
saworbit merged commit fdd6415 into main Nov 13, 2026
3 checks passed
@saworbit
saworbit deleted the fix/bucket-names branch November 14, 2026 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UX] Bucket names aren't validated, PUT auto-creates buckets, and a bucket named "health" can't be listed

1 participant