Central UI /admin/secrets throws 500 — Secrets.Ui needs ZB.MOM.WW.Audit.IAuditWriter, which the host never registers #22
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found 2026-07-19 during the family-wide sweep for the OtOpcUa dead-secrets-page defect (
lmxopcua#483). ScadaBridge does not have that render-mode defect (its router is globally interactive) — it has a different one that was hiding behind the login wall.Symptom
On a freshly deployed local cluster (current
main@0083ce35, Secrets 0.2.1), navigating to/admin/secretson a Central node returns HTTP 500:Reproduced with
Security:Auth:DisableLogin(the auto-login principal), so it is not an authorization problem. It was never seen before because unauthenticated probes stop at the login redirect — the page has plausibly never rendered successfully on ScadaBridge.Cause
ScadaBridge has two
IAuditWriterinterfaces:ZB.MOM.WW.Audit.IAuditWriter— the shared-lib seam, whichZB.MOM.WW.Secrets.Uicomponents (SecretEditor,ConfirmDeleteModal)@inject;ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Services.IAuditWriter— the repo's own seam (deliberately distinct per its doc comment), which is whatAddAuditLogregisters (FallbackAuditWriter).The secrets adoption (G-4) mounted the UI but never bridged the shared seam, so the container has no
ZB.MOM.WW.Audit.IAuditWriterand component construction fails.Suggested fix
Both interfaces already use the canonical
ZB.MOM.WW.Audit.AuditEventand the sameWriteAsync(AuditEvent, CancellationToken)shape, so a tiny adapter registered in the Central composition root suffices, e.g.services.AddSingleton<ZB.MOM.WW.Audit.IAuditWriter>(sp => new SharedSeamAuditWriterAdapter(sp.GetRequiredService<Commons.Interfaces.Services.IAuditWriter>()))— forwarding secrets-UI audit events into the existing site/central audit pipeline. Add a DI test that builds the Central container and resolves the Secrets.Ui component dependencies (ISecretStore,ISecretCipher,ZB.MOM.WW.Audit.IAuditWriter) — this is the same defect class as the four caught in the secrets library: wiring visible only when the graph is actually built.Verification recipe
Local cluster (
bash docker/deploy.sh),DisableLoginoverride, then/admin/secretson:9001must render and "Add secret" must open the editor (Playwright check exists from the #483 sweep; OtOpcUa/HistorianGateway/MxGateway all pass it).