Explicit include/exclude in the Expand exclusion tree (#31)#61
Merged
Conversation
The UsersetTree EXCLUSION node encoded its operands by child position (children[0]=include, children[1]=exclude), a fragile convention documented only by a comment with no structural guarantee of order or arity. Add explicit include (field 7) and exclude (field 8) fields to UsersetTree. EXCLUSION nodes now populate these and leave children empty; UNION/INTERSECTION keep using children. The proto conversion and the Expand e2e test are updated to the explicit encoding, and a connect-level round-trip test pins that exclusion uses include/exclude (never children) while union still uses children. Documents the encoding in the authorization model. Closes #31
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.
Closes #31 — replaces the fragile positional encoding of EXCLUSION nodes in the Expand
UsersetTree(wherechildren[0]=include,children[1]=exclude, documented only by a comment) with explicit fields.UsersetTree.include = 7/exclude = 8. An EXCLUSION node now carries its operands explicitly (effective set = include − exclude) and leaveschildrenempty; UNION/INTERSECTION still usechildren.authz.Treewas already explicit (Exclude *ExcludeTree{Include, Exclude}); onlytreeToProtoand the e2e test carried the positional convention — both updated, positional code removed.Additive proto ·
go test -race ./...✓ (incl. real Postgres) · lint 0 ✓.Closes #31