Repository navigation
Use longest-prefix matching for SNMP credentials - #45
Merged
Merged
Conversation
12 tasks
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SNMP credential selection previously stopped at the first matching JSON property. A
Defaultentry placed first could shadow every subnet credential, and overlapping networks depended on file order.This change validates every non-default key as IPv4 CIDR, selects the longest matching prefix, and uses
Defaultonly when no subnet matches. The selected entry remains authoritative when its secret name is missing; the command warns and skips that configured credential unless-TryPublicwas explicitly supplied. Help and the credential-map template document those rules.Tests cover Default-first and Default-last maps, overlapping
/16and/24networks, unmatched addresses, malformed CIDRs, and missing secret names.Validation:
git diff --checkpassed. PowerShell is unavailable on the local host; GitHub Actions will run Pester on Linux, macOS, and Windows plus PSScriptAnalyzer.Closes #17