View as Markdown

Let an agent write#

A change the person can undo: one approval, reused like a read.

Level 1: A person approves with a passkey.
Class write: Something changes and can be undone. The approval can be reused.
routes.append(route("POST", "/notes", "notes:write", cls="write", level=1, resource="note:*", summary="Add a note",
                    body={"text": "the note"}))
templates["notes:write"] = "Add and change your notes"


@app.post("/notes")
def add_note():
    return notes.add(g.allowedby.human_id, str(request.json.get("text", ""))), 201

Run in 8 languages on this version. See the results

What the test proves#

  • without an approval: 401 grant_required
  • the person approves, the note is added: 201
  • a body changed on the way is refused and nothing is written