docs(opcuaclient): keep server host-name check opt-in; surface it in the Security panel (#837)

Owner decision 2026-11-11: certificateValidation.validateServerHostName stays
opt-in (unset = off). The AdminUI toggle moves from the "Subscriptions, limits &
discovery" panel to the Security panel beside mode/policy, with help text on the
NAT/IP caveat, IPv6 zone ids and the loose first-label match. Binding unchanged
(tri-state, "Default (off)" leaves the key absent). OpcUaClient.md states the
decision; drivers rule updated; source-scan test pins placement + caveats.

Claude-Session: https://claude.ai/code/session_01GT67AD99zQQqpLCVm3p7xk
This commit is contained in:
Joseph Doherty
2026-11-11 11:57:59 -05:00
parent bdbc47f5fc
commit e6ec5a0948
4 changed files with 64 additions and 12 deletions
@@ -208,6 +208,34 @@ public sealed class OpcUaClientDriverPageFormSerializationTests
reparsed.CertificateValidation.EffectiveValidateServerHostName.ShouldBe(value ?? false);
}
/// <summary>
/// #837: the host-name check stays opt-in (unset = off) and sits in the Security panel with help text naming
/// the NAT/IP, IPv6-zone and loose-first-label caveats. Source scan (no bUnit in this repo).
/// </summary>
[Fact]
public void The_host_name_check_is_an_opt_in_in_the_security_panel_with_its_caveats()
{
var dir = new DirectoryInfo(AppContext.BaseDirectory);
while (dir is not null && !File.Exists(Path.Combine(dir.FullName, "ZB.MOM.WW.OtOpcUa.slnx")))
dir = dir.Parent;
dir.ShouldNotBeNull("could not locate the repository root");
var razor = File.ReadAllText(Path.Combine(dir!.FullName, "src", "Server", "ZB.MOM.WW.OtOpcUa.AdminUI",
"Components", "Shared", "Drivers", "Forms", "OpcUaClientDriverForm.razor"));
razor.ShouldContain("<option value=\"\">Default (off)</option>");
var security = razor.IndexOf("<div class=\"panel-head\">Security</div>", StringComparison.Ordinal);
var next = razor.IndexOf("<div class=\"panel-head\">", security + 1, StringComparison.Ordinal);
security.ShouldBeGreaterThan(-1);
var panel = razor[security..next];
panel.ShouldContain("_form.OpcUa.ValidateServerHostName");
panel.ShouldContain("Opt-in");
panel.ShouldContain("NAT");
panel.ShouldContain("IPv6 zone ids");
panel.ShouldContain("Loose match");
razor.Split("_form.OpcUa.ValidateServerHostName").Length.ShouldBe(2, "the toggle must be rendered once");
}
/// <summary>
/// #648: stored DriverConfig JSON from before <c>targetNamespaceKind</c>/<c>unsMappingTable</c> were removed
/// must still load into the form (the form's options use <c>UnmappedMemberHandling.Skip</c>) and the legacy