[tahoe-lafs-trac-stream] [Tahoe-LAFS] #3802: Schema enforcement for HTTP protocol contents
Tahoe-LAFS
trac at tahoe-lafs.org
Wed Oct 6 18:05:20 UTC 2021
#3802: Schema enforcement for HTTP protocol contents
--------------------------+-----------------------------------
Reporter: itamarst | Owner:
Type: task | Status: new
Priority: normal | Milestone: HTTP Storage Protocol
Component: unknown | Version: n/a
Resolution: | Keywords:
Launchpad Bug: |
--------------------------+-----------------------------------
Comment (by itamarst):
Schema enforcement features we'd need for current HTTP spec:
1. Dict value types ("this key's value must be bytes").
2. Dict keys ("this dict must only have these keys").
3. List lengths? Probably optional, could replace with dicts anywhere that
comes up.
4. Integers must be positive, or not-negative.
5. List types ("this must be a list of integers", or "this must be a list
of dicts with this structure").
6. Bytes vs. Unicode strings.
7. String length (for either kind of string).
8. Support both CBOR and JSON? Tricky for bytes.
Looking at CDDL:
1. Yes.
2. Yes.
3. Yes.
4. Yes.
5. Yes.
6. Yes.
7. There's a size control (how many bytes is it) which is fine for bytes,
but a bit strange for Unicode strings in the general non-ASCII case.
8. The way CDDL works for JSON is by just saying "no bytes supported."
Which is... a problem I guess.
So CDDL seems plausible, but might require maintaining two versions of the
schema to deal with bytes-on-JSON.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3802#comment:5>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list