Re: [web-nfc] "typedef DOMString NDEFRecordType" is expected to be case sensitive or not? (#331)

1. Related to the original question, IMHO we should follow the constraints of the NDEF specs.

The NDEF Record Type Definition spec says

> Two External Type Names MUST be compared in a **case-insensitive** manner. Example:
“example.com:foobar”
“Example.com:foobar”
“Example.COM:Foobar”
“eXaMpLe.CoM:fOoBaR”
The four examples above represent all the same External Type Name.

In turn, for Well Known Types 

> Two Well Known Types (including Global and Local Names) MUST be compared on a **case-
sensitive**, character-by-character basis. In other words, two Well Known Types MUST be
considered equal if and only if their binary representations are identical.

For payload identifiers, the NDEF spec says

> By providing a payload identifier, it becomes possible for other payloads supporting URI-based linking technologies to refer to that payload. NDEF does not mandate any particular linking mechanism or format but leaves this to the user application to define in the language it prefers.

The spec notes that non-standard values are "discouraged", i.e. they are not guaranteed to work, but don't require special validation from NFC HW. Also, as mentioned elsewhere, encoding is left to the NDEF application, in our case the implementation (or the underlying Android implementation). 

We are free to define constraints in Web NFC, they will be application-level constrains from NDEF point of view.

2. Regarding the same-origin policy, 

Content that is written by a web page to a tag using the Web NFC API becomes public knowledge, as Kenneth said once it's like a post-it note.

There is no way to ensure that an origin read from a tag was actually written by that origin using the 
Web NFC API, so implementations cannot apply same-origin policy for reading tags.

For peer push implementations could enforce that the exchanged content has the same origin on both devices.



-- 
GitHub Notification of comment by zolkis
Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/331#issuecomment-530855482 using your GitHub account

Received on Thursday, 12 September 2019 14:35:58 UTC