The query-log API returns the new fields under the privacy level and filters by blocked, list, source, upstream and opcode #103

Open
opened 2026-10-31 12:42:07 -04:00 by claude · 0 comments
Owner
  • Draft: PQ-5
  • Priority: high
  • Agent: coder
  • Depends on: #102
  • Decisions: Q-PQ-4

Why

DnsQueryLogSubscriber maps only the old fields (src/dotnet/src/Ninlil.Dns.Server.QueryLog/DnsQueryLogSubscriber.cs), and QueryLogController.Search exposes only the old filters (src/dotnet/src/Ninlil.Web/Controllers/QueryLogController.cs:66-135, ToDetail at :204).

What changes

  • Subscriber: copy the new fields.
    • Apply QueryLogPrivacyLevelEnum. When the level removes the queried name (DomainRedacted and above), AnswerSummary and BlockRule are removed too, because a rule or an answer can reveal the name.
  • Ninlil.Web/Models/QueryLogModels.cs, DnsQueryLogEntryDetail: add the fields.
  • QueryLogController.Search: new query parameters answerSource, blocked, blockListId, upstream and opcode. Parse the enums with the existing TryParseOptionalEnum.
  • Swagger examples under Ninlil.Web/Examples/QueryLog/.

Acceptance

  • Test fails first in src/dotnet/tests/Ninlil.Dns.Server.QueryLog.Tests: at a privacy level that removes the name, BlockRule and AnswerSummary are null.
  • src/dotnet/tests/Ninlil.Web.Tests: GET api/query-log?blocked=true after a blocked query returns that row with blockListName; GET api/query-log?opcode=Update after an RFC 2136 update returns that row with opcode: "Update".
  • OpenApiSnapshotTests fails until #104. This package does not regenerate the snapshot.
  • README query-log section updated.
  • API change.

Source

  • audit-feature-parity.md §2A #2; DEDUPE.md A1.
  • Owner decision 2026-10-31 (Q-PQ-4): the summary follows the privacy level.
- **Draft:** PQ-5 - **Priority:** high - **Agent:** coder - **Depends on:** #102 - **Decisions:** Q-PQ-4 ### Why `DnsQueryLogSubscriber` maps only the old fields (`src/dotnet/src/Ninlil.Dns.Server.QueryLog/DnsQueryLogSubscriber.cs`), and `QueryLogController.Search` exposes only the old filters (`src/dotnet/src/Ninlil.Web/Controllers/QueryLogController.cs:66-135`, `ToDetail` at `:204`). ### What changes - Subscriber: copy the new fields. - Apply `QueryLogPrivacyLevelEnum`. When the level removes the queried name (`DomainRedacted` and above), `AnswerSummary` and `BlockRule` are removed too, because a rule or an answer can reveal the name. - `Ninlil.Web/Models/QueryLogModels.cs`, `DnsQueryLogEntryDetail`: add the fields. - `QueryLogController.Search`: new query parameters `answerSource`, `blocked`, `blockListId`, `upstream` and `opcode`. Parse the enums with the existing `TryParseOptionalEnum`. - Swagger examples under `Ninlil.Web/Examples/QueryLog/`. ### Acceptance - [ ] Test fails first in `src/dotnet/tests/Ninlil.Dns.Server.QueryLog.Tests`: at a privacy level that removes the name, `BlockRule` and `AnswerSummary` are null. - [ ] `src/dotnet/tests/Ninlil.Web.Tests`: `GET api/query-log?blocked=true` after a blocked query returns that row with `blockListName`; `GET api/query-log?opcode=Update` after an RFC 2136 update returns that row with `opcode: "Update"`. - [ ] `OpenApiSnapshotTests` fails until #104. This package does not regenerate the snapshot. - [ ] README query-log section updated. - [ ] API change. ### Source - `audit-feature-parity.md` §2A #2; DEDUPE.md A1. - Owner decision 2026-10-31 (Q-PQ-4): the summary follows the privacy level.
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#103
No description provided.