feat(grpc-data): H2 origin HistoryRead ingress, header gating, LocalDataConnection history

Service: HistoryRead rpc; history (field 16, Metadata.history, bit 32) emitted only on a call whose header requested
history AND whose origin can serve it, otherwise stripped to the v1 shape; un-negotiated HistoryRead is
FAILED_PRECONDITION. Origin: Implemented(target) grows by HistoryRead when a historian backend is configured;
per-item gate catalog -> export grant + origin ACL HistoryRead -> tagname, every refusal the same
BadHistoryOperationUnsupported; per-principal admission (BadTooManyOperations), per-page ceiling, response-byte chunking
with single-use chunk tokens; one session per (principal, credential, HTTP/2 connection) cleared on close; wiring
faults BadInternalError + error log; caller cancel never a backend outcome. DataOperationPolicy maps HistoryRead.
This commit is contained in:
Joseph Doherty
2026-11-23 20:42:51 -05:00
parent b6895c19d4
commit e7cacd2ac9
10 changed files with 636 additions and 16 deletions
@@ -85,6 +85,8 @@ public sealed class DataOperationPolicy
OpcUaOperation.Read => DataOperations.Read,
OpcUaOperation.WriteOperate or OpcUaOperation.WriteTune or OpcUaOperation.WriteConfigure => DataOperations.Write,
OpcUaOperation.CreateMonitoredItems or OpcUaOperation.TransferSubscriptions => DataOperations.Subscribe,
// H2: a mapped HistoryRead needs the mapping's own HistoryRead bit (opened deliberately; H3 projects it).
OpcUaOperation.HistoryRead => DataOperations.HistoryRead,
_ => DataOperations.None,
};
return required != DataOperations.None && (subject.AllowedOperations & required) == required