DNSOP/Paul:

        I am working on an application that will have DNS filters or 
translators in the config file. My current design uses Paul Hoffman's RFC 8427 
JSON DNS format to allow the filters to make packet alterations. As an example, 
think about an older printer service with SRV/TXT records that do not support 
AirPrint. However, with a few tweaks, the TXT record could be changed to make 
it compatible with AirPrint devices. Therefore, I want to validate the output 
of the filter before accepting it since anyone could add these types of filters 
to the config file.

There is work in the IETF for JSON schemas 
(https://tools.ietf.org/html/draft-handrews-json-schema-validation-01) and 
(http://json-schema.org) and I have started creating a schema for the RFC 8427 
JSON DNS definitions.

It will be something similar to what is below (but more complete). Before I go 
to all the trouble of getting this exactly right, I wanted to make sure no one 
else had already done this. I will publish it when I finish for others to use.

If anyone has already generated a JSON schema for RFC 8427, please contact me.

If you are interested in this and want to help, please contact me.

Thanks,
Tom



  1 {
  2   "definitions": {},
  3   "$schema": "http://json-schema.org/draft-07/schema#";,
  4   "$id": "http://dnsdisco.com/rfc8427.json";,
  5   "type": "object",
  6   "title": “RFC 8427 Schema",
 11   "properties": {
 12     "queryMessage": {
 13       "$id": "#/properties/queryMessage",
 14       "type": "object",
 15       "title": "The Querymessage Schema",
 16       "required": [
 17         "ID",
 18         "QR",
 19         "Opcode",
 20         "AA",
 21         "TC",
 22         "RD",
 23         "RA",
 24         "AD",
 25         "CD",
 26         "RCODE",
 27         "QDCOUNT",
 28         "ANCOUNT",
 29         "NSCOUNT",
 30         "ARCOUNT",
 31         "QNAME",
 32         "QTYPE",
 33         "QCLASS"
 34       ],
 35       "properties": {
 36         "ID": {
 37           "$id": "#/properties/queryMessage/properties/ID",
 38           "type": "integer",
 39           "title": "The Id Schema",
 40           "default": 0,
 41           "examples": [
 42             32784
 43           ]
 44         },
 45         "QR": {
 46           "$id": "#/properties/queryMessage/properties/QR",
 47           "type": "integer",
 48           "title": "The Qr Schema",
 49           "default": 0,
 50           "examples": [
 51             0
 52           ]
 53         },
 54         "Opcode": {
 55           "$id": "#/properties/queryMessage/properties/Opcode",
 56           "type": "integer",
 57           "title": "The Opcode Schema",
 58           "default": 0,
 59           "examples": [
 60             0
 61           ]
 62         },
 63         "AA": {
 64           "$id": "#/properties/queryMessage/properties/AA",
 65           "type": "integer",
 66           "title": "The Aa Schema",
 67           "default": 0,
 68           "examples": [
 69             0
 70           ]
 71         },
 72         "TC": {
 73           "$id": "#/properties/queryMessage/properties/TC",
 74           "type": "integer",
 75           "title": "The Tc Schema",
 76           "default": 0,
 77           "examples": [
 78             0
 79           ]
 80         },
 81         "RD": {
 82           "$id": "#/properties/queryMessage/properties/RD",
 83           "type": "integer",
 84           "title": "The Rd Schema",
 85           "default": 0,
 86           "examples": [
 87             0
 88           ]
 89         },
 90         "RA": {
 91           "$id": "#/properties/queryMessage/properties/RA",
 92           "type": "integer",
 93           "title": "The Ra Schema",
 94           "default": 0,
 95           "examples": [
 96             0
 97           ]
 98         },
 99         "AD": {
100           "$id": "#/properties/queryMessage/properties/AD",
101           "type": "integer",
102           "title": "The Ad Schema",
103           "default": 0,
104           "examples": [
105             0
106           ]
107         },
108         "CD": {
109           "$id": "#/properties/queryMessage/properties/CD",
110           "type": "integer",
111           "title": "The Cd Schema",
112           "default": 0,
113           "examples": [
114             0
115           ]
116         },
117         "RCODE": {
118           "$id": "#/properties/queryMessage/properties/RCODE",
119           "type": "integer",
120           "title": "The Rcode Schema",
121           "default": 0,
122           "examples": [
123             0
124           ]
125         },
126         "QDCOUNT": {
127           "$id": "#/properties/queryMessage/properties/QDCOUNT",
128           "type": "integer",
129           "title": "The Qdcount Schema",
130           "default": 0,
131           "examples": [
132             1
133           ]
134         },
135         "ANCOUNT": {
136           "$id": "#/properties/queryMessage/properties/ANCOUNT",
137           "type": "integer",
138           "title": "The Ancount Schema",
139           "default": 0,
140           "examples": [
141             0
142           ]
143         },
144         "NSCOUNT": {
145           "$id": "#/properties/queryMessage/properties/NSCOUNT",
146           "type": "integer",
147           "title": "The Nscount Schema",
148           "default": 0,
149           "examples": [
150             0
151           ]
152         },
153         "ARCOUNT": {
154           "$id": "#/properties/queryMessage/properties/ARCOUNT",
155           "type": "integer",
156           "title": "The Arcount Schema",
157           "default": 0,
158           "examples": [
159             0
160           ]
161         },
162         "QNAME": {
163           "$id": "#/properties/queryMessage/properties/QNAME",
164           "type": "string",
165           "title": "The Qname Schema",
166           "default": "",
167           "examples": [
168             "example.com."
169           ],
170           "pattern": "^(.*)$"
171         },
172         "QTYPE": {
173           "$id": "#/properties/queryMessage/properties/QTYPE",
174           "type": "integer",
175           "title": "The Qtype Schema",
176           "default": 0,
177           "examples": [
178             1
179           ]
180         },
181         "QCLASS": {
182           "$id": "#/properties/queryMessage/properties/QCLASS",
183           "type": "integer",
184           "title": "The Qclass Schema",
185           "default": 0,
186           "examples": [
187             1
188           ]
189         }
190       }
191     },
192     "responseMessage": {
193       "$id": "#/properties/responseMessage",
194       "type": "object",
195       "title": "The Responsemessage Schema",
196       "required": [
197         "ID",
198         "QR",
199         "AA",
200         "RCODE",
201         "QDCOUNT",
202         "ANCOUNT",
203         "NSCOUNT",
204         "ARCOUNT",
207       ],
208       "properties": {
209         "ID": {
210           "$id": "#/properties/responseMessage/properties/ID",
211           "type": "integer",
212           "title": "The Id Schema",
213           "default": 0,
214           "examples": [
215             32784
216           ]
217         },
218         "QR": {
219           "$id": "#/properties/responseMessage/properties/QR",
220           "type": "integer",
221           "title": "The Qr Schema",
222           "default": 0,
223           "examples": [
224             1
225           ]
226         },
227         "AA": {
228           "$id": "#/properties/responseMessage/properties/AA",
229           "type": "integer",
230           "title": "The Aa Schema",
231           "default": 0,
232           "examples": [
233             1
234           ]
235         },
236         "RCODE": {
237           "$id": "#/properties/responseMessage/properties/RCODE",
238           "type": "integer",
239           "title": "The Rcode Schema",
240           "default": 0,
241           "examples": [
242             0
243           ]
244         },
245         "QDCOUNT": {
246           "$id": "#/properties/responseMessage/properties/QDCOUNT",
247           "type": "integer",
248           "title": "The Qdcount Schema",
249           "default": 0,
250           "examples": [
251             1
252           ]
253         },
254         "ANCOUNT": {
255           "$id": "#/properties/responseMessage/properties/ANCOUNT",
256           "type": "integer",
257           "title": "The Ancount Schema",
258           "default": 0,
259           "examples": [
260             1
261           ]
262         },
263         "NSCOUNT": {
264           "$id": "#/properties/responseMessage/properties/NSCOUNT",
265           "type": "integer",
266           "title": "The Nscount Schema",
267           "default": 0,
268           "examples": [
269             1
270           ]
271         },
272         "ARCOUNT": {
273           "$id": "#/properties/responseMessage/properties/ARCOUNT",
274           "type": "integer",
275           "title": "The Arcount Schema",
276           "default": 0,
277           "examples": [
278             0
279           ]
280         },
281         "answerRRs": {
282           "$id": "#/properties/responseMessage/properties/answerRRs",
283           "type": "array",
284           "title": "The Answerrrs Schema",
285           "items": {
286             "$id": 
"#/properties/responseMessage/properties/answerRRs/items",
287             "type": "object",
288             "title": "The Items Schema",
289             "required": [
290               "NAME",
291               "TYPE",
292               "CLASS",
293               "TTL",
294               "RDATAHEX"
295             ],
296             "properties": {
297               "NAME": {
298                 "$id": 
"#/properties/responseMessage/properties/answerRRs/items/properties/NAME",
299                 "type": "string",
300                 "title": "The Name Schema",
301                 "default": "",
302                 "examples": [
303                   "example.com."
304                 ],
305                 "pattern": "^(.*)$"
306               },
307               "TYPE": {
308                 "$id": 
"#/properties/responseMessage/properties/answerRRs/items/properties/TYPE",
309                 "type": "integer",
310                 "title": "The Type Schema",
311                 "default": 0,
312                 "examples": [
313                   1
314                 ]
315               },
316               "CLASS": {
317                 "$id": 
"#/properties/responseMessage/properties/answerRRs/items/properties/CLASS",
318                 "type": "integer",
319                 "title": "The Class Schema",
320                 "default": 0,
321                 "examples": [
322                   1
323                 ]
324               },
325               "TTL": {
326                 "$id": 
"#/properties/responseMessage/properties/answerRRs/items/properties/TTL",
327                 "type": "integer",
328                 "title": "The Ttl Schema",
329                 "default": 0,
330                 "examples": [
331                   3600
332                 ]
333               },
334               "RDATAHEX": {
335                 "$id": 
"#/properties/responseMessage/properties/answerRRs/items/properties/RDATAHEX",
336                 "type": "string",
337                 "title": "The Rdatahex Schema",
338                 "default": "",
339                 "examples": [
340                   "C0000201"
341                 ],
342                 "pattern": "^(.*)$"
343               }
344             }
345           }
346         },
347         "authorityRRs": {
348           "$id": "#/properties/responseMessage/properties/authorityRRs",
349           "type": "array",
350           "title": "The Authorityrrs Schema",
351           "items": {
352             "$id": 
"#/properties/responseMessage/properties/authorityRRs/items",
353             "type": "object",
354             "title": "The Items Schema",
355             "required": [
356               "NAME",
357               "TYPE",
358               "CLASS",
359               "TTL",
360               "RDATAHEX"
361             ],
362             "properties": {
363               "NAME": {
364                 "$id": 
"#/properties/responseMessage/properties/authorityRRs/items/properties/NAME",
365                 "type": "string",
366                 "title": "The Name Schema",
367                 "default": "",
368                 "examples": [
369                   "ns.example.com."
370                 ],
371                 "pattern": "^(.*)$"
372               },
373               "TYPE": {
374                 "$id": 
"#/properties/responseMessage/properties/authorityRRs/items/properties/TYPE",
375                 "type": "integer",
376                 "title": "The Type Schema",
377                 "default": 0,
378                 "examples": [
379                   1
380                 ]
381               },
382               "CLASS": {
383                 "$id": 
"#/properties/responseMessage/properties/authorityRRs/items/properties/CLASS",
384                 "type": "integer",
385                 "title": "The Class Schema",
386                 "default": 0,
387                 "examples": [
388                   1
389                 ]
390               },
391               "TTL": {
392                 "$id": 
"#/properties/responseMessage/properties/authorityRRs/items/properties/TTL",
393                 "type": "integer",
394                 "title": "The Ttl Schema",
395                 "default": 0,
396                 "examples": [
397                   28800
398                 ]
399               },
400               "RDATAHEX": {
401                 "$id": 
"#/properties/responseMessage/properties/authorityRRs/items/properties/RDATAHEX",
402                 "type": "string",
403                 "title": "The Rdatahex Schema",
404                 "default": "",
405                 "examples": [
406                   "CB007181"
407                 ],
408                 "pattern": "^(.*)$"
409               }
410             }
411           }
412         }
413       }
414     }
415   }
416 }
_______________________________________________
DNSOP mailing list
DNSOP@ietf.org
https://www.ietf.org/mailman/listinfo/dnsop

Reply via email to