feat(storage)!: complete container/folder/file authorization - #1595
Closed
ChrisPdgn wants to merge 2 commits into
Closed
feat(storage)!: complete container/folder/file authorization#1595ChrisPdgn wants to merge 2 commits into
ChrisPdgn wants to merge 2 commits into
Conversation
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.
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.
Successor to #1279 for #1173, rewritten on current
main. It does not port the squat, move, delete, or gRPC bugs from the stalev-next-storage-authzbranch. Do not close #1279 from this PR.Fixes #1173
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Client storage APIs (HTTP + gRPC file handlers):
404instead of being created.allowContainerCreationstill only affects Admin implicit container creation.foldernow creates/uses a personalcnd_<userId>/folder. Passing/still stores at the container root.cnd_<otherUserId>/path returns403. Client list-files remains deferred.The PR fulfills these requirements:
mainbranchfix #xxx, where "xxx" is the issue number)If adding a new feature, the PR's description includes:
Other information:
When
authorization.enabledis true, Storage registersContainer,Folder, andFilewith the currentoncePeerUp('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. gRPCdeleteFilereadsparams.id. Missing users andGrpcError403/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.