Repository navigation
Add zone-based firewall policies via the integration API - #21
Merged
Merged
Conversation
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.
Closes #20.
Adds
UnifiSharp.Firewall: typed create/read/update/delete for UniFi Network 9+ zone-based firewall policies through the official integration API (/v1/sites/{site}/firewall/policies). This lets Homelab'snetwork.yamldeclare policies andconverge-unifireconcile them.Design
FirewallPolicySpec/FirewallEndpoint: the round-trippable subset (zones; addresses as IP, CIDR or range; networks; IPv6 interface identifier; ports; IP version; protocol; action; logging; enabled). Equality is semantic, so it doubles as the drift check.FirewallPolicyJson: hand-written mapping to and from the wire JSON, not the generated Kiota models. Those split into a class per IP version × protocol style × filter kind, and the subset reads far more clearly as the wire shape.FromJsonreturns a reason for anything outside the subset (domain/app/region filters, schedules, matching lists, MAC filters), so a caller never treats "can't compare" as "matches".UnifiFirewallClient: site lookup, zone and network name resolution, paged listing, POST/PUT/DELETE, and an error that carries the controller's response body.<iid>/::ffff:ffff:ffff:ffff, so a rule follows a host across ISP prefix changes. That's the motivating case from Declare and reconcile zone-based firewall policies (needed for IPv6 inbound) #20.Tests
Version 0.3.0 → 0.4.0.
https://claude.ai/code/session_01V2afcTcowT1YVBwLzrJFtH