Skip to content

fix: prevent creating new buckets with the name 'public' #694

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

itslenny
Copy link
Contributor

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Users can create buckets named "public" using the API

What is the new behavior?

A 400 error is thrown if a user tries to create a bucket named "public" via API or S3 protocol

The studio UI already prevents using "public" as a bucket name. This change mirrors that behavior in the API.

Additional context

A bucket with the name "public" causes issues with our api route resolution.

For example, if an object's path is public/something/file.png:

A request to /object/info/:bucketName/* routes to /object/info/public/:bucketName/* and returns a BUCKET NOT FOUND error for the bucket "something"

Also, a request to /object/:bucketName/* routes to /object/public/:bucketName/* and results in the same error

@coveralls
Copy link

coveralls commented May 16, 2025

Pull Request Test Coverage Report for Build 15471315258

Details

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.01%) to 77.806%

Files with Coverage Reduction New Missed Lines %
src/internal/database/tenant.ts 2 82.3%
Totals Coverage Status
Change from base Build 15466403204: -0.01%
Covered Lines: 17396
Relevant Lines: 22195

💛 - Coveralls

@itslenny itslenny force-pushed the fix/dont-allow-buckets-named-public branch from c9661c0 to 1e15b11 Compare June 5, 2025 15:39
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.

2 participants