time-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 4857f8a940b5
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 703ed60f2cc5ad3d98a5bf4a
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/handoff.json
{
 "version": "1",
 "name": "a guest's workspace moves to their email account with a one-time code, and nobody else's",
 "actors": {
  "Guest": "guest_id",
  "Real": "real_id",
  "Mallory": "mallory_id",
  "Other": "other_id"
 },
 "constants": {
  "BOUNDED_PUBLIC_PRINCIPAL_API": "api_principal"
 },
 "steps": [
  {
   "op": "setTime",
   "epoch": 1800000000
  },
  {
   "op": "as",
   "who": "Guest"
  },
  {
   "op": "setMany",
   "writes": [
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA",
     "data": {
      "name": "",
      "currency": "USD",
      "rate": 0,
      "weekStart": 1,
      "tz": "UTC",
      "createdBy": "$Guest",
      "createdAt": 1800000000
     }
    },
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/members/guest_id",
     "data": {
      "role": "owner",
      "invite": "created",
      "at": 1800000000
     }
    },
    {
     "path": "users/guest_id",
     "data": {
      "ws": "wsGuestAAAAAAAAAAAAA",
      "at": 1800000000
     }
    }
   ]
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/entries/e1",
   "data": {
    "description": "Work",
    "project": "",
    "tags": "[]",
    "billable": true,
    "start": 1799996400,
    "end": 1800000000,
    "at": 1800000000
   }
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA1",
   "data": {
    "by": "$Guest",
    "createdAt": 1800000000,
    "usedBy": ""
   }
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/shortcode",
   "data": {
    "by": "$Guest",
    "createdAt": 1800000000,
    "usedBy": ""
   },
   "shouldFail": true
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA2",
   "data": {
    "by": "$Guest",
    "createdAt": 1800000000,
    "usedBy": "$Guest"
   },
   "shouldFail": true
  },
  {
   "op": "as",
   "who": "Mallory"
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA3",
   "data": {
    "by": "$Mallory",
    "createdAt": 1800000000,
    "usedBy": ""
   },
   "shouldFail": true
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/members/mallory_id",
   "data": {
    "role": "owner",
    "invite": "handoffcodeAAAAAAAA1",
    "at": 1800000000
   },
   "shouldFail": true
  },
  {
   "op": "setMany",
   "writes": [
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/wrongcodeAAAAAAAAAAA",
     "data": {
      "by": "$Mallory",
      "createdAt": 1800000000,
      "usedBy": "$Mallory"
     }
    },
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/members/mallory_id",
     "data": {
      "role": "owner",
      "invite": "wrongcodeAAAAAAAAAAA",
      "at": 1800000000
     }
    }
   ],
   "shouldFail": true
  },
  {
   "op": "as",
   "who": "Real"
  },
  {
   "op": "setMany",
   "writes": [
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA1",
     "data": {
      "usedBy": "$Real"
     }
    },
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/members/real_id",
     "data": {
      "role": "api",
      "invite": "handoffcodeAAAAAAAA1",
      "at": 1800000000
     }
    }
   ],
   "shouldFail": true
  },
  {
   "op": "setMany",
   "writes": [
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA1",
     "data": {
      "usedBy": "$Real"
     }
    },
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/members/real_id",
     "data": {
      "role": "owner",
      "invite": "handoffcodeAAAAAAAA1",
      "at": 1800000000
     }
    }
   ]
  },
  {
   "op": "expect",
   "expr": "get(/ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA1).usedBy == 'real_id'"
  },
  {
   "op": "set",
   "path": "users/real_id",
   "data": {
    "ws": "wsGuestAAAAAAAAAAAAA",
    "at": 1800000000
   }
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/entries/e1",
   "data": {
    "description": "Edited after sign-in",
    "project": "",
    "tags": "[]",
    "billable": true,
    "start": 1799996400,
    "end": 1800000000,
    "at": 1800000000
   }
  },
  {
   "op": "as",
   "who": "Mallory"
  },
  {
   "op": "setMany",
   "writes": [
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA1",
     "data": {
      "usedBy": "$Mallory"
     }
    },
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/members/mallory_id",
     "data": {
      "role": "owner",
      "invite": "handoffcodeAAAAAAAA1",
      "at": 1800000000
     }
    }
   ],
   "shouldFail": true
  },
  {
   "op": "as",
   "who": "Guest"
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA2",
   "data": {
    "by": "$Guest",
    "createdAt": 1800000000,
    "usedBy": ""
   }
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA3",
   "data": {
    "by": "$Guest",
    "createdAt": 1800000000,
    "usedBy": ""
   }
  },
  {
   "op": "advanceTime",
   "seconds": 7201
  },
  {
   "op": "as",
   "who": "Other"
  },
  {
   "op": "setMany",
   "writes": [
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA2",
     "data": {
      "usedBy": "$Other"
     }
    },
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/members/other_id",
     "data": {
      "role": "owner",
      "invite": "handoffcodeAAAAAAAA2",
      "at": 1800000000
     }
    }
   ],
   "shouldFail": true
  },
  {
   "op": "setTime",
   "epoch": 1800000060
  },
  {
   "op": "as",
   "who": "Real"
  },
  {
   "op": "delete",
   "path": "ws/wsGuestAAAAAAAAAAAAA/members/guest_id"
  },
  {
   "op": "as",
   "who": "Other"
  },
  {
   "op": "setMany",
   "writes": [
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/handoffcodeAAAAAAAA3",
     "data": {
      "usedBy": "$Other"
     }
    },
    {
     "path": "ws/wsGuestAAAAAAAAAAAAA/members/other_id",
     "data": {
      "role": "owner",
      "invite": "handoffcodeAAAAAAAA3",
      "at": 1800000000
     }
    }
   ],
   "shouldFail": true
  },
  {
   "op": "as",
   "who": "Guest"
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/handoffs/codeAfterRemovalAAA",
   "data": {
    "by": "$Guest",
    "createdAt": 1800000000,
    "usedBy": ""
   },
   "shouldFail": true
  },
  {
   "op": "set",
   "path": "ws/wsGuestAAAAAAAAAAAAA/entries/e2",
   "data": {
    "description": "Work",
    "project": "",
    "tags": "[]",
    "billable": true,
    "start": 1799996400,
    "end": 1800000000,
    "at": 1800000000
   },
   "shouldFail": true
  }
 ]
}

Change history

Point OpenApps links to openapps.free
4857f8a940 · 19 hours ago
Bind agent address constants in policy
62b1e6acb2 · 20 hours ago
Use functions.openapps.xyz alias and add OpenApp contribution strip
61d972193a · 20 hours ago
Bounded source sync
fc644b4327 · 1 day ago
Bounded source sync
22f511f3db · 1 day ago
Bounded source sync
351a8d754c · 1 day ago
Bounded source sync
0da238a77e · 1 day ago