Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag
I don't have any problems with what is here. It boils down to 1. I already know that this is going to be a CWT so I save a byte. 2. I don't know so I waste a tag byte in that case. Most of the time it is going to be the first case, but my code is agnostic about this and will remove the tag if it is the correct value. In either case it then makes sure that what follows is a map. Jim From: Ace [mailto:ace-boun...@ietf.org] On Behalf Of Hannes Tschofenig Sent: Thursday, October 19, 2017 8:56 AM To: ace@ietf.org Subject: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag Hi all, In Section 6 of draft-ietf-ace-cbor-web-token-08 we describe two ways to determine whether the CBOR data structure is a CWT. I wonder whether it is better to settle on one approach only. Do folks have practical experience with this feature? Ciao Hannes IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. ___ Ace mailing list Ace@ietf.org https://www.ietf.org/mailman/listinfo/ace
Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag
On Oct 19, 2017, at 18:41, Jim Schaad wrote: > > • I already know that this is going to be a CWT so I save a byte. > • I don’t know so I waste a tag byte in that case. Right. In REST protocols, we usually have a media type, so we don’t need the CBOR Tag. Within some other data structures, or in legacy protocols such as MQTT, we may not have that, so a tag is a good single standard way to indicate this. (Does the latter case need to be a single byte [which is then preceded by 0xd8, by the way]? Maybe that would not have been necessary(*), but then CWTs are going to be rather common. And 61 is a “=“, which is cool for our hexdump reading population :-) Grüße, Carsten (*) The number is already assigned, BTW. ___ Ace mailing list Ace@ietf.org https://www.ietf.org/mailman/listinfo/ace
Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag
I also agree that the spec already has this right. Typically no tag will be needed because the application knows the data structure is a CWT from context. The tag is available for any use cases where it's needed to resolve ambiguity that might otherwise be present. -- Mike -Original Message- From: Ace [mailto:ace-boun...@ietf.org] On Behalf Of Carsten Bormann Sent: Thursday, October 19, 2017 10:05 AM To: Jim Schaad Cc: Hannes Tschofenig ; ace@ietf.org Subject: Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag On Oct 19, 2017, at 18:41, Jim Schaad wrote: > > • I already know that this is going to be a CWT so I save a byte. > • I don’t know so I waste a tag byte in that case. Right. In REST protocols, we usually have a media type, so we don’t need the CBOR Tag. Within some other data structures, or in legacy protocols such as MQTT, we may not have that, so a tag is a good single standard way to indicate this. (Does the latter case need to be a single byte [which is then preceded by 0xd8, by the way]? Maybe that would not have been necessary(*), but then CWTs are going to be rather common. And 61 is a “=“, which is cool for our hexdump reading population :-) Grüße, Carsten (*) The number is already assigned, BTW. ___ Ace mailing list Ace@ietf.org https://www.ietf.org/mailman/listinfo/ace ___ Ace mailing list Ace@ietf.org https://www.ietf.org/mailman/listinfo/ace
Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag
For the cost saving of one byte we are essentially introduction options here. I am wondering whether this byte is worth it. -Original Message- From: Mike Jones [mailto:michael.jo...@microsoft.com] Sent: 19 October 2017 21:29 To: Carsten Bormann; Jim Schaad Cc: Hannes Tschofenig; ace@ietf.org Subject: RE: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag I also agree that the spec already has this right. Typically no tag will be needed because the application knows the data structure is a CWT from context. The tag is available for any use cases where it's needed to resolve ambiguity that might otherwise be present. -- Mike -Original Message- From: Ace [mailto:ace-boun...@ietf.org] On Behalf Of Carsten Bormann Sent: Thursday, October 19, 2017 10:05 AM To: Jim Schaad Cc: Hannes Tschofenig ; ace@ietf.org Subject: Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag On Oct 19, 2017, at 18:41, Jim Schaad wrote: > > • I already know that this is going to be a CWT so I save a byte. > • I don’t know so I waste a tag byte in that case. Right. In REST protocols, we usually have a media type, so we don’t need the CBOR Tag. Within some other data structures, or in legacy protocols such as MQTT, we may not have that, so a tag is a good single standard way to indicate this. (Does the latter case need to be a single byte [which is then preceded by 0xd8, by the way]? Maybe that would not have been necessary(*), but then CWTs are going to be rather common. And 61 is a “=“, which is cool for our hexdump reading population :-) Grüße, Carsten (*) The number is already assigned, BTW. ___ Ace mailing list Ace@ietf.org https://www.ietf.org/mailman/listinfo/ace IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you. ___ Ace mailing list Ace@ietf.org https://www.ietf.org/mailman/listinfo/ace
Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag
On Oct 19, 2017, at 21:30, Hannes Tschofenig wrote: > > For the cost saving of one byte we are essentially introduction options > here. I am wondering whether this byte is worth it. Two bytes. It’s not really an option, as in every context there will be a single right way to do this. But yes, there are naked and tagged CWTs now. (If we only define the tagged version, very quickly there will be specs that define a “compressed CWT” that just leaves out those first two bytes…) Grüße, Carsten ___ Ace mailing list Ace@ietf.org https://www.ietf.org/mailman/listinfo/ace
Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag
The type of location where it might show up is where one does a value that is placed in an array where it can be either an A or a B and you use the tag to distinguish between the two options. This can be very useful in those cases. > -Original Message- > From: Carsten Bormann [mailto:c...@tzi.org] > Sent: Thursday, October 19, 2017 1:32 PM > To: Hannes Tschofenig > Cc: Mike Jones ; Jim Schaad > ; ace@ietf.org > Subject: Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag > > On Oct 19, 2017, at 21:30, Hannes Tschofenig > wrote: > > > > For the cost saving of one byte we are essentially introduction options > here. I am wondering whether this byte is worth it. > > Two bytes. > > It’s not really an option, as in every context there will be a single right > way to > do this. > But yes, there are naked and tagged CWTs now. > > (If we only define the tagged version, very quickly there will be specs that > define a “compressed CWT” that just leaves out those first two bytes…) > > Grüße, Carsten ___ Ace mailing list Ace@ietf.org https://www.ietf.org/mailman/listinfo/ace
Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag
I think there are cases when it is use full to have the tag (maybe few) and I think the draft is clear enough in discouraging the usage when not needed. “Its use is optional, and is intended for use in cases in which this information would not otherwise be known.” To write code that supports unwrapping the tag is very easy. Finally I personally think it is good to have the tag for completeness. On Thu, Oct 19, 2017 at 11:14 PM, Jim Schaad wrote: > The type of location where it might show up is where one does a value > that is placed in an array where it can be either an A or a B and you use > the tag to distinguish between the two options. This can be very useful in > those cases. > > > > > -Original Message- > > From: Carsten Bormann [mailto:c...@tzi.org] > > Sent: Thursday, October 19, 2017 1:32 PM > > To: Hannes Tschofenig > > Cc: Mike Jones ; Jim Schaad > > ; ace@ietf.org > > Subject: Re: [Ace] draft-ietf-ace-cbor-web-token-08 - CWT CBOR Tag > > > > On Oct 19, 2017, at 21:30, Hannes Tschofenig > > wrote: > > > > > > For the cost saving of one byte we are essentially introduction > options > > here. I am wondering whether this byte is worth it. > > > > Two bytes. > > > > It’s not really an option, as in every context there will be a single > right way to > > do this. > > But yes, there are naked and tagged CWTs now. > > > > (If we only define the tagged version, very quickly there will be specs > that > > define a “compressed CWT” that just leaves out those first two bytes…) > > > > Grüße, Carsten > > ___ > Ace mailing list > Ace@ietf.org > https://www.ietf.org/mailman/listinfo/ace > ___ Ace mailing list Ace@ietf.org https://www.ietf.org/mailman/listinfo/ace