docs(opcuaclient): document the shared endpoint-URL rewrite and how to run the NAT tests (#814)

docs/drivers/OpcUaClient.md, docs/plans/2026-05-28-driver-browsers-design.md and
docs/Client.CLI.md: one OpcUaEndpointUrlRewriter for driver, AdminUI browser and
Client CLI/UI; configured host+port win, advertised path kept for opc.tcp; policy/mode
selection and certificate validation unchanged; NAT test recipe against the #813 fixture.
This commit is contained in:
Joseph Doherty
2026-11-10 22:53:01 -05:00
parent ac1b33555a
commit 88c05cc01a
3 changed files with 77 additions and 7 deletions
@@ -142,6 +142,15 @@ Razor picker body BrowserSessionService IDriverBrowser
- Builds a **separate** `ApplicationConfiguration` from the runtime driver — PKI root at `%LocalAppData%/OtOpcUa/adminui-browse-pki/` (separate cert store)
- `ApplicationName = "OtOpcUa AdminUI Browse"`, `ApplicationUri = "urn:OtOpcUa:AdminUI:Browse"`
- Endpoint selection: same `DiscoveryClient.GetEndpointsAsync` → filter `(policy, mode)` as the runtime driver
— literally the same code since #806: `OpcUaEndpointSelection.SelectMatching` (`Driver.OpcUaClient.Session`), which
then rewrites the chosen endpoint's URL through the shared `OpcUaEndpointUrlRewriter` (`Driver.OpcUaClient.Contracts`;
also used by the Client CLI/UI since #812). For `opc.tcp`, the **operator-configured host and port** replace the
advertised ones and the **advertised path is kept** (a port-less configured URL keeps the advertised port; a different
scheme is left alone). Before #806 the browser dialled the advertised URL verbatim, so behind NAT / a container port
publish it failed DNS on the server's private hostname where the deployed driver connected fine.
Only the address changes: policy + mode selection, the advertised server certificate and user-token policies, and
certificate validation against the browse PKI are exactly as before. Full rule: `docs/drivers/OpcUaClient.md`
§"Endpoint address".
- One endpoint only (no failover) — interactive use; user retries with different URL on failure
- Bounded by `OpcUaClientDriverOptions.PerEndpointConnectTimeout` (clamped [5, 30]s)
@@ -265,6 +274,14 @@ Razor picker body BrowserSessionService IDriverBrowser
### Integration tests (opt-in, fixture-gated)
- `tests/Drivers/.../OpcUaClient.Browser.IntegrationTests/`: end-to-end against opc-plc, 3-level expand + round-trip resolve. Skipped unless `OPCUA_SIM_ENDPOINT` set
- Same project, `NatPublishedEndpointBrowseTests` (`Fixture=opc-plc-nat`, #806): browse through a port NAT — an opc-plc
advertising a private `.invalid` host and an internal port different from the published one. Skipped unless
`OPCUA_NAT_ENDPOINT` is set; the shared-host fixture (#813) is `opc.tcp://10.100.0.35:50010`
(`ssh dohertj2@10.100.0.35 'cd /opt/otopcua-opcuaclient-nat && docker compose up -d'`, compose in
`tests/.../Driver.OpcUaClient.IntegrationTests/Docker/nat/`), and CI starts a throwaway copy. Run:
`OPCUA_NAT_ENDPOINT=opc.tcp://10.100.0.35:50010 dotnet test tests/Drivers/ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.Browser.IntegrationTests --filter Fixture=opc-plc-nat`.
The secure case asserts a certificate refusal unless the fixture cert is trusted in the browse PKI and
`OPCUA_NAT_SERVER_CERT_TRUSTED=1` (see `docs/drivers/OpcUaClient.md`).
- No Galaxy integration suite in v1 (requires wonder-app-vd03; deferred)
### Specific regression tests