drive-registry: surface Layer 0 errors from share, unshare and delete - #404
Open
ilchu wants to merge 2 commits into
Open
drive-registry: surface Layer 0 errors from share, unshare and delete#404ilchu wants to merge 2 commits into
ilchu wants to merge 2 commits into
Conversation
Collaborator
|
/aireview |
Collaborator
|
/aireview |
Contributor
There was a problem hiding this comment.
🤖 AI-generated review — advisory only, not a substitute for human review.
Summary
- Propagates native Layer 0 errors directly from share_drive, unshare_drive, and delete_drive in pallet-drive-registry.
- Removes redundant MembershipUpdateFailed and BucketCleanupFailed error variants along with an unused owner check.
- Updates unit tests, subxt metadata bindings, and end-to-end test expectations.
share_drive carried an empty `if drive.owner != who {}` block that was
meant to become an owner bypass and never did, and all three calls
that reach into Layer 0 flattened every failure into a generic
drive-registry error. A caller could not tell "not an admin" from
"bucket full" or "last admin cannot leave".
The bypass is dropped rather than built: bucket admins are the
authority, and the drive owner is one unless they stepped down, so a
Layer 1 override would only weaken Layer 0's rules. The three calls
now propagate the Layer 0 error unchanged, which makes
MembershipUpdateFailed and BucketCleanupFailed dead, so they go too.
The permission test that only ever hit DriveNotFound is replaced by
one that creates a drive and checks that a stranger's share and
unshare both fail with NotBucketAdmin. The drive lifecycle e2e step
expects the same.
ilchu
force-pushed
the
ic/drive-share-auth
branch
from
September 10, 2026 12:47
172abd6 to
7c61dca
Compare
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.
share_drivecarried an emptyif drive.owner != who {}block whose comments described an owner bypass that was never written, and all three drive-registry calls that reach into Layer 0 flattened every failure into a generic error of their own. A caller could not tell "not an admin" from "bucket is full" or "the last admin cannot leave". The dead-variant check in #403 flagged the never-raisedNotAuthorizedToSharethis was meant to become.The bypass is dropped rather than built. Bucket admins are the authority, and the drive owner is one unless they stepped down, so a Layer 1 override would only weaken Layer 0's rules. Share, unshare and delete now propagate the Layer 0 error unchanged, which makes
MembershipUpdateFailedandBucketCleanupFaileddead, so they go too and the bindings are regenerated.The permission test that only ever hit
DriveNotFoundis replaced by one that creates a drive and checks that a stranger's share and unshare both fail withNotBucketAdmin. The drive lifecycle e2e step expects the same.