Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into ecc_support
Browse files Browse the repository at this point in the history
  • Loading branch information
mregen committed Aug 6, 2024
2 parents 88e1ac6 + 02761c7 commit c6b0cc3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Fuzzing/Encoders/Fuzz.Tests/Opc.Ua.Encoders.Fuzz.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="NUnit" Version="4.1.0" />
<PackageReference Include="NUnit.Console" Version="3.17.0" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0">
<PackageReference Include="NUnit.Console" Version="3.18.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
6 changes: 3 additions & 3 deletions Libraries/Opc.Ua.Server/Diagnostics/AuditEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1095,8 +1095,8 @@ public static void ReportCertificateUpdateRequestedAuditEvent(
"CertificateUpdateRequestedAuditEvent",
"en-US",
"CertificateUpdateRequestedAuditEvent.");



e.Initialize(
systemContext,
Expand Down Expand Up @@ -1374,7 +1374,7 @@ public static void ReportAuditCloseSecureChannelEvent(
}
if (exception is ServiceResultException sre)
{
statusCode = sre.InnerResult.StatusCode;
statusCode = sre.InnerResult?.StatusCode ?? StatusCodes.Uncertain;
}

ISystemContext systemContext = server.DefaultAuditContext;
Expand Down
12 changes: 8 additions & 4 deletions Libraries/Opc.Ua.Server/Diagnostics/DiagnosticsNodeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,8 @@ public void CreateServerDiagnostics(
if (array1 != null)
{
array1.OnSimpleReadValue = OnReadDiagnosticsArray;
// Hook the OnReadUserRolePermissions callback to control which user roles can access the services on this node
array1.OnReadUserRolePermissions = OnReadUserRolePermissions;
}

// set up handler for session security diagnostics array.
Expand All @@ -793,6 +795,8 @@ public void CreateServerDiagnostics(
if (array2 != null)
{
array2.OnSimpleReadValue = OnReadDiagnosticsArray;
// Hook the OnReadUserRolePermissions callback to control which user roles can access the services on this node
array2.OnReadUserRolePermissions = OnReadUserRolePermissions;
}

// set up handler for subscription security diagnostics array.
Expand Down Expand Up @@ -1406,20 +1410,20 @@ private ServiceResult OnReadUserRolePermissions(
NodeState node,
ref RolePermissionTypeCollection value)
{
bool admitUser;
bool adminUser;

if ((node.NodeId == VariableIds.Server_ServerDiagnostics_ServerDiagnosticsSummary) ||
(node.NodeId == VariableIds.Server_ServerDiagnostics_SubscriptionDiagnosticsArray))
{
admitUser = HasApplicationSecureAdminAccess(context);
adminUser = HasApplicationSecureAdminAccess(context);
}
else
{
admitUser = (node.NodeId == context.SessionId) ||
adminUser = (node.NodeId == context.SessionId) ||
HasApplicationSecureAdminAccess(context);
}

if (admitUser)
if (adminUser)
{
var rolePermissionTypes = from roleId in m_kWellKnownRoles
select new RolePermissionType() {
Expand Down
2 changes: 1 addition & 1 deletion Tests/Opc.Ua.PubSub.Tests/Opc.Ua.PubSub.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="NunitXml.TestLogger" Version="4.0.254" />
<PackageReference Include="NunitXml.TestLogger" Version="3.1.20" />
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
Expand Down

0 comments on commit c6b0cc3

Please sign in to comment.