Skip to content
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

Use the 'scope' in the send() method #32

Closed
jyasskin opened this issue Aug 14, 2015 · 6 comments
Closed

Use the 'scope' in the send() method #32

jyasskin opened this issue Aug 14, 2015 · 6 comments

Comments

@jyasskin
Copy link
Member

The send() method discusses setting scope, but then it never uses the scope. Presumably this is where you'd check the id field of the peer or tag before actually writing.

@zolkis
Copy link
Contributor

zolkis commented Aug 17, 2015

It uses ``scope` in step 6 of the algorithm. On the receiving side, the scope is used by the clients directly. Since any native client could forge a web tag content (and we don't have a good solution against it), filtering based on scope is syntactic sugar - we thought it's simpler to just expose the scope to clients. In turn, we can enforce policy on sending: at least web pages cannot write a scope which is not a subdomain match of their origin. Any suggestions on changing the receiving part behavior?

@jyasskin
Copy link
Member Author

Step 6 says "set scope to the DOMString describing the document base URL." That makes scope a local variable in the algorithm, but it's not used after that. Did you mean to set message.scope to that DOMString? But even then, message.scope isn't used in the rest of the algorithm either. If you intend to write message.scope into the "additional Web NFC record", you need to say that, possibly by defining an "Assemble an NDEF message" algorithm.

Is "the receiving side" the tag or peer in steps 10–12? What's a "client"? It looks like you may be talking about later web sites that read the tag/peer, but in #2, @sicking is worried about the effect of writing data to the NFC tag/peer, not just the effect on later websites.

@zolkis
Copy link
Contributor

zolkis commented Aug 17, 2015

Indeed the algorithm changed so many time that now the description is inconsistent... I am working to fix it.

By "receiving side" I meant both tag reading and incoming peer message. We just expose the writing/sending scope, without filtering by scope. Matching writer origin to tag scope happens before writes. Even that is challenged by some people, saying why not be able to override just any web tag from any page (once the user agrees). That would actually make scope purely informative.

@jyasskin
Copy link
Member Author

Thanks.

Re

Matching writer origin to tag scope happens before writes.

which step of which algorithm does that? I haven't been able to find it. (I'm also skeptical of the need to do it, but as long as we're claiming to satisfy the requests in #2, we should be sure to actually satisfy them.)

@zolkis
Copy link
Contributor

zolkis commented Aug 17, 2015

For the record, the policies user agents (currently) should implement are:

  • to use the API a page must be visible and in focus (currently)
  • reading web tags is ok (but should currently obtain permission for using the API)
  • reading non-web tags must obtain user permission
  • beams must always be web tags
  • writing non-web tags should fail with error
  • writing web tags should obtain user permission
  • even when user permission is obtained, writing web tags is only permitted if the writer page origin is sub-domain match of web tag scope (it was meant to be described in the send() step 6 but needs to be expressed more clearly).

This last one is challenged, because

  • the user (permission) should be able to override this, and
  • Verify security model #2 actually does not mandate it, as it is concerned only with the other policies above.

So I think we could relax the last policy, making scope informative (which origin has written/sent the data). But let me fix the latest number of issues and return to this bit later.

zolkis added a commit to zolkis/web-nfc that referenced this issue Sep 5, 2015
…ad events. Fixed terminology related issues. Renamed send() to pushMessage(). Add timeout to push options. Issues addressed: w3c#2, w3c#3, w3c#22, w3c#26, w3c#28, w3c#30, w3c#31, w3c#32, w3c#33, w3c#35, w3c#36, w3c#38, w3c#39, w3c#40.
@zolkis
Copy link
Contributor

zolkis commented Sep 23, 2015

This has become obsolete.

@zolkis zolkis closed this as completed Sep 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants