Repository navigation
fix: allow scoped bucket creation with legacy permission APIs - #314
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the legacy bucket-creation compatibility changes.
No open issues 🎉
What changed in this PR
Addresses #307 by allowing users with resource-scoped bucket-creation policies to proceed on legacy backends, while keeping the actual S3 CreateBucket request as the authorization boundary.
Changes:
- Uses action potential for the creation form and legacy submission checks, avoiding false denials from unresolved policy variables.
- Recognizes HTTP 426 as an unsupported permission endpoint before server support has been established.
- Adds regression coverage for legacy compatibility, scoped creation policies, and policies without creation permission.
| File | Description |
|---|---|
tests/lib/form-interaction.test.ts |
Updates permission mocks for the form’s action-potential check. |
tests/lib/effective-permissions.test.ts |
Tests HTTP 426 selecting legacy compatibility. |
tests/hooks/effective-permissions.test.ts |
Tests legacy creation eligibility with unresolved resource variables and absent creation permission. |
lib/effective-permissions.ts |
Adds HTTP 426 to unsupported-endpoint detection. |
hooks/use-permissions.tsx |
Uses action potential specifically for legacy bucket.create checks. |
components/buckets/new-form.tsx |
Uses mayCapability for creation eligibility while preserving separate optional-setting permissions. |
Review effort: Balanced
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.
Pull Request
Description
Fixes the bucket creation permission gate for users whose policies scope
s3:CreateBucketto resource patterns such as${aws:userid}or${aws:userid}-*.The creation form now uses action potential for legacy permission APIs, while the actual
CreateBucketrequest remains the authorization boundary. The legacy compatibility path also recognizes HTTP 426 responses from older permission endpoints.Type of Change
Testing
All checks passed. The test suite completed 1244 tests successfully.
Checklist
Related Issues
Closes #307
Screenshots (if applicable)
No layout, styling, or copy changes. This PR changes permission-gated behavior and covers the affected states with automated tests.
Additional Notes
The legacy fallback only uses action potential for
bucket.create. Other capabilities continue to fail closed when the permission service is unavailable.