Skip to content

feat(snmp): allow IPv6 CIDR keys in credential maps - #79

Merged
jacobyoby merged 1 commit into
mainfrom
cursor/snmp-credmap-ipv6-cidr-d34d
Sep 9, 2026
Merged

jacobyoby merged 1 commit into
mainfrom
cursor/snmp-credmap-ipv6-cidr-d34d

Conversation

@jacobyoby

@jacobyoby jacobyoby commented Sep 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #74.

Problem

Resolve-SnmpCredentialConfig only accepted IPv4 CIDR keys, so dual-stack sites could not scope SNMP credentials to IPv6 prefixes after #57/#68.

Change

  • Parse IPv4 and IPv6 CIDR map keys with [System.Net.IPAddress]::TryParse (same path as inventory / Invoke-SnmpWalk).
  • Longest-prefix match is unchanged and works on mixed v4/v6 maps.
  • Wrong-family lookup returns no credential (or Default); it does not throw.
  • Invalid CIDR keys still fail closed.
  • Pester: v6 key match, v6 longest-prefix, v4 unchanged on mixed maps, wrong-family returns null, invalid v6 CIDR throws.
  • CHANGELOG [Unreleased] bullet; credential-matching help/template text now says IPv4 or IPv6.

Out of scope

CI smoke, Gallery release, SnmpWalk (#78), NetBox (#77), MCP.

Verification

./tests/run-tests.sh (pwsh 7.4.19 / Pester 6.2.0). 162 passed, 0 failed. Touched tests are SNMP credential-map IPv6 CIDR keys (#74) plus the existing #17 IPv4 regression cases.

Open in Web Open in Cursor 

Resolve-SnmpCredentialConfig now parses IPv4 and IPv6 CIDR keys and
keeps longest-prefix matching. Mixed-family maps do not throw;
wrong-family lookups return no credential. Invalid CIDRs still fail closed.

Co-authored-by: Jacobrakai <jacobyoby@users.noreply.github.com>
@jacobyoby
jacobyoby marked this pull request as ready for review September 9, 2026 20:21
@jacobyoby
jacobyoby merged commit 03a6adf into main Sep 9, 2026
7 checks passed
@cursor
cursor Bot deleted the cursor/snmp-credmap-ipv6-cidr-d34d branch September 19, 2026 18:20
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.

Resolve-SnmpCredentialConfig: allow IPv6 CIDR map keys

2 participants