On 18. Jul 2023, at 17:38, Michael Richardson <[email protected]> wrote:
> 
> 
> In the JWS I-D, we have some JSON that is an example.
> And the content within is BASE64URL encoded.
> We could, I think, describe this in CDDL, but we aren't trying to be
> authoritative. (It's a JOSE example)

OK, CDDL describes possible sentences in the language, while you seem to be 
trying to express a single example, with input parameters and some processing.

CBOR diagnostic notation is getting some features for application-specific 
literals, but so far we didn’t really make it compute (or take parameters).
We could try to import CDDL operators for the compute.
(And describe how to use CBOR diagnostic notation to compute JSON, but that is 
trivial given Section 6.1 of RFC 8949.)

> We are struggling with quoting.  We could write:
> 
> "payload": "BASE64URL(ietf-voucher:voucher)",

Well, what is the point of the example?
If it is only for illustration, this would work with some text added about what 
this means.
If it is intended to specify the outcome, we would need some of the above.

> which would make it valid JSON, with the literal contents.

Yes, so you could validate it as JSON, but then the literal contents really are 
a misrepresentation.
(If validation is about catching missing commas, this is still useful.)

> Or we could write:
> 
> "payload": BASE64URL(ietf-voucher:voucher),

Which one could no longer parse, and there would be no meaning right now except 
as pseudocode.

> which sorta makes it valid Javascript, assuming such a function existed.

I don’t know what ietf is, from which voucher:voucher is subtracted; can’t even 
parse the : without a ? around.

> here is an example with both variations:
> 
>    {
>      "payload": BASE64URL(ietf-voucher:voucher),
>      "signatures": [
>        {
>          "protected": "BASE64URL(UTF8(JWS Protected Header))",
>          "signature": "base64encodedvalue=="
>        }
>      ]
>    }

What is UTF8()?  Do you mean the equivalent of JSON.stringify?

I summary, these “recipes” are interesting, and we have some 90 % of what we 
need.
Maybe we can have a short brainstorming session at IETF 117 Hackathon.

Grüße, Carsten

_______________________________________________
Anima mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/anima

Reply via email to