Add multi-domain support via alias zones using ZoneOrigins class#1
Add multi-domain support via alias zones using ZoneOrigins class#1indisoluble merged 35 commits intomasterfrom
Conversation
Co-authored-by: indisoluble <472832+indisoluble@users.noreply.github.com>
Co-authored-by: indisoluble <472832+indisoluble@users.noreply.github.com>
Co-authored-by: indisoluble <472832+indisoluble@users.noreply.github.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
alias zones are valid and do not have subdomain relationships
|
@copilot I have pushed some changes over your first proposal, including a new class named
Once changes are applied, review tests and fox them accordingly, including adding new tests or removing those that are redundant, if necessary |
- Replace origin_name and alias_zones in DnsServerConfig with zone_origins - Update dns_server_config_factory to create ZoneOrigins instance - Update dns_server_udp_handler to use ZoneOrigins.relativize() method - Update dns_server_zone_updater to use zone_origins.primary - Update main.py to pass zone_origins to server - Update all tests to use zone_origins - Remove redundant multi-domain test files Co-authored-by: indisoluble <472832+indisoluble@users.noreply.github.com>
Done in commit d8f52d0. The
All 175 tests passing. The redundant multi-domain test files were removed since the functionality is now properly tested in |
indisoluble
left a comment
There was a problem hiding this comment.
@copilot Address latest comments
- Remove unused _make_alias_zones function - Remove docstring comment from _make_zone_origins - Remove subdomain conflict validation (ZoneOrigins handles this) Co-authored-by: indisoluble <472832+indisoluble@users.noreply.github.com>
indisoluble
left a comment
There was a problem hiding this comment.
@copilot Address new set of comments
tests/indisoluble/a_healthy_dns/test_dns_server_zone_updater.py
Outdated
Show resolved
Hide resolved
tests/indisoluble/a_healthy_dns/test_dns_server_zone_updater_threated.py
Outdated
Show resolved
Hide resolved
- Add __eq__ method for equality comparison based on primary and origins - Add __hash__ method to allow use in sets and as dict keys - Add __repr__ method for readable string representation - Add 9 new tests for these methods - Refactor test fixtures to use zone_origins.primary instead of separate origin_name - Remove unused origin_name fixture from test_dns_server_zone_updater.py - Remove unused mock_origin_name fixture from test_dns_server_zone_updater_threated.py - Reorder mock_zone_origins before mock_zone in test_dns_server_udp_handler.py Co-authored-by: indisoluble <472832+indisoluble@users.noreply.github.com>
All comments addressed in commit 6a42800:
All 184 tests passing. |
with input parameters
Multi-Domain DNS Support - ZoneOrigins Integration
ZoneOriginsclass into DNS configurationDnsServerConfigto usezone_originsinstead oforigin_name+alias_zonesZoneOriginsinstanceZoneOrigins.relativize()methodzone_origins.primaryzone_originsto serverChanges Made
Core Integration:
long.comandshort.com) with the same subdomains resolving to the same IPsZoneOrigins.relativize()methodZoneOrigins Class Enhancement:
__eq__method for proper equality comparison based on primary zone and origins__hash__method to enable use in sets and as dictionary keys__repr__method for readable string representation showing primary and aliasesCode Simplification:
_make_zone_origins()_make_alias_zones()functionzone_origins.primaryconsistentlyInterface
Command-line:
Docker:
DNS_ALIAS_ZONESenvironment variableResult
www.primary.com,www.alias1.com, andwww.alias2.comall resolve to the same IP with a single health checkOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.