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

Commits on Jan 21, 2024

  1. add tests for subdomain matching

    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 committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    5f0a449 View commit details
    Browse the repository at this point in the history
  2. [FAILS] Add a test to show issue with subdomains as additional permis…

    …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.
    aspiers committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    dce4ca2 View commit details
    Browse the repository at this point in the history
  3. Revert "[FAILS] Add a test to show issue with subdomains as additiona…

    …l permissions"
    
    This reverts commit dce4ca2.
    fregante committed Jan 21, 2024
    Configuration menu
    Copy the full SHA
    2502e73 View commit details
    Browse the repository at this point in the history