Skip to content

Commit af2c1f1

Browse files
ShahanaFarooquirustyrussell
authored andcommitted
doc: schemas for commando-listrunes & commando-blacklist
1 parent ecb1737 commit af2c1f1

File tree

4 files changed

+169
-0
lines changed

4 files changed

+169
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"additionalProperties": false,
5+
"required": [],
6+
"added": "v23.05",
7+
"properties": {
8+
"start": {
9+
"type": "u64",
10+
"description": "first rune unique id to blacklist"
11+
},
12+
"end": {
13+
"type": "u64",
14+
"description": "final rune unique id to blacklist (defaults to start)"
15+
}
16+
}
17+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"additionalProperties": false,
5+
"required": [
6+
"blacklist"
7+
],
8+
"properties": {
9+
"blacklist": {
10+
"type": "array",
11+
"description": "the resulting blacklist ranges after the command",
12+
"items": {
13+
"type": "object",
14+
"additionalProperties": false,
15+
"required": [
16+
"start",
17+
"end"
18+
],
19+
"properties": {
20+
"start": {
21+
"type": "u64",
22+
"description": "Unique id of first rune in this blacklist range"
23+
},
24+
"end": {
25+
"type": "u64",
26+
"description": "Unique id of last rune in this blacklist range"
27+
}
28+
}
29+
}
30+
}
31+
}
32+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"additionalProperties": false,
5+
"required": [],
6+
"added": "v23.05",
7+
"properties": {
8+
"rune": {
9+
"type": "string",
10+
"description": "optional rune to list"
11+
}
12+
}
13+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"additionalProperties": false,
5+
"required": [
6+
"runes"
7+
],
8+
"properties": {
9+
"runes": {
10+
"type": "array",
11+
"items": {
12+
"type": "object",
13+
"additionalProperties": false,
14+
"required": [
15+
"rune",
16+
"unique_id",
17+
"restrictions",
18+
"restrictions_as_english"
19+
],
20+
"properties": {
21+
"rune": {
22+
"type": "string",
23+
"description": "Base64 encoded rune"
24+
},
25+
"unique_id": {
26+
"type": "string",
27+
"description": "Unique id assigned when the rune was generated; this is always a u64 for commando runes"
28+
},
29+
"restrictions": {
30+
"type": "array",
31+
"description": "The restrictions on what commands this rune can authorize",
32+
"items": {
33+
"type": "object",
34+
"additionalProperties": false,
35+
"required": [
36+
"alternatives",
37+
"english"
38+
],
39+
"properties": {
40+
"alternatives": {
41+
"type": "array",
42+
"items": {
43+
"type": "object",
44+
"additionalProperties": false,
45+
"required": [
46+
"fieldname",
47+
"value",
48+
"condition",
49+
"english"
50+
],
51+
"properties": {
52+
"fieldname": {
53+
"type": "string",
54+
"description": "The field this restriction applies to; see commando-rune(7)"
55+
},
56+
"value": {
57+
"type": "string",
58+
"description": "The value accepted for this field"
59+
},
60+
"condition": {
61+
"type": "string",
62+
"description": "The way to compare fieldname and value"
63+
},
64+
"english": {
65+
"type": "string",
66+
"description": "English readable description of this alternative"
67+
}
68+
}
69+
},
70+
"english": {
71+
"type": "string",
72+
"description": "English readable summary of alternatives above"
73+
}
74+
}
75+
}
76+
}
77+
},
78+
"restrictions_as_english": {
79+
"type": "string",
80+
"description": "English readable description of the restrictions array above"
81+
},
82+
"stored": {
83+
"type": "boolean",
84+
"enum": [
85+
false
86+
],
87+
"description": "This is false if the rune does not appear in our datastore (only possible when `rune` is specified)"
88+
},
89+
"blacklisted": {
90+
"type": "boolean",
91+
"enum": [
92+
true
93+
],
94+
"description": "The rune has been blacklisted; see commando-blacklist(7)"
95+
},
96+
"our_rune": {
97+
"type": "boolean",
98+
"enum": [
99+
false
100+
],
101+
"description": "This is not a rune for this node (only possible when `rune` is specified)"
102+
}
103+
}
104+
}
105+
}
106+
}
107+
}

0 commit comments

Comments
 (0)