when-free.openapps.xyz

Source

This app’s code and revision history are public. Download a copy or explore the files below.

Public
The app’s code and revision history are public.
Owned app · rev 2315d847681e
Run it yourself
Take the whole tree and run it on your own machine. The download needs no account. Cloning needs a sign-in.
Download .zip
bounded clone 3e1cb86700a5e96238d7a2f1
A copy you download is not bounded. The guarantees this app runs under - declared egress, proven invariants, writes that fail closed - live in the runtime serving this page, not in the files. What you get is auditable source you can read and run, with no runtime guarantees attached.
← All files
policy-tests/polls.json
{
  "version": "1",
  "name": "making a poll, joining by link, claiming with the admin key, and what strangers cannot do",
  "actors": { "Olga": "olga_guest", "Pat": "pat_guest", "Eve": "eve_guest", "Api": "api_principal" },
  "constants": { "BOUNDED_PUBLIC_PRINCIPAL_API": "api_principal" },
  "steps": [
    { "op": "setTime", "epoch": 1800000000 },

    { "op": "as", "who": "Olga" },
    { "op": "setMany", "writes": [
      { "path": "polls/pollAAAAAAAAAAAAAAAA", "data": { "title": "Lunch", "timezone": "UTC", "options": "[{\"id\":\"o1\",\"start\":1800100000}]", "closed": false, "createdBy": "$Pat", "createdAt": 1800000000 } },
      { "path": "polls/pollAAAAAAAAAAAAAAAA/joins/olga_guest", "data": { "at": 1800000000 } },
      { "path": "polls/pollAAAAAAAAAAAAAAAA/owners/olga_guest", "data": { "at": 1800000000 } },
      { "path": "pollkeys/pollAAAAAAAAAAAAAAAA", "data": { "key": "ownerkeyownerkeyownerkey" } }
    ], "shouldFail": true },
    { "op": "setMany", "writes": [
      { "path": "polls/pollAAAAAAAAAAAAAAAA", "data": { "title": "Lunch", "timezone": "UTC", "options": "[{\"id\":\"o1\",\"start\":1800100000}]", "closed": false, "createdBy": "$Olga", "createdAt": 1800000000 } },
      { "path": "polls/pollAAAAAAAAAAAAAAAA/joins/olga_guest", "data": { "at": 1800000000 } },
      { "path": "polls/pollAAAAAAAAAAAAAAAA/owners/olga_guest", "data": { "at": 1800000000 } }
    ], "shouldFail": true },
    { "op": "setMany", "writes": [
      { "path": "polls/pollAAAAAAAAAAAAAAAA", "data": { "title": "Lunch", "timezone": "UTC", "options": "[{\"id\":\"o1\",\"start\":1800100000},{\"id\":\"o2\",\"start\":1800200000}]", "closed": false, "createdBy": "$Olga", "createdAt": 1800000000 } },
      { "path": "polls/pollAAAAAAAAAAAAAAAA/joins/olga_guest", "data": { "at": 1800000000 } },
      { "path": "polls/pollAAAAAAAAAAAAAAAA/owners/olga_guest", "data": { "at": 1800000000 } },
      { "path": "pollkeys/pollAAAAAAAAAAAAAAAA", "data": { "key": "ownerkeyownerkeyownerkey" } }
    ] },
    { "op": "read", "path": "polls/pollAAAAAAAAAAAAAAAA" },
    { "op": "read", "path": "pollkeys/pollAAAAAAAAAAAAAAAA", "shouldFail": true },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA", "data": { "title": "Team lunch" } },

    { "op": "as", "who": "Eve" },
    { "op": "read", "path": "polls/pollAAAAAAAAAAAAAAAA", "shouldFail": true },
    { "op": "set", "path": "polls/pollBBBBBBBBBBBBBBBB/joins/eve_guest", "data": { "at": 1800000000 }, "shouldFail": true },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/joins/pat_guest", "data": { "at": 1800000000 }, "shouldFail": true },

    { "op": "as", "who": "Pat" },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/joins/pat_guest", "data": { "at": 1800000000 } },
    { "op": "read", "path": "polls/pollAAAAAAAAAAAAAAAA" },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA", "data": { "closed": true }, "shouldFail": true },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA/owners/pat_guest", "data": { "at": 1800000000 }, "shouldFail": true },
    { "op": "setMany", "writes": [
      { "path": "pollclaims/pollAAAAAAAAAAAAAAAA/c/pat_guest", "data": { "key": "wrongkeywrongkeywrongkey" } },
      { "path": "polls/pollAAAAAAAAAAAAAAAA/owners/pat_guest", "data": { "at": 1800000000 } }
    ], "shouldFail": true },
    { "op": "setMany", "writes": [
      { "path": "pollclaims/pollAAAAAAAAAAAAAAAA/c/pat_guest", "data": { "key": "ownerkeyownerkeyownerkey" } },
      { "path": "polls/pollAAAAAAAAAAAAAAAA/owners/pat_guest", "data": { "at": 1800000000 } }
    ] },
    { "op": "set", "path": "polls/pollAAAAAAAAAAAAAAAA", "data": { "chosen": "o1", "closed": true } },
    { "op": "read", "path": "pollclaims/pollAAAAAAAAAAAAAAAA/c/pat_guest", "shouldFail": true },
    { "op": "delete", "path": "polls/pollAAAAAAAAAAAAAAAA", "shouldFail": true },

    { "op": "as", "who": "Api" },
    { "op": "read", "path": "pollkeys/pollAAAAAAAAAAAAAAAA" },
    { "op": "set", "path": "pollkeys/pollAAAAAAAAAAAAAAAA", "data": { "key": "stolenstolenstolenstolen" }, "shouldFail": true },
    { "op": "expect", "expr": "get(/pollkeys/pollAAAAAAAAAAAAAAAA).key == 'ownerkeyownerkeyownerkey'" },
    { "op": "expect", "expr": "get(/polls/pollAAAAAAAAAAAAAAAA).chosen == 'o1'" }
  ]
}

Change history

Quality pass: comments, CSV export, share the final time, calendar menu, fixes
2315d84768 · 5 hours ago
Bounded source sync
145324066b · 1 day ago
Bounded source sync
ad9b674dac · 1 day ago
Bounded source sync
e5b69608f3 · 1 day ago
Bounded source sync
a1685914b0 · 1 day ago
Bounded source sync
7108f42d4d · 1 day ago
Bounded source sync
ffb51b672e · 1 day ago
Bounded source sync
23b5d0c53b · 1 day ago