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

Add tests for subdomain wildcard #24

Merged
merged 3 commits into from
Jan 21, 2024
Merged

Conversation

aspiers
Copy link
Contributor

@aspiers aspiers commented Jan 21, 2024

Add https://*.hassubdomains.com/* to the test manifests, to prove that subdomain matching is already working correctly, and allow for other tests relating to subdomains (see #23).

@aspiers
Copy link
Contributor Author

aspiers commented Jan 21, 2024

Switching to draft as I may have missed something here as test-fixtures/reported-at-start.json and test-fixtures/reported-after-addition.json probably need to be updated too. Just checking now.

Add https://*.hassubdomains.com/* to the test manifests, to prove that
subdomain matching is already working correctly, and allow for other
tests relating to subdomains.
@aspiers aspiers marked this pull request as ready for review January 21, 2024 11:38
aspiers and others added 2 commits January 21, 2024 11:43
…sions

According to the documentation, `strictOrigins` is only concerned with
widening of permissions, not additional permissions which are narrower
than a pattern already in the manifest origins.

However, if `https://subdomain.hassubdomains.com/*` is granted by the
user as an optional permission on top of `https://*.hassubdomains.com/*`,
this does not change the effective set of permissions.

So to be consistent with the documentation, when `strictOrigins` is
`true`, the additional subdomain pattern should not be included in the
return value of `extractAdditionalPermissions()`.

Adding a test based on this expectation causes a failure, showing the
current problem.  So either the code should be changed, or the
documentation for `strictOrigins` expanded to clarify that it also
catches narrower permissions as well as wider ones.
@fregante fregante changed the title add tests for subdomain matching add tests for subdomain wildcard matching Jan 21, 2024
@fregante fregante changed the title add tests for subdomain wildcard matching isUrlPermittedByManifest - Add tests for subdomain wildcard Jan 21, 2024
@fregante fregante merged commit bac783e into fregante:main Jan 21, 2024
3 checks passed
@fregante fregante changed the title isUrlPermittedByManifest - Add tests for subdomain wildcard Add tests for subdomain wildcard Jan 21, 2024
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

Successfully merging this pull request may close these issues.

2 participants