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

What if callerOrigin is an opaque origin #172

Closed
annevk opened this issue Aug 17, 2016 · 16 comments
Closed

What if callerOrigin is an opaque origin #172

annevk opened this issue Aug 17, 2016 · 16 comments
Assignees
Milestone

Comments

@annevk
Copy link
Member

annevk commented Aug 17, 2016

You can't get a public suffix out of that.

@annevk
Copy link
Member Author

annevk commented Aug 17, 2016

In particular, you can only determine that if the origin has a host and the host is not an IP address of some kind.

@annevk
Copy link
Member Author

annevk commented Aug 17, 2016

(See the WHATWG HTML Standard for the actual terms you need to use here.)

@equalsJeffH
Copy link
Contributor

i believe @annevk is referring to: https://html.spec.whatwg.org/multipage/browsers.html#origin

@balfanz
Copy link
Contributor

balfanz commented Sep 7, 2016

@annevk - can you explain what the problem would be? Is there something in the spec that wouldn't work for opaque origins?

@annevk
Copy link
Member Author

annevk commented Sep 8, 2016

Yes, see OP.

@equalsJeffH equalsJeffH modified the milestones: WD-02, CR Sep 9, 2016
@equalsJeffH
Copy link
Contributor

this issue is closely related to #171 and will be addressed as part of addressing the latter.

@vijaybh
Copy link
Contributor

vijaybh commented Sep 14, 2016

I would propose that we do not handle such cases for now. For v1 I would focus on the core use case of an interactive user in an active browsing context.

@annevk
Copy link
Member Author

annevk commented Sep 15, 2016

You need to handle it somehow. You can't just leave things undefined (or in this case, cause a segfault).

@rlin1
Copy link
Contributor

rlin1 commented Sep 15, 2016

see https://www.w3.org/TR/html51/browsers.html#opaque-origin for definition of opaque origin.

@annevk
Copy link
Member Author

annevk commented Sep 15, 2016

You really want to be using https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque as a reference at all times. The copy-and-pasters of that work [HTML51] don't always do a good job.

@rlin1
Copy link
Contributor

rlin1 commented Sep 15, 2016

In what situations would such opaque origins appear?
https://html.spec.whatwg.org/multipage/browsers.html#creator-browsing-context says:
A browsing context can have a creator browsing context, the browsing context that was responsible for its creation. If a browsing context has a parent browsing context, then that is its creator browsing context. Otherwise, if the browsing context has an opener browsing context, then that is its creator browsing context. Otherwise, the browsing context has no creator browsing context.

@annevk
Copy link
Member Author

annevk commented Sep 15, 2016

Data URLs and sandboxing, at least.

@rlin1
Copy link
Contributor

rlin1 commented Sep 15, 2016

I see two potential approaches to deal with such situation:

Approach 1:
Some JavaScript without a clear association of a creator browsing context could be seen as using the Browser as an "App".

Remember: outside the web use case, Apps can also create such scoped authentication credentials. But instead of scoping the credential to some web server the App might be talking to, we scope the credential to the App itself.

A web browser apparently can act on behalf of some RP identified by a non-opaque origin, or it could act as an App, i.e. within the scope of a browser vendor.

Approach 2:
Such opaque origin will never be equal to any other opaque-origin. Consequently, it seems impossible at any later point in time to access things which have been scoped to such Opaque Origin.
Persistently stored credentials scoped to such Opaque Origin could never be re-used at a later point (i.e. after this opaque-origin is gone).
Why would someone want to do that? So we might argue there is no point in supporting that and makeCredential would just fail.

Opinions?

@annevk
Copy link
Member Author

annevk commented Sep 15, 2016

I think you should just make it fail, fwiw.

@vijaybh
Copy link
Contributor

vijaybh commented Sep 15, 2016

Clarifying my earlier comment - this is what I was trying to say too. By "not handle it" I meant "treat it as a failure case and don't worry about it, if there is a legitimate need for it someone will come along to tell us soon enough".

@equalsJeffH
Copy link
Contributor

Yes, approach 2, am crafting spec text to that end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants