bend-kit-authz Releases (1): 0.1.0.0 0xdb1e37671e3c0872f3bf78d730b5b176 indexed https://jend.leeeet.dev/files.txt?path=bend-kit-authz@0.1.0.0 Definitions (20): Authz.Request (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=Request) # What a policy may ask about one request. A `None` field is missing information: # the caller did not authenticate a subject, load roles, or find the owner. type Request is Data: Request{subject: Maybe<&2, String>, roles: Maybe<&2, List<&2, String>>, owner: Maybe<&2, String>, action: String, resource: String} Authz.Tri (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=Tri) # A target answers Yes, No, or Unknown when it needs a missing field. type Tri is Data: Yes{} No{} Unknown{} Authz.Target (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=Target) type Target is Data: Everyone{} Nobody{} Action{name: String} Resource{name: String} Subject{name: String} Role{name: String} Owner{} AllOf{a: Target, b: Target} Authz.Decision (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=Decision) # Abstain means that no rule applies. `granted` treats it as a denial. type Decision is Data: Allow{} Deny{} Abstain{} Authz.Policy (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=Policy) type Policy is Data: Permit{target: Target} Forbid{target: Target} DenyOverrides{a: Policy, b: Policy} Intersect{a: Policy, b: Policy} Authz.tri (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=tri) def tri(b: Bool) -> Tri: Authz.has (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=has) def has(+name: String, xs: List<&2, String>) -> Bool: Authz.subject.is (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=subject.is) def subject.is(name: String, s: Maybe<&2, String>) -> Tri: Authz.role.is (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=role.is) def role.is(name: String, r: Maybe<&2, List<&2, String>>) -> Tri: Authz.owner.is (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=owner.is) def owner.is(x: String, o: Maybe<&2, String>) -> Tri: Authz.owner.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=owner.of) def owner.of(s: Maybe<&2, String>, o: Maybe<&2, String>) -> Tri: Authz.all (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=all) # Kleene conjunction: No wins, then Unknown. def all(a: Tri, b: Tri) -> Tri: Authz.matches (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=matches) def matches(t: Target, +req: Request) -> Tri: Authz.permit (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=permit) # A permit grants only on Yes. Unknown cannot grant. def permit(m: Tri) -> Decision: Authz.forbid (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=forbid) # A forbid denies on Yes and on Unknown: it fails closed. def forbid(m: Tri) -> Decision: Authz.deny_overrides (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=deny_overrides) # Deny wins, then Allow, then Abstain. def deny_overrides(a: Decision, b: Decision) -> Decision: Authz.intersect (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=intersect) # Allow only when both allow. Deny wins over Abstain. def intersect(a: Decision, b: Decision) -> Decision: Authz.decide (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=decide) def decide(p: Policy, +req: Request) -> Decision: Authz.allowed (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=allowed) def allowed(d: Decision) -> Bool: Authz.granted (https://jend.leeeet.dev/definition.txt?path=bend-kit-authz@0.1.0.0/authz.bend&name=granted) # Default deny: only Allow grants. def granted(p: Policy, +req: Request) -> Bool: