Enforce NodeManagement authorization and rollback (OPC 10000-4/18)#4046
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Enforces OPC UA NodeManagement authorization semantics (role permissions + access restrictions) and adds rollback/compensation behavior when cross-NodeManager reciprocal reference mutations fail.
Changes:
- Adds/updates NodeManagement tests for authorization gating, access restrictions, local-vs-remote target handling, and rollback behavior.
- Updates
MasterNodeManagerNodeManagement dispatch paths to validate permissions/access restrictions and to compensate on inverse-mutation failures. - Updates NodeManagement documentation to describe the new routing, authorization, and rollback behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/Opc.Ua.Server.Tests/NodeManager/MasterNodeManagerNodeManagementTests.cs | Adds extensive authorization/access-restriction/rollback tests and a reusable authorization harness. |
| src/Opc.Ua.Server/NodeManager/MasterNodeManager.cs | Adds permission checks for AddNode/DeleteNode/AddReference/RemoveReference, local-target detection, and bounded compensation logic. |
| docs/NodeManagement.md | Documents updated routing rules, permission requirements, local-target rules, and compensation behavior. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4046 +/- ##
==========================================
- Coverage 73.94% 73.69% -0.26%
==========================================
Files 1347 1347
Lines 180826 181092 +266
Branches 31798 31825 +27
==========================================
- Hits 133719 133458 -261
- Misses 36343 36917 +574
+ Partials 10764 10717 -47
🚀 New features to boost your workflow:
|
…ix/node-management-authorization # Conflicts: # tests/Opc.Ua.Server.Tests/NodeManager/MasterNodeManagerNodeManagementTests.cs
Summary
AddNode,DeleteNode,AddReference, andRemoveReferenceauthorization before NodeManagement mutations.AccessRestrictions.targetServerUri, server-index, and namespace-URI targets.NodeClassfor cross-NodeManager mutations.Specification
This is split from #4021.
Tests
Focused Release validation passed on both
net10.0andnet48:dotnet build tests\Opc.Ua.Server.Tests\Opc.Ua.Server.Tests.csproj -c Release -f <TFM> -p:CustomTestTarget=<TFM>dotnet test tests\Opc.Ua.Server.Tests\Opc.Ua.Server.Tests.csproj -c Release -f <TFM> -p:CustomTestTarget=<TFM> --no-build --no-restore --filter FullyQualifiedName~Opc.Ua.Server.Tests.MasterNodeManagerNodeManagementTestsAddNodesDeniedAddNodePermissionDoesNotMutateAsync,AddNodesDeniedParentAddReferencePermissionDoesNotMutateAsync,DeleteNodesDeniedDeleteNodePermissionDoesNotMutateAsync,AddReferencesGrantedPermissionsMutateBothSidesAsync,AddReferencesTargetServerUriSkipsLocalTargetProcessingAsync,AddReferencesInverseFailureRollsBackSourceAsync,AddReferencesCancellationUsesIndependentRollbackToken,DeleteReferencesRemoteTargetSkipsReciprocalProcessingAsync,DeleteReferencesInverseFailureRestoresSourceAsync, andDeleteReferencesUnexpectedFailureRestoresSourceWithIndependentToken.