Skip to content

feat(storage)!: complete container/folder/file authorization - #1595

Closed
ChrisPdgn wants to merge 2 commits into
mainfrom
cursor/storage-complete-authz
Closed

feat(storage)!: complete container/folder/file authorization#1595
ChrisPdgn wants to merge 2 commits into
mainfrom
cursor/storage-complete-authz

Conversation

@ChrisPdgn

Copy link
Copy Markdown
Contributor

Successor to #1279 for #1173, rewritten on current main. It does not port the squat, move, delete, or gRPC bugs from the stale v-next-storage-authz branch. Do not close #1279 from this PR.

Fixes #1173

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes
  • Other (please describe)

Does this PR introduce a breaking change?

  • Yes
  • No

Client storage APIs (HTTP + gRPC file handlers):

  • Missing containers return 404 instead of being created. allowContainerCreation still only affects Admin implicit container creation.
  • An omitted folder now creates/uses a personal cnd_<userId>/ folder. Passing / still stores at the container root.
  • Creating under a missing cnd_<otherUserId>/ path returns 403. Client list-files remains deferred.

The PR fulfills these requirements:

  • It's submitted to the main branch
  • When resolving a specific issue, it's referenced in the PR's description (e.g. fix #xxx, where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature

Other information:

When authorization.enabled is true, Storage registers Container, Folder, and File with the current oncePeerUp('authorization') lifecycle and maintains owner relations along the path. The default container is never owned and is created on both DB and provider if missing. Folder/container delete pages nested relation cleanup. gRPC deleteFile reads params.id. Missing users and GrpcError 403/404 are not wrapped as INTERNAL 500.

Public read-without-auth, module schema ownership, Admin-only container create, and public URI / CDN / disposition / local URL upload behavior are unchanged.

Storage unit tests: 69 passed.

Open in Web Open in Cursor 

Register Container, Folder, and File as a filesystem-shaped ReBAC
tree using the current oncePeerUp authz lifecycle.

Client file APIs no longer create missing containers. An omitted
folder resolves to a personal cnd_<userId>/ folder, and creating
under another user's missing personal root is denied.

Fixes #1173

BREAKING CHANGE: Client storage APIs return 404 for missing
containers instead of creating them. An omitted folder now
creates cnd_<userId>/.
Share admin container/folder setup, resolve file ids consistently,
and drop the unused getFileUrl fallback.
@ChrisPdgn ChrisPdgn closed this Sep 9, 2026
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.

[Feature]: Complete Storage Authorization

2 participants