View as Markdown

Let an agent read#

The person approves once with a passkey; the approval is reused until it expires or they withdraw it.

Level 1: A person approves with a passkey.
Class read: Nothing changes. The approval can be reused until it ends or the person withdraws it.
routes.append(route("GET", "/notes", "notes:read", level=1, resource="note:*", summary="List your notes"))
templates["notes:read"] = "Read your notes"


@app.get("/notes")
def list_notes():
    return {"notes": notes.list(g.allowedby.human_id)}

Run in 8 languages on this version. See the results

What the test proves#

  • an agent the person did not approve: 401 grant_required
  • the person approves the app's own sentence, then 200
  • the approval is reused: nobody is asked again
  • the same signed request sent twice is refused