Repository navigation
Expand file tree
/
Copy pathaccess-control-v1.schema.json
More file actions
161 lines (161 loc) · 7.15 KB
/
Copy pathaccess-control-v1.schema.json
File metadata and controls
161 lines (161 loc) · 7.15 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:frontier-systems:schema:access-control:v1",
"title": "Frontier Systems Access Control and Bypass State v1",
"description": "Versioned device access, controller, actuator, staged bypass, and bounded tamper summary records. A device must expose at least one security controller or physical actuator; it may expose either capability or both.",
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "device_id", "access_policy", "security_controllers", "actuators", "bypass_jobs", "tamper_events"],
"anyOf": [
{ "properties": { "security_controllers": { "minItems": 1 } } },
{ "properties": { "actuators": { "minItems": 1 } } }
],
"properties": {
"schema_version": { "const": 1 },
"device_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"access_policy": { "$ref": "#/$defs/accessPolicyRevision" },
"security_controllers": {
"type": "array",
"maxItems": 128,
"items": { "$ref": "#/$defs/securityControllerState" }
},
"actuators": {
"type": "array",
"maxItems": 128,
"items": { "$ref": "#/$defs/actuatorState" }
},
"bypass_jobs": {
"type": "array",
"maxItems": 256,
"items": { "$ref": "#/$defs/bypassJob" }
},
"tamper_events": {
"type": "array",
"maxItems": 256,
"items": { "$ref": "#/$defs/tamperEvent" }
}
},
"$defs": {
"accessPolicyRevision": {
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "policy_id", "revision", "default_decision", "grants"],
"properties": {
"schema_version": { "const": 1 },
"policy_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"revision": { "type": "integer", "minimum": 1 },
"default_decision": { "enum": ["allow", "deny"] },
"grants": {
"type": "array",
"maxItems": 256,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["subject_kind", "subject_id", "action_ids"],
"properties": {
"subject_kind": { "enum": ["principal", "role", "group"] },
"subject_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"action_ids": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"maxItems": 64,
"items": { "type": "string", "minLength": 1, "maxLength": 128 }
}
}
}
}
}
},
"securityControllerState": {
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "controller_id", "power_state", "integrity", "access_locked", "alarm_state", "bypassed_channels", "fault_ids"],
"properties": {
"schema_version": { "const": 1 },
"controller_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"power_state": { "enum": ["powered", "unpowered", "isolated", "faulted"] },
"integrity": { "type": "number", "minimum": 0, "maximum": 1 },
"access_locked": { "type": "boolean" },
"alarm_state": { "enum": ["quiet", "local", "remote", "disabled", "faulted"] },
"bypassed_channels": {
"type": "array",
"uniqueItems": true,
"maxItems": 32,
"items": { "enum": ["credential_reader", "controller_sequence", "motor_command"] }
},
"fault_ids": {
"type": "array",
"uniqueItems": true,
"maxItems": 128,
"items": { "type": "string", "minLength": 1, "maxLength": 128 }
}
}
},
"actuatorState": {
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "actuator_id", "mode", "position", "latch_state", "seal_condition", "integrity", "maximum_force_newtons", "effective_pressure_area_m2", "manual_override_available", "override_actor_id", "override_route", "override_expires_tick"],
"properties": {
"schema_version": { "const": 1 },
"actuator_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"mode": { "enum": ["powered", "manual", "disabled", "jammed"] },
"position": { "type": "number", "minimum": 0, "maximum": 1 },
"latch_state": { "enum": ["engaged", "released", "damaged"] },
"seal_condition": { "type": "number", "minimum": 0, "maximum": 1 },
"integrity": { "type": "number", "minimum": 0, "maximum": 1 },
"maximum_force_newtons": { "type": "number", "minimum": 0 },
"effective_pressure_area_m2": { "type": "number", "minimum": 0 },
"manual_override_available": { "type": "boolean" },
"override_actor_id": { "type": "string", "maxLength": 128 },
"override_route": { "enum": ["", "electrical", "mechanical", "combined"] },
"override_expires_tick": { "type": "integer", "minimum": -1 }
}
},
"bypassJob": {
"type": "object",
"additionalProperties": false,
"required": ["schema_version", "job_id", "request_id", "target_id", "route", "stage", "status", "actor_ids", "tool_ids", "progress", "total_work_ticks", "created_tick", "updated_tick", "result_code"],
"properties": {
"schema_version": { "const": 1 },
"job_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"request_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"target_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"route": { "enum": ["electrical", "mechanical", "combined"] },
"stage": { "enum": ["inspect", "access", "isolate", "stabilize", "perform", "verify", "restore"] },
"status": { "enum": ["queued", "active", "paused", "completed", "failed", "cancelled"] },
"actor_ids": {
"type": "array",
"uniqueItems": true,
"minItems": 1,
"maxItems": 16,
"items": { "type": "string", "minLength": 1, "maxLength": 128 }
},
"tool_ids": {
"type": "array",
"uniqueItems": true,
"maxItems": 32,
"items": { "type": "string", "minLength": 1, "maxLength": 128 }
},
"progress": { "type": "number", "minimum": 0, "maximum": 1 },
"total_work_ticks": { "type": "integer", "minimum": 1 },
"created_tick": { "type": "integer", "minimum": 0 },
"updated_tick": { "type": "integer", "minimum": 0 },
"result_code": { "type": "string", "maxLength": 128 }
}
},
"tamperEvent": {
"type": "object",
"additionalProperties": false,
"required": ["event_id", "actor_id", "target_id", "route", "result_code", "tick_number"],
"properties": {
"event_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"actor_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"target_id": { "type": "string", "minLength": 1, "maxLength": 128 },
"route": { "enum": ["electrical", "mechanical", "combined", "unknown"] },
"result_code": { "type": "string", "minLength": 1, "maxLength": 128 },
"tick_number": { "type": "integer", "minimum": 0 }
}
}
}
}