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.
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.
policy-tests/sharing.json
{
"version": "1",
"name": "a project shared by link: teammates log their own time to it, only owners change it or read the time, and removal or closing freezes what was logged",
"actors": {
"Owner": "owner_id",
"Mate": "mate_id",
"Stranger": "stranger_id",
"Late": "late_id"
},
"constants": {
"BOUNDED_PUBLIC_PRINCIPAL_API": "api_principal"
},
"steps": [
{
"op": "setTime",
"epoch": 1800000000
},
{
"op": "as",
"who": "Owner"
},
{
"op": "setMany",
"writes": [
{
"path": "ws/wsOwnerAAAAAAAAAAAAA",
"data": {
"name": "Olive",
"currency": "USD",
"rate": 0,
"weekStart": 1,
"tz": "UTC",
"createdBy": "$Owner",
"createdAt": 1800000000
}
},
{
"path": "ws/wsOwnerAAAAAAAAAAAAA/members/owner_id",
"data": {
"role": "owner",
"invite": "created",
"at": 1800000000
}
},
{
"path": "users/owner_id",
"data": {
"ws": "wsOwnerAAAAAAAAAAAAA",
"at": 1800000000
}
}
]
},
{
"op": "set",
"path": "ws/wsOwnerAAAAAAAAAAAAA/projects/p1",
"data": {
"name": "Acme",
"color": "#2e5ec4",
"client": "",
"rate": 9500,
"billable": true,
"archived": false,
"share": "",
"team": false,
"owner": "",
"at": 1800000000
}
},
{
"op": "as",
"who": "Mate"
},
{
"op": "setMany",
"writes": [
{
"path": "ws/wsMateAAAAAAAAAAAAAA",
"data": {
"name": "Max",
"currency": "USD",
"rate": 0,
"weekStart": 1,
"tz": "UTC",
"createdBy": "$Mate",
"createdAt": 1800000000
}
},
{
"path": "ws/wsMateAAAAAAAAAAAAAA/members/mate_id",
"data": {
"role": "owner",
"invite": "created",
"at": 1800000000
}
},
{
"path": "users/mate_id",
"data": {
"ws": "wsMateAAAAAAAAAAAAAA",
"at": 1800000000
}
}
]
},
{
"op": "as",
"who": "Stranger"
},
{
"op": "setMany",
"writes": [
{
"path": "ws/wsStrangerAAAAAAAAAA",
"data": {
"name": "Sid",
"currency": "USD",
"rate": 0,
"weekStart": 1,
"tz": "UTC",
"createdBy": "$Stranger",
"createdAt": 1800000000
}
},
{
"path": "ws/wsStrangerAAAAAAAAAA/members/stranger_id",
"data": {
"role": "owner",
"invite": "created",
"at": 1800000000
}
},
{
"path": "users/stranger_id",
"data": {
"ws": "wsStrangerAAAAAAAAAA",
"at": 1800000000
}
}
]
},
{
"op": "setMany",
"writes": [
{
"path": "shared/sharedProjectAAAAAA1",
"data": {
"name": "Acme website",
"color": "#2e5ec4",
"client": "Acme Inc.",
"owner": "Olive",
"ws": "wsOwnerAAAAAAAAAAAAA",
"closed": false,
"createdBy": "$Stranger",
"createdAt": 1800000000,
"billable": true
}
},
{
"path": "shared/sharedProjectAAAAAA1/owners/stranger_id",
"data": {
"ws": "wsOwnerAAAAAAAAAAAAA",
"at": 1800000000
}
}
],
"shouldFail": true
},
{
"op": "as",
"who": "Owner"
},
{
"op": "setMany",
"writes": [
{
"path": "shared/sharedProjectAAAAAA1",
"data": {
"name": "Acme website",
"color": "#2e5ec4",
"client": "Acme Inc.",
"owner": "Olive",
"ws": "wsOwnerAAAAAAAAAAAAA",
"closed": false,
"createdBy": "$Owner",
"createdAt": 1800000000,
"billable": true
}
},
{
"path": "shared/sharedProjectAAAAAA1/owners/owner_id",
"data": {
"ws": "wsOwnerAAAAAAAAAAAAA",
"at": 1800000000
}
},
{
"path": "ws/wsOwnerAAAAAAAAAAAAA/projects/p1",
"data": {
"name": "Acme",
"color": "#2e5ec4",
"client": "",
"rate": 9500,
"billable": true,
"archived": false,
"share": "sharedProjectAAAAAA1",
"team": false,
"owner": "",
"at": 1800000000
}
}
]
},
{
"op": "as",
"who": "Stranger"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/owners/stranger_id",
"data": {
"ws": "wsStrangerAAAAAAAAAA",
"at": 1800000000
},
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/owners/stranger_id",
"data": {
"ws": "wsOwnerAAAAAAAAAAAAA",
"at": 1800000000
},
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1",
"data": {
"name": "Taken over",
"color": "#2e5ec4",
"client": "Acme Inc.",
"owner": "Olive",
"ws": "wsOwnerAAAAAAAAAAAAA",
"closed": false,
"createdBy": "$Owner",
"createdAt": 1800000000,
"billable": true
},
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/joins/stranger_id",
"data": {
"name": "Sid",
"ws": "wsOwnerAAAAAAAAAAAAA",
"at": 1800000000
},
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/joins/mate_id",
"data": {
"name": "Sid",
"ws": "wsStrangerAAAAAAAAAA",
"at": 1800000000
},
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/x1",
"data": {
"ws": "wsStrangerAAAAAAAAAA",
"who": "Max",
"description": "Design",
"tags": "[\"design\"]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
},
"shouldFail": true
},
{
"op": "as",
"who": "Mate"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/joins/mate_id",
"data": {
"name": "Max",
"ws": "wsMateAAAAAAAAAAAAAA",
"at": 1800000000
}
},
{
"op": "setMany",
"writes": [
{
"path": "ws/wsMateAAAAAAAAAAAAAA/projects/sharedProjectAAAAAA1",
"data": {
"name": "Acme",
"color": "#2e5ec4",
"client": "",
"rate": 0,
"billable": true,
"archived": false,
"share": "sharedProjectAAAAAA1",
"team": true,
"owner": "Olive",
"at": 1800000000
}
},
{
"path": "ws/wsMateAAAAAAAAAAAAAA/entries/e1",
"data": {
"description": "Work",
"project": "sharedProjectAAAAAA1",
"tags": "[]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
}
},
{
"path": "shared/sharedProjectAAAAAA1/entries/e1",
"data": {
"ws": "wsMateAAAAAAAAAAAAAA",
"who": "Max",
"description": "Design",
"tags": "[\"design\"]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
}
}
]
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/e2",
"data": {
"ws": "wsOwnerAAAAAAAAAAAAA",
"who": "Max",
"description": "Design",
"tags": "[\"design\"]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
},
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/e3",
"data": {
"ws": "wsMateAAAAAAAAAAAAAA",
"who": "Max",
"description": "Design",
"tags": "[\"design\"]",
"billable": true,
"start": 1800000000,
"end": 1799999999,
"at": 1800000000
},
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1",
"data": {
"name": "Mine",
"color": "#2e5ec4",
"client": "Acme Inc.",
"owner": "Olive",
"ws": "wsOwnerAAAAAAAAAAAAA",
"closed": false,
"createdBy": "$Owner",
"createdAt": 1800000000,
"billable": true
},
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/e4",
"data": {
"ws": "wsMateAAAAAAAAAAAAAA",
"who": "Max",
"description": "Design",
"tags": "[\"design\"]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
}
},
{
"op": "as",
"who": "Stranger"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/joins/stranger_id",
"data": {
"name": "Sid",
"ws": "wsStrangerAAAAAAAAAA",
"at": 1800000000
}
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/e1",
"data": {
"ws": "wsStrangerAAAAAAAAAA",
"who": "Max",
"description": "Design",
"tags": "[\"design\"]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
},
"shouldFail": true
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/entries/e1",
"shouldFail": true
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/joins/mate_id",
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/s1",
"data": {
"ws": "wsStrangerAAAAAAAAAA",
"who": "Sid",
"description": "Design",
"tags": "[\"design\"]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
}
},
{
"op": "as",
"who": "Owner"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1",
"data": {
"name": "Acme website v2",
"color": "#2e5ec4",
"client": "Acme Inc.",
"owner": "Olive",
"ws": "wsOwnerAAAAAAAAAAAAA",
"closed": false,
"createdBy": "$Owner",
"createdAt": 1800000000,
"billable": true
}
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/joins/mate_id"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/removed/wsMateAAAAAAAAAAAAAA",
"data": {
"name": "Max",
"at": 1800000000
}
},
{
"op": "as",
"who": "Mate"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/e5",
"data": {
"ws": "wsMateAAAAAAAAAAAAAA",
"who": "Max",
"description": "Design",
"tags": "[\"design\"]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
},
"shouldFail": true
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/entries/e4",
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/joins/mate_id",
"data": {
"name": "Max",
"ws": "wsMateAAAAAAAAAAAAAA",
"at": 1800000000
},
"shouldFail": true
},
{
"op": "setMany",
"writes": [
{
"path": "ws/wsMateTwoAAAAAAAAAAA",
"data": {
"name": "Max",
"currency": "USD",
"rate": 0,
"weekStart": 1,
"tz": "UTC",
"createdBy": "$Mate",
"createdAt": 1800000000
}
},
{
"path": "ws/wsMateTwoAAAAAAAAAAA/members/mate_id",
"data": {
"role": "owner",
"invite": "created",
"at": 1800000000
}
}
]
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/joins/mate_id",
"data": {
"name": "Max",
"ws": "wsMateTwoAAAAAAAAAAA",
"at": 1800000000
}
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/e1",
"data": {
"ws": "wsMateTwoAAAAAAAAAAA",
"who": "Max",
"description": "Taken over",
"tags": "[]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
},
"shouldFail": true
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/e1",
"data": {
"description": "Rewritten after removal"
},
"shouldFail": true
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/entries/e1",
"shouldFail": true
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/joins/mate_id"
},
{
"op": "as",
"who": "Stranger"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/removed/wsStrangerAAAAAAAAAA",
"data": {
"name": "Sid",
"at": 1800000000
},
"shouldFail": true
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/removed/wsMateAAAAAAAAAAAAAA",
"shouldFail": true
},
{
"op": "as",
"who": "Owner"
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/removed/wsMateAAAAAAAAAAAAAA"
},
{
"op": "as",
"who": "Mate"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/joins/mate_id",
"data": {
"name": "Max",
"ws": "wsMateAAAAAAAAAAAAAA",
"at": 1800000000
}
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/e6",
"data": {
"ws": "wsMateAAAAAAAAAAAAAA",
"who": "Max",
"description": "Back in",
"tags": "[]",
"billable": true,
"start": 1799999940,
"end": 1800000000,
"at": 1800000000
}
},
{
"op": "as",
"who": "Owner"
},
{
"op": "setMany",
"writes": [
{
"path": "shared/sharedProjectAAAAAA1/removed/wsMateAAAAAAAAAAAAAA",
"data": {
"name": "Max",
"at": 1800000000
}
}
]
},
{
"op": "as",
"who": "Mate"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/e7",
"data": {
"ws": "wsMateAAAAAAAAAAAAAA",
"who": "Max",
"description": "Joined but removed",
"tags": "[]",
"billable": true,
"start": 1799999940,
"end": 1800000000,
"at": 1800000000
},
"shouldFail": true
},
{
"op": "as",
"who": "Owner"
},
{
"op": "as",
"who": "Stranger"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/s3",
"data": {
"ws": "wsStrangerAAAAAAAAAA",
"who": "Sid",
"description": "Typo",
"tags": "[]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
}
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/s3",
"data": {
"description": "Fixed"
}
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/entries/s3"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/s4",
"data": {
"ws": "wsStrangerAAAAAAAAAA",
"who": "Sid",
"description": "Kept",
"tags": "[]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
}
},
{
"op": "as",
"who": "Owner"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1",
"data": {
"name": "Acme website",
"color": "#2e5ec4",
"client": "Acme Inc.",
"owner": "Olive",
"ws": "wsOwnerAAAAAAAAAAAAA",
"closed": true,
"createdBy": "$Owner",
"createdAt": 1800000000,
"billable": true
}
},
{
"op": "as",
"who": "Stranger"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/s4",
"data": {
"end": 1803596400
},
"shouldFail": true
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/entries/s4",
"shouldFail": true
},
{
"op": "as",
"who": "Owner"
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/entries/e4"
},
{
"op": "delete",
"path": "shared/sharedProjectAAAAAA1/entries/s1"
},
{
"op": "as",
"who": "Stranger"
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/entries/s2",
"data": {
"ws": "wsStrangerAAAAAAAAAA",
"who": "Sid",
"description": "Design",
"tags": "[\"design\"]",
"billable": true,
"start": 1799996400,
"end": 1800000000,
"at": 1800000000
},
"shouldFail": true
},
{
"op": "as",
"who": "Late"
},
{
"op": "setMany",
"writes": [
{
"path": "ws/wsLateAAAAAAAAAAAAAA",
"data": {
"name": "Lou",
"currency": "USD",
"rate": 0,
"weekStart": 1,
"tz": "UTC",
"createdBy": "$Late",
"createdAt": 1800000000
}
},
{
"path": "ws/wsLateAAAAAAAAAAAAAA/members/late_id",
"data": {
"role": "owner",
"invite": "created",
"at": 1800000000
}
},
{
"path": "users/late_id",
"data": {
"ws": "wsLateAAAAAAAAAAAAAA",
"at": 1800000000
}
}
]
},
{
"op": "set",
"path": "shared/sharedProjectAAAAAA1/joins/late_id",
"data": {
"name": "Lou",
"ws": "wsLateAAAAAAAAAAAAAA",
"at": 1800000000
},
"shouldFail": true
},
{
"op": "expect",
"expr": "get(/shared/sharedProjectAAAAAA1/entries/e1).ws == 'wsMateAAAAAAAAAAAAAA'"
}
]
}
Change history
Point OpenApps links to openapps.free
Bind agent address constants in policy
Use functions.openapps.xyz alias and add OpenApp contribution strip
Bounded source sync
Bounded source sync
Bounded source sync
Bounded source sync