feat(historian): OPC UA HistoryUpdate in the node manager + HistoryUpdate authorization (T6)

- OtOpcUaNodeManager overrides HistoryUpdateData / HistoryDeleteRawModified / HistoryDeleteAtTime,
  block-bridging to the optional IHistorianDataUpdater under the shared HistoryRead batch limiter +
  deadline. Insert/Replace/Update map to HistoryUpdateMode; Remove, IsDeleteModified, events and
  structure data are BadHistoryOperationUnsupported. Per-item codes stitched back in request order
  (MinValue SourceTimestamp => BadInvalidTimestamp, untypeable value => BadTypeMismatch); success
  clears the base's pre-seeded Unsupported error.
- HistoryWrite AccessLevel bit OR-ed in for historized nodes when an updater is wired (raw + UNS);
  it is dispatch-load-bearing in the SDK base. OtOpcUaSdkServer.SetHistorianDataUpdater; the hosted
  service assigns it from an optional HistorianUpdaterHolder before SetSink, clears it on stop.
- AuthorizeHistoryUpdate: ACL on => scoped OpcUaOperation.HistoryUpdate decision (replaces the role
  check); ACL off => #563 key re-check + new OpcUaDataPlaneRoles.HistoryUpdate role, conferred by
  ApiKeyInterimRoleMapper only from a Cluster-scoped HistoryUpdate grant (WriteOperate does not).
- AdminUI ACL editor offers NodePermissions.HistoryUpdate.

Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
Joseph Doherty
2026-10-09 12:55:42 -04:00
parent ff7c6c531a
commit 2ef8ee3ade
10 changed files with 1065 additions and 11 deletions
@@ -28,4 +28,10 @@ public static class OpcUaDataPlaneRoles
/// <c>OnWriteValue</c> handler to route the value to the backing driver; absent it the
/// write is denied with <c>BadUserAccessDenied</c> before any driver call.</summary>
public const string WriteOperate = "WriteOperate";
/// <summary>The role that grants OPC UA HistoryUpdate authority (insert / replace / update / delete of
/// historized samples) while <c>Security:Acl:Enabled</c> is off. Conferred only by a Cluster-scoped grant
/// carrying <c>NodePermissions.HistoryUpdate</c>; <see cref="WriteOperate"/> does NOT confer it — writing
/// a live value and rewriting recorded history are different authorities.</summary>
public const string HistoryUpdate = "HistoryUpdate";
}