-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mixed JSON and CBOR is annoying for clients #36
Comments
No objections from my side. Would EDN play a role in "make the whole thing COSE/CBOR"? |
It certainly could! How would you like to see the Problem Details object represented, for example, if we did this way? Note SCRAPI is not a CoAP API so I din't really want to use RFC 9290. I want to take advantage of the 'Other Formats' provision of Appendix C of RFC 9457 and return So the original JSON is: {
"type": "urn:ietf:params:scitt:error:badSignatureAlgorithm",
"detail": "Signing algorithm 'WalnutDSA' not supported."
} And I think we'd want to see something like this but in much nicer EDN:
|
I support this change as well, like Henk. |
How would error code and and HTTP response information work in light of this proposed change, @JAG-UK? |
I'll be putting up a PR for the -121 Hackathon showing this. Essentially: Error responses MUST be sent with the As an example, submitting a Signed Statement with an unsupported signature algorithm would return a
|
Partly serious, partly in jest, sounds like we may have a need for a RFC for CBOR-based HTTP APIs. 😆
Is there a reason we are deviating from RFC9457 ever so slightly? |
And to be clear, I would think |
Yes. We're following RFC 9290 and that deviated. Note that 9290 is ordinally between 7807 and 9457 so maybe there's an update that needs to happen there. There are 2 legit options and I think both have their own unique charm. One is to follow 9290, which I showed above. The other would be to exploit Appendix C of 9457. I considered the latter and it's easy enough to do, I was just trying to favour the documents from the CBOR stable. Given the explanation, any strong opinion on those routes? |
Yeah I really flip-flopped on that one. I spoke to one of the CBOR authors and they include the status code in the object is for extra later clues to errors (poring over log files for example) but I agree it's a bit of a violation. It would be very easy to convince me to remove that |
In trying to build a new ground-up Python implementation of SCRAPI I am finding it quite difficult to cope with commands that might return JSON or might return CBOR depending on things like operation or error state. It makes response and error handling code messy and harder to review.
Following discussion in the editors' meeting I propose to make the whole thing COSE/CBOR. This is much more aligned with the architecture and the IETF mission in general.
The text was updated successfully, but these errors were encountered: