Skip to content

acl: move the domain glob matcher to acl/v2 - #359

Open
shubh-stripe wants to merge 1 commit into
v2from
shubh/aclv2-1-glob
Open

shubh-stripe wants to merge 1 commit into
v2from
shubh/aclv2-1-glob

Conversation

@shubh-stripe

Copy link
Copy Markdown
Contributor

Each ACL source uses its own layout today, and the v1 Decide has a precedence order that the file doesn't show: a service's allowed domains win over global_deny_list, a service can't deny a domain, and allow lists and the deny list match the same glob text in different ways.

This starts a new ACL v2 format and decision engine in acl/v2. This PR only moves the domain glob matcher there, with no behavior change. Later PRs add the v2 format and the engine, then switch smokescreen and cmd to decide through it and load v2 files only.

What changes

v1's domain glob validator and matcher (ValidateDomainGlob, HostMatchesGlob, the label-wildcard parser and matcher) move from acl/v1 to the new acl/v2 package, with their tests. v1 keeps ValidateDomainGlob and HostMatchesGlob as wrappers, so it decides exactly as before. The same-registrable-domain switch is now the exported MatchGlob(host, glob, crossPublicSuffix); the v1 global deny list keeps calling it with crossPublicSuffix=true, as it always matched.

Test plan

The existing v1 tests pass unchanged in their new location, except one that now calls the exported matcher instead of the unexported one.

🤖 Generated with Claude Code

The v2 ACL replaces acl/v1, so the domain glob validator and matcher move to the new acl/v2 package, with their tests. acl/v1 keeps ValidateDomainGlob and HostMatchesGlob as wrappers until it is removed, and decides exactly as before.

The matcher's same-registrable-domain switch is now exported as MatchGlob(host, glob, crossPublicSuffix). The v1 global deny list calls it with crossPublicSuffix=true, as it always matched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Committed-By-Agent: claude
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.

1 participant