[GDS] Allow Global Discovery Server to Work with Custom Certificate Groups#3589
Conversation
|
|
…ation Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
|
@copilot dont allow custom Certificate types instead If the CertificateGroup.Id in the config does not math Default create a new one instead of choosing the Predefined ones |
…odes Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Done in a7c1eea.
The |
|
@copilot please add an integration Test that verifies a custom certificate group is read from configuration correctly and works in the address space |
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Done in 0176ba8. Added
Also fixed a bug discovered during the integration testing: |
| var customGroupNode = new Ua.CertificateGroupState(certGroupsFolder); | ||
| customGroupNode.Create( | ||
| SystemContext, | ||
| NodeId.Null, |
There was a problem hiding this comment.
@romanett Is it possible to define this in the config also? I do not entirely understand how to node id generation works but in my case I need an implementation of a custom group which is already defined on a server (Siemens device). So it would be best if I could just specify the NodeId of the group using the string representation in the config.
There was a problem hiding this comment.
This is Just the GDS Server (own Adress space)
Your PR is still needed, this is Just so your changes can be properly tested.
Or did i misunderstand you?
There was a problem hiding this comment.
I thought the GDS more or less mirrors the server's certificate groups for both pull and push management. So for instance when my server has a custom certificate group with id 200 with some custom namespace uri, the GDS also has that in the end. When I start CSR I would have sent the NodeId of the server to the GDS to specify which group handles the CSR and as far as I understood it the server then has a mapping for that nodeId to handle it (additionally to the default groups). Same for the trustlist: I ask the server which groups it has and then use that group ID to query the defined trust list from the GDS. Or is that wrong?
There was a problem hiding this comment.
Okay I found out why I had a wrong expectation. I thought that I could just pass the same certificate group id to both the server client and the gds client but they expect different ids. Does that mean that a push management instance need to know about the mappings in general?
There was a problem hiding this comment.
I will try to find out what the expectation is here. But hardocoding node ids in config seems wrong to me.
https://reference.opcfoundation.org/GDS/v105/docs/7.4#_Ref408341025
There was a problem hiding this comment.
Ahh I found it, i think with 1.05.6 the CreateEndpoint workflow was added:
https://reference.opcfoundation.org/GDS/v105/docs/7.7.5#_Ref195595671
The name of the new record can be any value which is unique within the configuration and the CertificateGroups Object on the ApplicationConfiguration instance. It is used to create the BrowseName for the new CertificateGroup Object.
The GDS
ApplicationsNodeManageronly supported exactly three certificate groups (Application, Https, UserToken) matched by well-known certificate types. Any additional group configuration threwNotImplementedException, making custom or extended group topologies impossible.Proposed changes
ApplicationsNodeManager.cs—SetCertificateGroupNodesCertificateGroupConfiguration.Id-based matching:"Default"or"DefaultApplicationGroup"→ assigns the existing DefaultApplicationGroup predefined node"DefaultHttpsGroup"→ assigns the existing DefaultHttpsGroup predefined node"DefaultUserTokenGroup"→ assigns the existing DefaultUserTokenGroup predefined nodeCertificateGroupStatenode under theCertificateGroupsfolder, wiring up theTrustListhandle via the existing post-branch setupNodeId.Nullis passed toCreate(..., assignNodeIds: true)so the framework generates a fresh NodeId for the node;certificateGroup.Idis then read back fromcustomGroupNode.NodeIdafterCreatereturns, ensuring the key inm_certificateGroupsmatches the actual node in the address space.RsaSha256ApplicationCertificateType).GlobalDiscoveryTestServer.cs/Common.csadditionalCertGroupsparameter toStartServerAsyncandTestUtils.StartGDSAsyncto inject custom certificate group configurations into the loaded server config for integration testing.CustomCertificateGroupIntegrationTest.cs(new)CustomCertificateGroupAppearsInGetCertificateGroupsAsync: starts a GDS server with a"MyCustomGroup"certificate group, connects as admin, registers an application, and verifiesGetCertificateGroupsAsyncreturns 2 groups with a workingGetTrustListAsyncfor each.CustomCertificateGroupNodeExistsInAddressSpaceAsync: additionally reads the custom group node from the server address space viaReadNodeAsyncand asserts itsBrowseNameequals"MyCustomGroup".CertificateGroupTests.csNotImplementedException.Example config for a custom group
Related Issues
Types of changes
Checklist
Further comments
The custom node is created using
CertificateGroupState.Create(SystemContext, NodeId.Null, browseName, displayName, assignNodeIds: true)so the framework assigns fresh NodeIds to the root node and all child nodes (includingTrustList).certificateGroup.Idis set fromcustomGroupNode.NodeIdafterCreatereturns, ensuring the dictionary key used byGetCertificateGroupsAsyncmatches the actual node registered inPredefinedNodes. TheTrustListhandle is set by the existing code path at the end ofSetCertificateGroupNodes, requiring no duplication.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.