Repository navigation
feat(mandates): let an app ask whether a mandate still stands - #36
Merged
Merged
Conversation
An app that let a request through keeps the mandate's id. To show that
mandate later ("signed on the 3rd, stopped on the 9th") it had no way to
ask stem without a fresh chain and proof. MandateGateway.status(id)
answers with the state and the dates, nothing about the person, and
writes nothing to the trail. It starts from stem's list of mandates, so
an id nobody issued does not create a Durable Object.
|
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.



What & why
An app that let a request through keeps the mandate's id (
r.mandatefromauthorize). When it wants to show that mandate later, for example "signed on the 3rd, stopped on the 9th" next to something the mandate once let through, it had no way to ask stem without a fresh chain and a proof of possession.MandateGateway.status(id)answers that over the service binding:authorize, never bystatus. There is no HTTP route for it.The first app to use it will be a public page that checks receipts for generated speech and shows whether the voice owner's mandate still stands.
How to test
npm run check: 140 tests pass, typecheck and the dry-run build are clean. Run locally on Node 22, CI runs it on Node 26.test/mandates.test.ts("asking whether one still stands"): an active mandate with its dates, an unknown id and malformed ids (no object is created), an expired one, a stop that reached the object but not yet the list, a stop through the account, an empty trail afterwards, and mandates switched off.No migration, no new binding, no config change.
Checklist
npm run checkpasses