-
Notifications
You must be signed in to change notification settings - Fork 12
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
JWS: Does the General vs. Flattened format make sense? #25
Comments
Another alternative is to always hold a |
Late to the party here, but I believe your suggestion wouldn't comply with the spec For Flattened:
|
That is saying "signatures" (plural) must not be included, but "signature" (singular) is, correct? the example directly below has a |
|
Oh I wasn't reading my own code, you're right. Thanks for the catch. I still think it makes sense to keep bytes separate rather than being redundant. I think this would work by |
This implementation reflects the naming conventions of RFC, where the flattened JWS JSON Serialization contains the same values that the What value do you see in separating |
Mostly because it better matches typical Rust design patterns to keep only varying data in enums, and extract redundant data into the parent struct. You should be able to work with the
I think that my proposal actually better aligns with what you say here. With my proposal, you can pass a With the existing version, you (a user working with the payload but not signing) need to either
This is probably the disconnect, you can look at it from either direction. To me it seems like It seems like perhaps you see "flattened" and "general" as more core parts of the mental model, rather than just being related to serialization? That is, something like |
The current representation is as follows:
It seems a bit unusual to define general vs. flattened at the top level since it's only relevant for signatures. It seems like maybe something like this would work a bit better:
And this would at least make it easier to work with
payload
without needing to branch on General/Flattened.Just curious what thoughts are here
Related: #22
The text was updated successfully, but these errors were encountered: