Repository navigation
Description
Step 8 of the MF White List provider (#212, ADR-0023). Copies OpenUrzednik.Nbp.DependencyInjection.
Scope
src/OpenUrzednik.MF.WhiteList.DependencyInjection:AddOpenUrzednikMFWhiteList()andAddKeyedOpenUrzednikMFWhiteList(key)(one namedHttpClient, typed clients, validated options, returns theIHttpClientBuilder), the linkedResilienceRejection.cs,AddOpenUrzednikMFWhiteListRejectionHandler().- Each registration, default and keyed, passes one
OpenUrzednikTelemetryper client: the client's logger,ActivityTraceSource.GetShared(WhiteListTelemetry.SourceName)and the container's metrics: one singleton per container,MeterMetrics.Create(<the container's IMeterFactory>, WhiteListTelemetry.SourceName)when it has a factory, elseMeterMetrics.GetShared(WhiteListTelemetry.SourceName)(ADR-0025, Metrics: an IMeterFactory path for the DI packages #333, asAddOpenUrzednikNbp()does); tests that a default and a keyed client record on theOpenUrzednik.MF.WhiteListmeter, on the factory's meter when the container has one (one instrument shared by its clients), and on the shared meter without one (net472). DependencyInjection/DependencyInjection.propswithAddOpenUrzednikDisplayPathLogging()on the named client, and a test thatIHttpClientFactory's log entries carry no identifier (ADR-0017).- The retry filter of ADR-0023,
WhiteListRetry.ShouldRetryAsync(HttpResponseMessage, CancellationToken), in the base package (BCL types only, no Polly): yes for 400 WL-195/196, 408 and 5xx; no for 429, 500 WL-197 and anything else; it buffers the body so the error mapping can still read it. The README snippet plugs it into an app'sAddStandardResilienceHandler()(options.Retry.ShouldHandle, next toHttpClientResiliencePredicates.IsTransient); neither package referencesMicrosoft.Extensions.Http.Resilience. Tests for each case. - A
mf-white-list-dimutation shard,slnx/slnfentries, an AotSmoke DI check.
Done when
- An app registers the White List clients in one line, its logs carry no identifiers, and the resilience helper is tested.
Context for the implementing agent
Where this fits. Milestone 1.1.0 ships the MF White List provider (OpenUrzednik.MF.WhiteList and OpenUrzednik.MF.WhiteList.DependencyInjection), the first new provider after NBP. Its provider ADR comes from #212; the implementation is split into one issue per PR, in this order: #257 (shared dates) → #258 (skeleton) → #259 (search by one identifier) → #260 (batch search) and #261 (check) → #262 (WL2 status) → #263 (DI package) → #264 (ship it). Each step waits for the one before it (blockedBy), except where an issue says otherwise.
Read first. CLAUDE.md (the binding summary of the rules), ADR-0023 (the MF White List provider, from #212), and the ADRs this issue names. ADRs follow ADR-0022: an accepted ADR that no release has shipped is corrected in place through /adr (with a dated line); a released one is superseded. Never work around an ADR. The reference implementation is OpenUrzednik.Nbp / OpenUrzednik.Nbp.DependencyInjection: copy its structure, conventions and tests (ADR-0016).
Workflow (CLAUDE.md, "Workflow" and "Issues and the project"):
- Start only when this issue's Status is
Readyandgh issue view <n> --json blockedBylists no open blocker; then set StatusIn progress(the only project field an agent changes). - Branch from
origin/develop(feature/…,fix/…,docs/…,chore/…); stage explicit paths only; stage and commit as two separate commands (a hook scans the staged changes); never--no-verify. - One issue per PR into
develop; the PR body starts withCloses #<n>; give it a release label from.github/release.yml(the label on this issue is the forecast). - Before the PR: run the
revieweragent on the diff. After it: check the PR's CodeQL alerts (gh api "repos/milten89/OpenUrzednik.NET/code-scanning/alerts?ref=refs/pull/<pr>/merge&state=open").
Checks to run and report: dotnet build OpenUrzednik.slnx; tests per project (dotnet test tests/<Project> -f net10.0, and -f net472 on Windows); dotnet format OpenUrzednik.slnx --verify-no-changes (after a clean build); the mutation shard of the code you changed (uv run tests/Mutation/run.py <shard>, ADR-0020). If public API, a target or packaging changes: dotnet pack OpenUrzednik.Packages.slnf -c Release (package validation). From the skeleton on: dotnet publish tests/OpenUrzednik.AotSmoke -f net10.0, then run the binary (ADR-0014).
API facts (spec v1.6.2 of 05.11.2026 and its error-code table, live probes on 2026-11-08; details in the provider ADR):
- GET only, no auth. Production
https://wykazpodatnikowvat.mf.gov.pl/api/and/api2/; testhttps://wykazpodatnikowvat-test.mf.gov.pl/…. The oldwl-api.mf.gov.plworks only until 2026-12-01. date(yyyy-MM-dd) is required on/api; not in the future, not before 1 January five years back (2021-01-01 on 2026-11-08; earlier →WL-118).- Answers carry
requestId(proof of the check for the tax authorities) andrequestDateTime(dd-MM-yyyy HH:mm:ss, Warsaw time). - Errors:
{"message", "code": "WL-1xx"}; WL-191 is the daily per-IP limit (429), WL-195/196 ask to repeat the query (400). Quotas (search 100 a day of up to 30 subjects, check 5,000 entities, WL2 50,000 a day) weren't enforced on 2026-11-08 (the test host answered 130 single searches; production 160 single searches and 120 batches of 30 from one IP, all 200). - Requests carry NIP, REGON and account numbers in the path (display paths, ADR-0019/0017); responses carry personal data of sole traders. Fixtures come from the test host's official test data or legal-person records, with any remaining personal field replaced by a fake value of the same format.
Leak tests (added 2026-11-18, #299): TestCommon's RecordingTelemetry and ShouldNotLeak don't see what IHttpClientFactory logs through Microsoft's ILogger (ADR-0017). This package's tests cover it: register a recording ILoggerProvider, send a request with a NIP in the path through the named client, and assert no logged message, scope or property contains the NIP (as given, or any 5 of its digits).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity