|
| 1 | +{ |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "$id": "https://loop-protocol.org/schemas/v0.1.1/handshake.schema.json", |
| 4 | + "title": "NodeHandshake", |
| 5 | + "description": "Lab-only federation handshake payload for LOOP Protocol v0.1.1", |
| 6 | + "oneOf": [ |
| 7 | + { "$ref": "#/definitions/HandshakeRequest" }, |
| 8 | + { "$ref": "#/definitions/HandshakeResponse" } |
| 9 | + ], |
| 10 | + "definitions": { |
| 11 | + "HandshakeRequest": { |
| 12 | + "type": "object", |
| 13 | + "required": [ |
| 14 | + "@context", |
| 15 | + "@type", |
| 16 | + "schema_version", |
| 17 | + "node_id", |
| 18 | + "name", |
| 19 | + "endpoint", |
| 20 | + "capabilities", |
| 21 | + "timestamp" |
| 22 | + ], |
| 23 | + "properties": { |
| 24 | + "@context": { |
| 25 | + "type": "string", |
| 26 | + "const": "https://loop-protocol.org/v0.1.1" |
| 27 | + }, |
| 28 | + "@type": { |
| 29 | + "type": "string", |
| 30 | + "const": "NodeHandshake" |
| 31 | + }, |
| 32 | + "schema_version": { |
| 33 | + "type": "string", |
| 34 | + "const": "0.1.1" |
| 35 | + }, |
| 36 | + "node_id": { |
| 37 | + "type": "string", |
| 38 | + "pattern": "^[a-z0-9\\-]+\\.loop$", |
| 39 | + "examples": ["munich.loop"] |
| 40 | + }, |
| 41 | + "name": { |
| 42 | + "type": "string", |
| 43 | + "minLength": 2, |
| 44 | + "maxLength": 120, |
| 45 | + "examples": ["DEMO Munich Node"] |
| 46 | + }, |
| 47 | + "endpoint": { |
| 48 | + "type": "string", |
| 49 | + "format": "uri", |
| 50 | + "pattern": "^https?://", |
| 51 | + "examples": ["https://demo-munich.loop/api"] |
| 52 | + }, |
| 53 | + "capabilities": { |
| 54 | + "type": "array", |
| 55 | + "minItems": 1, |
| 56 | + "items": { |
| 57 | + "type": "string" |
| 58 | + }, |
| 59 | + "examples": [["material-registry", "lab-relay"]] |
| 60 | + }, |
| 61 | + "public_key": { |
| 62 | + "type": "string", |
| 63 | + "description": "Optional public key for lab validation", |
| 64 | + "examples": ["-----BEGIN PUBLIC KEY-----...-----END PUBLIC KEY-----"] |
| 65 | + }, |
| 66 | + "timestamp": { |
| 67 | + "type": "string", |
| 68 | + "format": "date-time" |
| 69 | + }, |
| 70 | + "signature": { |
| 71 | + "type": "string", |
| 72 | + "description": "Optional lab-only signature placeholder" |
| 73 | + } |
| 74 | + }, |
| 75 | + "additionalProperties": false |
| 76 | + }, |
| 77 | + "HandshakeResponse": { |
| 78 | + "type": "object", |
| 79 | + "required": [ |
| 80 | + "@context", |
| 81 | + "@type", |
| 82 | + "schema_version", |
| 83 | + "status", |
| 84 | + "peer_id", |
| 85 | + "capabilities", |
| 86 | + "received_at", |
| 87 | + "lab_only" |
| 88 | + ], |
| 89 | + "properties": { |
| 90 | + "@context": { |
| 91 | + "type": "string", |
| 92 | + "const": "https://loop-protocol.org/v0.1.1" |
| 93 | + }, |
| 94 | + "@type": { |
| 95 | + "type": "string", |
| 96 | + "const": "NodeHandshakeResponse" |
| 97 | + }, |
| 98 | + "schema_version": { |
| 99 | + "type": "string", |
| 100 | + "const": "0.1.1" |
| 101 | + }, |
| 102 | + "status": { |
| 103 | + "type": "string", |
| 104 | + "enum": ["accepted", "rejected"] |
| 105 | + }, |
| 106 | + "peer_id": { |
| 107 | + "type": "string", |
| 108 | + "pattern": "^[a-z0-9\\-]+\\.loop$", |
| 109 | + "examples": ["lab-hub.loop"] |
| 110 | + }, |
| 111 | + "capabilities": { |
| 112 | + "type": "array", |
| 113 | + "minItems": 1, |
| 114 | + "items": { |
| 115 | + "type": "string" |
| 116 | + } |
| 117 | + }, |
| 118 | + "received_at": { |
| 119 | + "type": "string", |
| 120 | + "format": "date-time" |
| 121 | + }, |
| 122 | + "lab_only": { |
| 123 | + "type": "boolean", |
| 124 | + "const": true |
| 125 | + }, |
| 126 | + "message": { |
| 127 | + "type": "string", |
| 128 | + "maxLength": 280 |
| 129 | + } |
| 130 | + }, |
| 131 | + "additionalProperties": false |
| 132 | + } |
| 133 | + } |
| 134 | +} |
0 commit comments