Skip to content

Endpoint: make matchesPattern stricter about pattern types - #203

Merged
kpodosin merged 1 commit into
mainfrom
kpodosin/endpointPatternMatching
Oct 1, 2026
Merged

kpodosin merged 1 commit into
mainfrom
kpodosin/endpointPatternMatching

Conversation

@kpodosin

@kpodosin kpodosin commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

matchesPattern now decides how to compare based on what kind of pattern it's given:

  • Address and CIDR patterns only match address endpoints of the same IP family, and never fall back to hostname matching.
  • Address patterns are compared by value, so different spellings of the same IPv6 address match.
  • Wildcard matching against address text applies to IPv4 only.
  • Endpoints other than host and address endpoints never match, even with "*".

Also adds matchesCIDR helpers for IPv4 and IPv6 addresses, and tests covering each rule.

@kpodosin kpodosin added the 🔨 semver/patch No public API change. label Oct 1, 2026
@kpodosin
kpodosin merged commit 165f423 into main Oct 1, 2026
35 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants