-
Notifications
You must be signed in to change notification settings - Fork 0
Support for new format of CCA top level token to match CMW changes #35
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
Conversation
… new-cca-top-tokenSupport for updated (breaking) change in CCA top level token made to conform with updated CMW definition. Change to spec can be found in RMM 1.1-alp14.
|
The changes LGTM, just one question: I noticed the RMM spec referred in the README.md still uses Is there a plan to change the spec? as currently the spec seems out of sync with the proposed changes. |
|
yogeshbdeshpande
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
setrofim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash the commits, add Signed-off-by footer, and update the commit message to align with Conventional Commits.
Apart from that, LGTM.
|
I think we can be a bit more conservative on the decoding side. Something like: var (
tags = []encoding.CBORTagEntry{
{Type: CBORCollection{}, Tag: 399},
{Type: CMWCollection{}, Tag: 903},
}and then type CMWCollection struct {
PlatformTokenColl CMWCollectionEntry `cbor:"44234,keyasint"`
RealmTokenColl CMWCollectionEntry `cbor:"44241,keyasint"`Or do that manually, by first decoding the top-level tag, and then dispatching to the right collection decoder: var t cbor.RawTag
if err = t.UnmarshalCBOR(b); err != nil {
return fmt.Errorf("unmarshal top-level CBOR Tag: %w", err)
}
switch t.Number {
case 903: // do new
case 399: // do legacy
}This would give senders the ability to align with the new format at their own pace. |
…onform with updated CMW definition. Change to spec can be found in RMM 1.1-alp14. Code will still decode EAT Collection formatted tokens Signed-off-by: simfro01 <[email protected]>
…updated CMW definition. Change to spec can be found in RMM 1.1-alp14. Change supports new token format and will still decode previous EAT Collection format Signed-off-by: simfro01 <[email protected]>
|
Latest commit adds support for reading old (399) tokens as well as the full CMW tokens |
Apologies for a late reply, but wanted to check, is this complexity really required, at this stage supporting two types of collection ? The products using token type are not yet out in the field, so if we can unilaterally change that is a better fit for now ? |
Yes, there is running code, in testing labs and in CIs, that’s better not brutally break :-) |
…updated CMW definition. Change to spec can be found in RMM 1.1-alp14. Change supports new token format and will still decode previous EAT Collection format Signed-off-by: simfro01 <[email protected]>
…updated CMW definition. Change to spec can be found in RMM 1.1-alp14. Change supports new token format and will still decode previous EAT Collection format
|
Merged separately to cleanup messy commit history |
Support for updated (breaking) change in CCA top level token made to conform with updated CMW definition.
Change to spec can be found in RMM 1.1-alp14.