webhook declaration lexicon
hook.json
1{
2 "$schema": "https://internect.info/lexicon-schema.json",
3 "lexicon": 1,
4 "id": "ac.hexmani.firehook.hook",
5 "description": "A declaration of a webhook",
6 "defs": {
7 "main": {
8 "type": "record",
9 "key": "any",
10 "record": {
11 "type": "object",
12 "required": ["identifier", "scope"],
13 "properties": {
14 "name": {
15 "type": "string",
16 "description": "String that identifies the webhook's purpose"
17 },
18 "scope": {
19 "type": "union",
20 "description": "Arbitrary permissions for valid webhook events",
21 "refs": ["#publicScope", "#didScope", "#signatureScope"]
22 },
23 "parcel": {
24 "type": "unknown",
25 "description": "Section for defining additional data"
26 }
27 }
28 }
29 },
30 "publicScope": {
31 "type": "object",
32 "required": ["scope"],
33 "description": "Scope that allows anyone to create verified events",
34 "properties": {
35 "scope": {
36 "type": "string",
37 "const": "publicScope"
38 }
39 }
40 },
41 "didScope": {
42 "type": "object",
43 "required": ["scope", "dids"],
44 "description": "Scope that declares a list of DIDs that can create verified events",
45 "properties": {
46 "scope": {
47 "type": "string",
48 "const": "didScope"
49 },
50 "dids": {
51 "type": "array",
52 "items": {
53 "type": "string",
54 "format": "did",
55 "description": "DIDs of the entities that can trigger the webhook"
56 }
57 }
58 }
59 },
60 "signatureScope": {
61 "type": "object",
62 "required": ["scope", "key"],
63 "description": "Scope that declares a public key that must be used to verify events",
64 "properties": {
65 "scope": {
66 "type": "string",
67 "const": "signatureScope"
68 },
69 "key": {
70 "type": "string",
71 "description": "Multibase-encoded p256 public key"
72 }
73 }
74 }
75 }
76}