Skip to content

fix: allow scoped bucket creation with legacy permission APIs - #314

Merged
cxymds merged 1 commit into
mainfrom
cxymds/fix/issue-307-bucket-create-permissions
Nov 23, 2026
Merged

cxymds merged 1 commit into
mainfrom
cxymds/fix/issue-307-bucket-create-permissions

Conversation

@cxymds

@cxymds cxymds commented Nov 23, 2026

Copy link
Copy Markdown
Member

Pull Request

Description

Fixes the bucket creation permission gate for users whose policies scope s3:CreateBucket to resource patterns such as ${aws:userid} or ${aws:userid}-*.

The creation form now uses action potential for legacy permission APIs, while the actual CreateBucket request remains the authorization boundary. The legacy compatibility path also recognizes HTTP 426 responses from older permission endpoints.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Performance improvement
  • Test improvements
  • Security fix

Testing

  • Unit tests added/updated
  • Manual testing completed
pnpm install --frozen-lockfile
pnpm test:run
pnpm type-check
pnpm lint
pnpm format:check
git diff --check

All checks passed. The test suite completed 1244 tests successfully.

Checklist

  • Code follows the project's style guidelines
  • Self-review completed
  • TypeScript types are properly defined
  • All commit messages are in English (Conventional Commits)
  • All existing tests pass
  • No new dependencies added, or they are justified

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.

Copilot AI balanced review requested due to automatic review settings November 23, 2026 02:45
@cxymds
cxymds merged commit 5859dd7 into main Nov 23, 2026
11 checks passed
@cxymds
cxymds deleted the cxymds/fix/issue-307-bucket-create-permissions branch November 23, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

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.

[BUG] Bucket creation is blocked for users with resource-scoped policies using ${aws:userid}

2 participants