docs(grpc-data): A4 docs — feature negotiation, imported conditions end to end, method status table, limits, security, ScadaBridge impact

DataConnections.md: x-otopcua-data-features negotiation; condition forwarding (key secret, bits 64/128/256, AllowGalaxyServiceAck,
methods + status codes, limits/defaults, troubleshooting); corrects the A2a 'deploy adds/removes arrive as deltas' claim (a deploy
ends the stream). AlarmTracking.md: Imported conditions. ScriptedAlarms.md: known after the first completed evaluation; what
forwards. security.md: imported-condition gate, per-caller method re-check, service principal, on_behalf_of, audit category.
Evidence A4-docs.md: plan-vs-code disagreements, TODO markers for the A4 code merge, ScadaBridge consumer impact.
This commit is contained in:
Joseph Doherty
2026-11-24 22:58:23 -05:00
parent 9143804987
commit 916c14eca1
5 changed files with 553 additions and 17 deletions
+56 -4
View File
@@ -223,10 +223,62 @@ Read/browse/subscription admission and final value delivery retain current autho
metadata alone does not confer write-through, and secondary/read-replica access never confers writes.
The flag-off descriptions below concern locally owned nodes. They are not a bypass for gRPC export
or mapped nodes. Remote projected branches cannot be re-exported as locally owned data, and remote
history, alarm/event and relay operations are not part of this contract. Authorized imported current
values can feed local derived engines. See [Data connections](DataConnections.md) and
[Read/write operations](ReadWriteOperations.md).
or mapped nodes. Remote projected branches cannot be re-exported as locally owned data. Remote
history (HistoryRead) and condition forwarding (Acknowledge, AddComment, Confirm) are part of the
contract since H2/A3, behind the per-call feature negotiation. Relay operations are not. Authorized
imported current values can feed local derived engines. See [Data connections](DataConnections.md)
and [Read/write operations](ReadWriteOperations.md).
### Imported conditions over data connections
**The gate is independent of `Security:Acl:Enabled`.** An imported condition, and the projected folders that are its
notifiers, are mapped nodes, so the mapping gate always applies, flag on or off. Ids in the
`https://zb.com/otopcua/mapped/conditions` namespace are classified **before** `RealmOf` at every authorizer entry point:
read, browse, subscribe, history, call and alarm commands. An opaque `c1.` id therefore never falls back to a local
Raw/UNS path grant. A guard test pins this.
| Operation (consumer) | Requires, for the local caller |
|---|---|
| Browse / Read the condition and its children; event items; each delivered event; ConditionRefresh replay | `Subscribe` on a placement folder's scope (not `AlarmRead`), on a current mapping of the placement's realm that grants `AlarmSubscribe` |
| Acknowledge / AddComment | `AlarmAcknowledge` on a placement folder's scope, plus the mapping's bit 128 |
| Confirm | `AlarmConfirm` on a placement folder's scope, plus the mapping's bit 256 |
| HistoryRead, Write, Shelve, Enable/Disable | refused |
- **Visibility is re-checked per item and per event.** That covers the Server object (`i=2253`), each folder hop (the folder
must also be currently wired), the refresh replay and again at Publish/Republish. A queued event whose gate fails at
publish is dropped.
- Verdicts are cached per (identity, condition, authority generation, placement version). A positive verdict lives at
most 5 s, or until the credential expires.
- The authority generation folds in the mapping set and each mapping's `IsActive`.
- A3-SEC (ACLs off, a session with no mapping grant at `i=2253`) receives zero imported events, live or on refresh.
- **Methods re-check the local caller on every call** (`ProjectedConditionAccess.AuthorizeMethod` → `DataOperationPolicy.AuthorizeLocal`).
The check includes the caller's key usability (#563) and is made regardless of the ACL flag. The first placement, in
primary order, on which the caller passes is the one dispatched through. A caller refused locally is
`BadUserAccessDenied` and **nothing is sent**.
- The method gate does not separately require visibility through that placement. The 128-bit EventId, minted per consumer
and delivered only to items that see the condition, is the practical visibility requirement (A3b review N9).
- Identical in-flight calls join only within one principal.
- **The stream runs under the connection's service principal**, not the client's.
- The origin admits a condition item for that principal when its export grants `AlarmSubscribe` and the principal has
the origin ACL `Subscribe` on each placement's scope. A UNS-only principal's records carry no RawPath.
- A remote method is authorized at the origin against the export bit, the origin ACL on the placement's subject, the
key's usability and, for Galaxy conditions, `AllowGalaxyServiceAck`.
- The origin's `ClientUserId` and the `AlarmCommand.User` are the service principal only. They are never concatenated with
remote text. `AlarmCommand` was deliberately not extended, because it crosses the mesh.
- A grant, catalog or key revocation ends the stream. Authorization happens at call start (one synchronous hop before
apply), the same bound as a local call. Primary/Warm-standby status is re-checked under the origin's `Lock`.
- **`on_behalf_of` and the audit log.** The consumer sends the local caller's principal as `on_behalf_of`.
- The origin treats it as untrusted text. It strips control and format characters, caps it at 128 characters, and writes
it **only** to the data-connection audit log.
- Every remote condition-method call is audited whatever its end (applied, refused, joined, unknown). The entry carries
method, principal, API key id, placement realm/namespace/identifier, operation id, outcome state and status, joined
flag and on-behalf-of.
- The log is the dedicated logger category **`ZB.MOM.WW.OtOpcUa.DataConnections.Audit`**, so operators can route it to
its own sink. Every caller-supplied field is re-sanitised there and capped at 512 characters, so log text cannot
receive injected CR/LF.
- Remote audit text is not surfaced in alarm history.
- **`DataConnections:ConditionKeySecret`** is a secret: `${secret:}` or the environment variable, never committed. A weak
value fails startup without echoing it.
## OPC UA Authentication