Skip to content

Enforce the IPv4 inventory contract - #46

Merged
jacobyoby merged 1 commit into
mainfrom
fix/issue-18-inventory-validation
Sep 9, 2026
Merged

jacobyoby merged 1 commit into
mainfrom
fix/issue-18-inventory-validation

Conversation

@jacobyoby

Copy link
Copy Markdown
Owner

Import-Inventory previously accepted any nonempty IP or CIDR string, silently skipped malformed entries, and allowed duplicate device addresses into the topology even though downstream matching is IPv4-only.

This change defines and enforces the stable IPv4 inventory contract. Device and subnet collections must be arrays; each entry receives an indexed error; IPv6, invalid octets, and invalid prefixes are rejected; device addresses must be unique; and CIDR host bits are normalized to the network address. Empty inventories remain valid. Unknown roles remain valid and map to the Access layer.

README documentation states the accepted shapes, normalization rules, IPv4 boundary, duplicate behavior, and unknown-role behavior. Seven fixture tests cover the acceptance paths without network access.

Validation: git diff --check passed. PowerShell is unavailable on the local host; GitHub Actions will run Pester on Linux, macOS, and Windows plus PSScriptAnalyzer.

Closes #18

@jacobyoby
jacobyoby merged commit 940b6a4 into main Sep 9, 2026
4 checks passed
@jacobyoby
jacobyoby deleted the fix/issue-18-inventory-validation branch September 9, 2026 02:51
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.

P1: Validate inventory addresses and declare the supported network model

1 participant