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

Wildcards in Permissions Policy Origins #679

Closed
arichiv opened this issue Aug 26, 2022 · 3 comments
Closed

Wildcards in Permissions Policy Origins #679

arichiv opened this issue Aug 26, 2022 · 3 comments

Comments

@arichiv
Copy link

arichiv commented Aug 26, 2022

Request for Mozilla Position on an Emerging Web Specification

Other information

Design Doc

This feature will add support for wildcard in permissions policy structured like SCHEME://*.HOST:PORT (e.g., https://*.foo.com/) where a valid Origin could be constructed from SCHEME://HOST:PORT (e.g., https://foo.com/). This requires that HOST is at least eTLD+1 (a registrable domain). This means that https://*.bar.foo.com/ works but https://*.com/ won’t (if you want to allow all domains to use the feature, you should just delegate to *). Wildcards in the scheme and port section will be unsupported and https://*.foo.com/ does not delegate to https://foo.com/.

Before, a permissions policy might need to look like:
permissions-policy: ch-ua-platform-version=(self "https://foo.com/" "https://cdn1.foo.com/" "https://cdn2.foo.com/" "https://foo.cdn2.foo.com/")

With this feature, it could look like:
permissions-policy: ch-ua-platform-version=(self "https://foo.com/" "https://*.foo.com")

@martinthomson
Copy link
Member

Did your comment lose the "*" character in a few places?

Looking at the proposal, I think that you need to sort out whether matching follows CSP (where "*" matches any number of labels) or certificates (where "*" matches a single label). In general, it is better to have these fundamental details sorted out before asking our opinion. However, once that is worked out, I don't see any problem with this.

cc @dveditz

@arichiv
Copy link
Author

arichiv commented Aug 29, 2022

Thanks for the catch re *, I forgot it meant italics in markdown.

As for your question, I added an example to clarify that "https://foo.cdn2.foo.com/" would match "https://*.foo.com/"

@bgrins
Copy link
Member

bgrins commented Sep 20, 2022

Confirmed with @dveditz this is fine, thanks for the clarification and update

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

3 participants