Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gate)!: new policy spec #937

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

feat(gate)!: new policy spec #937

wants to merge 9 commits into from

Conversation

michael-0acf4
Copy link
Contributor

@michael-0acf4 michael-0acf4 commented Dec 10, 2024

Migration notes

  • Replaced true, false, and null to ALLOW, DENY and PASS.

Composition rules:

  1. On traversal order:
  • ALLOW: allow parent and all its children (ignore inner policies)
  • DENY: deny parent and all its children (ignore inner policies)
  • PASS: pass through parent and evaluate each children (no-op, equivalent to no policies)
  1. On a single type (a.with_policy(X).with_policy(Y)):

ALLOW and DENY compose the same as true and false with the AND gate, PASS does not participate.

  • ALLOW & P = P
  • DENY & P = DENY (e.g. DENY & ALLOW = DENY)
  • PASS & P = P (does not participate)
  • The change comes with new or modified tests
  • Hard-to-understand functions have explanatory comments
  • End-user documentation is updated to reflect the change

@michael-0acf4 michael-0acf4 changed the title feat: policy spec feat: new policy spec Dec 10, 2024
@michael-0acf4 michael-0acf4 changed the title feat: new policy spec feat(gate)!: new policy spec Dec 12, 2024
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.

2 participants