-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontract.json
More file actions
50 lines (50 loc) · 1.89 KB
/
Copy pathcontract.json
File metadata and controls
50 lines (50 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
"lang": "javascript",
"stateKeys": [
{ "name": "handshake", "type": "boolean — the handshake has completed" },
{ "name": "authenticated", "type": "boolean — the authenticating transition has fired (gate for privilege)" },
{ "name": "appData", "type": "boolean — application data has been accepted (must follow handshake)" },
{ "name": "privileged", "type": "boolean — a privileged effect has been performed (must follow auth)" },
{ "name": "peerClosed", "type": "boolean — the peer signalled a close (environment fact)" }
],
"initState": {
"handshake": false,
"authenticated": false,
"appData": false,
"privileged": false,
"peerClosed": false
},
"actions": {
"COMPLETE_HANDSHAKE": { "dataFields": {} },
"AUTHENTICATE": { "dataFields": {} },
"ACCEPT_APP_DATA": { "dataFields": {} },
"DO_PRIVILEGED": { "dataFields": {} },
"PEER_CLOSE": { "dataFields": {} },
"TEARDOWN": { "dataFields": {} }
},
"dataDomain": {
"COMPLETE_HANDSHAKE": {},
"AUTHENTICATE": {},
"ACCEPT_APP_DATA": {},
"DO_PRIVILEGED": {},
"PEER_CLOSE": {},
"TEARDOWN": {}
},
"terminalKey": "privileged",
"terminalStates": [],
"specialRules": [
{
"name": "auth-required",
"note": "DO_PRIVILEGED is rejected in every state where authenticated == false (the default-deny gate for privileged effects).",
"whenState": "authenticated == false",
"whenAction": "DO_PRIVILEGED"
},
{
"name": "handshake-required",
"note": "AUTHENTICATE and ACCEPT_APP_DATA are rejected before the handshake completes (ordering: handshake precedes both).",
"whenState": "handshake == false",
"whenAction": "AUTHENTICATE | ACCEPT_APP_DATA"
}
],
"noOpRule": "An action that does not apply in the current state is reject(reason) — an observable no-op with post == pre, never a throw and never a silent mutation."
}