View as Markdown

Ask for personal data#

The person shares what they choose, encrypted to your app. The agent never sees it.

Python only today.

Level 2: A person whose identity is verified approves with a passkey.
Class write-hard: Hard to undo. The app creates the approval for that exact request, and it works once.
routes.append(route("POST", "/tickets", "tickets:buy", cls="write-hard", level=2, resource="ticket:new",
                    disclose=["legal_name"], disclose_optional=["email"], summary="Buy a ticket in the person's name"))
templates["tickets:buy"] = "Buy a ticket in your name"
settings["disclosure"] = {  # why you ask and how long you keep it: the person reads this before sharing
    "legal_name": {"purpose": {"en": "The name on the ticket"}, "retention_days": 30},
    "email": {"purpose": {"en": "To send you the ticket"}, "retention_days": 30},
}


@app.post("/tickets")
def buy_ticket():
    # Sent to your app encrypted, by the person's node. The agent never sees it.
    person = app.extensions["allowedby"].personal_data(g.allowedby)
    return {"ticket": "T-1", "named": "legal_name" in person, "emailed": "email" in person}, 201

What the test proves#

  • the person sees what is asked and for how long, shares both, and the app gets them: 201
  • the agent never sees the data: only its hash is in the approval it carries
  • what is optional stays private unless the person says so: 201 without it