Expand description
The subjects a policy judges, and the diff a write carries to one.
didbot-pds’s write and OAuth paths build every subject here, and
didbot-policy-check builds the same ones in a browser, so a page judges
a hypothetical request the way the server judges a real one. Nothing here
reads a clock: the instant is the caller’s, so the two agree on what “now”
was.
§The diff carries values, not just paths
A rule that means to test a value cannot, from a path alone, tell a
legitimate edit from a delete that removed the same path. Change
carries both sides’ values instead, with absence itself represented as a
value (None), so an evaluator can test what changed to what rather
than merely that something at this path changed. diff computes it
completely: every path whose value differs between before and after,
including every path in a wholly new record (a create, before: None
throughout) and every path in a wholly removed one (a delete, after: None throughout). There is no “empty diff for a delete” case, and a gate
is entitled to rely on that.
Nothing here is a payload log. Change borrows from the two Values a
write already holds in memory for the length of one judgment, and nothing
stores, logs, or returns a Change past that call.
Structs§
- Owned
Change - One field path whose value differs between before and after a write, as this crate computes and holds it.
Functions§
- blob_
subject - Builds the
Subject::Bloba gate judges one upload against. - borrow
- Borrows a whole diff at once. See
OwnedChange::as_change. - create_
subject - Builds the
Subject::Createa gate judges for one pool and zone a create could land in.attributesis the creating account’s, when this server hosts it;nameandlabelare set when the create gave a name. - diff
- Computes the complete diff between
beforeandafter. - diff_
into 🔒 - grant_
subject - Builds the
Subject::Granta gate judges one pushed authorization request against, before any account is known. - join 🔒
- token_
subject - Builds the
Subject::Tokena gate judges before a token is issued toclient_idforaccount: an authorization code exchanged, or a refresh token rotated.scopesare the wire strings the token would carry. - universal 🔒
- A deployment’s facts and the instant, as every subject carries them.
- write_
subject - Builds the
Subject::Writea gate judges one write against.