feat(config): add MAXIO_PUBLIC_BUCKETS for anonymous public-read buckets - #19
Open
lord007tn wants to merge 1 commit into
Open
feat(config): add MAXIO_PUBLIC_BUCKETS for anonymous public-read buckets#19lord007tn wants to merge 1 commit into
lord007tn wants to merge 1 commit into
Conversation
On boot, create each listed bucket if missing and flag it public-read with public_list off — the equivalent of MinIO's `mc anonymous set download`. For a bucket that already exists, force public_read on while PRESERVING its current public_list so a restart never reverts operator-set listing. Also harden the anonymous public-read bypass: deny `?uploadId`/`?partNumber` so an anonymous GET on a public bucket can no longer reach multipart list_parts and enumerate in-progress upload metadata. Adds integration coverage for create-and-flag, flip-existing, preserve-list, invalid/empty input, and the uploadId bypass block.
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.
Closes #18.
What
Adds
MAXIO_PUBLIC_BUCKETS(env /--public-buckets, aliasMINIO_PUBLIC_BUCKETS): a comma-separated list of buckets that, on boot, are created if missing and flagged public-read (read = true,list = false) — the single-binary equivalent of MinIO'smc anonymous set download. It mirrors the existingMAXIO_DEFAULT_BUCKETSand runs immediately after it, through the same provisioning path.Why
See #18: MaxIO already supports anonymous public-read per bucket, but only via the interactive console — there's no startup option, and no
PutBucketPolicyformc anonymousto target. This closes that gap for the common "serve public media over unsigned GET from an unattended boot" use case (e.g. adocker composestack with no human to click through the console).Behavior
MAXIO_DEFAULT_BUCKETS.public_readon while preserving its currentpublic_list— a restart never silently reverts a console-set listing. Only the read flag is forced.provision_default_buckets.Included hardening
While making public-read a first-class startup option, I also tightened the anonymous public-read bypass:
?uploadIdand?partNumbernow go through the bypass deny-list, so an anonymous GET on apublic_readbucket can no longer reach multipartlist_partsand enumerate in-progress upload metadata (a surface distinct from object read). Without this, exposing a bucket viaMAXIO_PUBLIC_BUCKETSwould also expose multipart listing.Config
MAXIO_PUBLIC_BUCKETS--public-bucketsMINIO_PUBLIC_BUCKETS)Tests
New integration coverage: create-and-flag (
read=true/list=false), flip-existing-private, preserve operator-setpublic_list, invalid/empty input, and the anonymous?uploadIdbypass block.Local checks matching CI:
cargo fmt --all -- --checkclean,cargo clippy --all-targets --all-features -- -D warningsclean.cargo testis green except the two pre-existingtest_folder_marker_with_children/test_multipart_sse_c_part_key_mismatch_rejectedcases, which reproduce on a cleanmainon Windows and are unrelated to this change.Notes
CLAUDE.mdconventions (MaxIOin prose,MAXIO_env prefix, MinIO-aliased for parity with the other vars).🤖 Generated with Claude Code