GET and PATCH api/hygiene-settings read and change the home-network DNS defaults, including the local domain #140

Open
opened 2026-10-31 12:42:14 -04:00 by claude · 0 comments
Owner
  • Draft: PQ-32
  • Priority: medium
  • Agent: coder
  • Depends on: #139, #138
  • Decisions: R2-BARE

Why

The console needs to change these settings without a restart.

What changes

  • New Ninlil.Web/Controllers/HygieneSettingsController.cs, a copy of the FilteringSettingsController shape:
    • RFC 7396 merge patch through PresetConfigurationFileApplier.
    • IOptionsMonitor reads.
    • Validates exempt domains and localDomain as names (an empty localDomain turns the source off).
    • GET also returns localDomainZoneFound: whether a zone the authoritative resolver answers matches the local domain, so the console can warn about a domain Ninlil does not host.
  • New permissions hygienesettings:read and hygienesettings:write, discovered by PermissionsController reflection. Use whatever pattern existing settings permissions follow for built-in roles.
  • Models plus examples.

Acceptance

  • src/dotnet/tests/Ninlil.Web.Tests fails first: PATCH {"rebindProtection":true}, then GET returns true.
  • PATCH {"localDomain":"lan"} with no hosted zone lan returns it with localDomainZoneFound: false; after creating a primary zone lan, GET returns true.
  • 403 without the write permission; 400 for an invalid exempt domain or local domain.
  • API change.

Source

  • audit-feature-parity.md §2A #9.
  • Owner decision 2026-10-31, round 2 (R2-BARE): the local domain setting.
- **Draft:** PQ-32 - **Priority:** medium - **Agent:** coder - **Depends on:** #139, #138 - **Decisions:** R2-BARE ### Why The console needs to change these settings without a restart. ### What changes - New `Ninlil.Web/Controllers/HygieneSettingsController.cs`, a copy of the `FilteringSettingsController` shape: - RFC 7396 merge patch through `PresetConfigurationFileApplier`. - `IOptionsMonitor` reads. - Validates exempt domains and `localDomain` as names (an empty `localDomain` turns the source off). - `GET` also returns `localDomainZoneFound`: whether a zone the authoritative resolver answers matches the local domain, so the console can warn about a domain Ninlil does not host. - New permissions `hygienesettings:read` and `hygienesettings:write`, discovered by `PermissionsController` reflection. Use whatever pattern existing settings permissions follow for built-in roles. - Models plus examples. ### Acceptance - [ ] `src/dotnet/tests/Ninlil.Web.Tests` fails first: PATCH `{"rebindProtection":true}`, then GET returns true. - [ ] PATCH `{"localDomain":"lan"}` with no hosted zone `lan` returns it with `localDomainZoneFound: false`; after creating a primary zone `lan`, GET returns `true`. - [ ] 403 without the write permission; 400 for an invalid exempt domain or local domain. - [ ] API change. ### Source - `audit-feature-parity.md` §2A #9. - Owner decision 2026-10-31, round 2 (R2-BARE): the local domain setting.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
lantea-one/ninlil#140
No description provided.