Merge fix/808-uns-folder-scope
This commit is contained in:
@@ -99,10 +99,37 @@ Two things to know before relying on any of this:
|
||||
closes the install-authority-then-rebuild window and a failed apply leaving a moved alarm on its old
|
||||
equipment. ⚠️ **Fail closed, even for Cluster grants:** an unbound / replaced / undeployed / line-less
|
||||
owner is denied under every grant (no realm-root fallback). Native alarms still use RawPath; ACL-off
|
||||
is unchanged. ⚠️ **Not end-to-end yet — #808:** UNS folders and scripted condition children still
|
||||
split opaque ids for Read/Browse/Subscribe/Server-object event visibility, so a narrow principal can't
|
||||
obtain the EventId Ack/Confirm/AddComment need (Shelve/Enable work). `ServerEventRig`'s folder id
|
||||
`EqA` == scope path `[uns, EqA]` hides this — tests must use opaque `UA-/UL-/EQ-` ids.
|
||||
is unchanged.
|
||||
- **Opaque-id UNS nodes are PLACED, never split, for every operation (#808).** UNS Area/Line/Equipment folders
|
||||
are minted under their entity ids (`s=UA-…/UL-…/EQ-…`), virtual tags under `s=EQ-…/Name`, scripted
|
||||
conditions + children under `s=<alarmId>[/…]`, while grants sit at NAME paths. `OtOpcUaNodeManager.Authorizer`'s
|
||||
setter attaches `ResolveUnsAclSubject` as `DataPlaneAuthorizer.UnsSubjectResolver` (one wiring, no second
|
||||
site), which reports LIVE facts (`UnsAclSubject`: folder id ancestry / owner binding); `Evaluate` places them
|
||||
against the CURRENT generation **before** the decision cache and caches only the walk, keyed on the resolved
|
||||
scope (`\0`-prefixed) — never on the NodeId, or a deny would stick past a rebuild. Folders use the generation's
|
||||
`UnsFolderScopes` (folderId → path + id chain, `DeploymentArtifact.BuildUnsFolderScopes`, same resolver as the
|
||||
grants; ids two kinds share are dropped) and **require live chain == generation chain** (moved equipment ⇒
|
||||
denied under old AND new line until the rebuild). Owned nodes (vtags, conditions, children) get
|
||||
`owner path + DataPlaneAuthorizer.OwnedNodeSegment` — only equipment-or-ancestor grants confer them, and a Tag
|
||||
grant's Browse transit can't enumerate them. Conditions share `TryPlaceScriptedCondition` with the #797 command
|
||||
gate, which ALSO requires the owner folder's live chain to match (review: else the new line could command a moved
|
||||
equipment's alarm while its folder is denied). Reference variables (`s=Area/Line/Equip/Name`) keep their split
|
||||
path (so Tag grants match) but only while it equals their live equipment folder's placement + one name — a
|
||||
moved/renamed equipment's old-name variables are denied (Read AND Write) under old and new names until
|
||||
re-pointed. An id NO live node holds (removed / probe / NodeDeleted `Affected`) is `Unknown`: placed at
|
||||
`[\0unknown]`, so only Cluster / Namespace-uns grants decide it and a removed opaque id can never split onto a
|
||||
same-named narrow grant — except a 4-segment (reference-shaped) id, which keeps its split. ⇒ narrow grantees do
|
||||
NOT receive NodeDeleted for removed UNS folders / vtags / conditions (by decision; they re-browse). Identifiers
|
||||
containing NUL are denied before the cache (resolved-scope keys are NUL-prefixed — a client could otherwise
|
||||
poison a real folder's cached verdict). ⚠️ The folder-owned rule keys on "first id segment == nearest slash-free
|
||||
live UNS folder ancestor's id", which can only narrow (an Area named exactly like its equipment's id loses that
|
||||
variable's Tag-grant match). ⚠️ `ConditionVisibilityScopes` returns the condition ALONE for a scripted condition,
|
||||
so a moved alarm can't reach its old owner via the Server object; direct per-folder event items still ride the
|
||||
SDK fan-out of the folder it hangs under (follow-up). A UNS node with NO live hierarchy-folder ancestor (rig-only
|
||||
shape) keeps the plain split. Unplaceable ⇒ denied for every grant incl. Cluster (a behaviour change for Cluster
|
||||
keys only in the stale window / corrupt topology). Tests: `UnsFolderScopeWireTests` (opaque ids, incl. one fed by
|
||||
`DeploymentArtifact.ParseDataPlaneAuthority`); rig tests (`ServerEventRig.FolderScopes()`, `EqA` ⇒ `[uns, EqA]`)
|
||||
install folder scopes explicitly — without them every UNS folder and scripted condition denies.
|
||||
- **Revocation reaches live subscriptions** (stage 6): every other operation re-asks per request, but a
|
||||
subscription is authorized once and then streams — and streaming is how machine consumers actually
|
||||
read this server. `DataPlaneAuthorityState.Changed` fires `RevalidateMonitoredItems`. ⚠️ A denied
|
||||
|
||||
Reference in New Issue
Block a user