1029 Commits

Author SHA1 Message Date
romanett c19e83b63d Refactor MonitoredItem.ValueChanged & cert validation (#3592)
Refactored MonitoredItem.ValueChanged for correctness, performance, and comprehensive test coverage, including improved deadband and array handling. Rewrote equality logic for Variants and arrays. Made certificate validation thread-safe using ConcurrentDictionary and proper semaphore usage. Added extensive unit tests and benchmarks for value change detection.
2026-03-04 20:22:28 +01:00
Copilot 588b7e9237 [Server] Implement event-driven RolePermissionsValidation caching in MonitoredNode2 (#3583)
* Initial plan

* Implement event-driven RolePermissionsValidation with permission caching in MonitoredNode2

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Add DefaultPermissionsChanged event to IConfigurationNodeManager to handle namespace-level default permission changes

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Add test & make validation functional

* cover case when DefaultRolePermissions are aded after the node exists

* cleanup

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Co-authored-by: Roman Ettlinger <romanett98@gmail.com>
2026-02-28 07:44:19 +01:00
romanett 0a4c87cef8 [Server] Implement smaller Performance improvements found when profiling (#3584)
* Add namespace index lookup for NamespaceMetadataState

Added GetNamespaceMetadataState(ushort) to ConfigurationNodeManager and interface for efficient lookup by namespace index. Switched to ConcurrentDictionary for thread safety. Updated AsyncCustomNodeManager to use index-based lookup. Cleared index cache in Clear method.

* Refactor Variant and ServiceResult handling for speed

- Use WrappedValue assignment for DataValue in MonitoredNode and NodeState to align with updated Variant usage.
- Return ServiceResult objects instead of raw StatusCodes for bad attribute IDs.
- Update ServiceResult exception handling: include stack trace only in DEBUG, message only in release.
- Optimize StatusCode to ServiceResult conversion by returning static Good/Bad instances.

* Add Read Limited load test

* Optimize MonitoredItem.IsReadToPublish

* Add Subscription unit tests and improve triggering logic

Added SubscriptionTests to verify PublishTimerExpired behavior, including timer expiry, monitored item readiness, keep-alive, and triggering scenarios. Updated Subscription.cs only process triggering if triggered items are configured, improving correctness and efficiency.

* CR feedback
2026-02-28 07:43:51 +01:00
romanett a0e1e9f42e [Server] Optimize NodeState.ReadAttributes & base ReferenceNodeManager on AsyncCustomNodeManager (#3574)
* Use Interfaces Introduced with 1.5.378

Refactor to use interfaces for node managers and server

Replaced concrete types with interfaces (e.g., IMasterNodeManager, ICoreNodeManager, IDiagnosticsNodeManager, IConfigurationNodeManager, IServerBase) across method signatures, properties, and internal structures to improve abstraction and flexibility.

* Refactor CoreNodeManager to be Based on CustomNodeManager2

* Add Test

* Add INodeManager3 with role permission validation

Introduce INodeManager3 interface extending INodeManager2, adding synchronous role permission validation methods. Update all node manager interfaces and classes to use INodeManager3. Extend IAsyncNodeManager with async permission validation methods and update adapters for sync/async bridging. Deprecate FindNodeInAddressSpace in favor of new async FindNodeInAddressSpaceAsync. Refactor MonitoredNode2 to use thread-safe collections and locking for monitored items. Enhance event reporting with security and permission checks. Update constructors and documentation to reflect new interfaces and best practices.

* Implement AsyncCustomNodeManager

* fix comment

* fix

* Add tests

* fix

* Implement better locking strategy

* fix

* Add more tests

* Add tests

* Add tests

* Add Tests

* cleanup

* cleanup

* Add tests that verifies for AnalogItemState the instrument range is checked brefore writing

* only assign new NodeID in default factory if NodeId isNull

* Run all tests also with sampling groups

* Add Docs

* cleanup

* Add chaos test

* fix test

* Use AsyncCustomNodeManager for ReferenceNodeManger & imrpove ReadAttributes method of NodeState

* fixes

* fixes and code review comments
2026-02-24 17:07:50 +02:00
Rico Suter 63a77a2a2a Fix memory leaks in server disposal (#3560) 2026-02-17 07:40:26 +01:00
Rico Suter 47877a22ea Fix TcpTransportListener resource leak in ServerBase.StopAsync (#3561)
ServerBase.StopAsync() calls Close() on each transport listener then
Clear() on the list. ServerBase.Dispose() later iterates
TransportListeners to call Dispose() on each — but the list is already
empty, so TcpTransportListener.Dispose() never runs.

Add Utils.SilentDispose() after Close() in StopAsync to ensure
TcpTransportListener.Dispose() executes before the list is cleared.
2026-02-17 06:30:05 +01:00
KircMax 42addbb5f7 Add possibility for Sub-CA to be revoked, Removed auto-creation of empty crl for revokecertificate call with CA (#3547)
* add revoke sub ca possible ->

* cert group tests

* fix revoking for sub-cas

* do not use bouncycastle
add test for Test_Root_CA_throws_Exception + throw if applicable
use LoadCrlCreateEmptyIfNonExistantAsync

* remove allowance for initialcrl to be null

* unify with first check for self-signed certificate

* warning -> use StringComparison.Ordinal
2026-02-17 06:27:10 +01:00
Marc Schier 601cabf86f Replace all use of object in code and API with Variant (#3550) 2026-02-15 06:19:38 +01:00
Marc Schier f66ceffd75 Immutable built in types and code generation (#3534)
Generate stack and application code using source generators
Change built in types to readonly structs
  Update localized text implementation to use JSON text serializer
  Status code with symbolic names
  Immutable node ids
  No boxing for all built in types <= 8 bytes in Variant.
Split user identity token and token handling via token handler
Add migration guide for breaking changes
2026-02-12 16:27:07 +01:00
raserle 029a8fbaa6 [Server] Fix generation of UserTokenPolicyIDs (#3525)
* add Equals, change id generation

* add equality operators and gethashcode

* add override Equals

* Copilot issues

* fix TranslateEndpointDescriptionsTest, that relied on ServerUnique UserTokenPolicy Ids

---------

Co-authored-by: Roman Ettlinger <romanett98@gmail.com>
2026-02-11 13:36:28 +01:00
KircMax 39ac3f665a add throwing serviceresultexception with stacktrace (#3539) 2026-02-10 13:48:24 +01:00
KircMax f77e96ea97 add FindIssuerCAByKeyIdentifierAsync (#3535)
* add FindIssuerCAByKeyIdentifierAsync

* remove unnecessary using for Org.BouncyCastle.Asn1.X9
2026-02-10 13:20:43 +01:00
Marc Schier 43ce7ed229 Code clean up and improvements (#3532)
This pull request modernizes the OPC UA .NET codebase and tests, removes .NET Standard 2.0 support from certificate/security code, and updates test code to use C# 12 and .NET 8+ features for clarity and maintainability.
- Certificate and BouncyCastle interop files (e.g., CertificateBuilder.cs, X509Extensions.cs, X509SignatureFactory.cs) are refactored to drop NETSTANDARD2_0 support and use modern .NET APIs and conditional compilation.
- Test code across the codebase is updated to use default, strongly-typed Parse methods, collection expressions, and improved async/await patterns.
- Exception handling and assertions in tests are modernized, and test method naming is made consistent with Async suffixes.
- The project and build files are updated to clarify Roslynator analyzer usage and remove obsolete netstandard tags.
- General code and test cleanup includes improved null safety, type safety, and removal of deprecated or unused code.
2026-02-09 13:37:06 +01:00
Marc Schier bafd63db5a Hook lookup of symbol in types project and set hook in opc ua core on assembly loading (#3520)
* Hook lookup of symbol in types project and set hook in opc ua core on assembly loading

* Use module initializer instead of static constructor
2026-02-06 17:10:26 +01:00
Robert Richter 6d539c9e92 fix minor xml docs copy error (#3518) 2026-02-06 11:49:10 +01:00
romanett 6eca246166 Improve logging and fix UserNameIdentityToken to return BadIdentityTokenInvalid for failed verification (#3514)
* Improve  logging and fix UserNameIdentityToken to return BadIdentityTokenInvalid for failed verification

Refactor DataChangeQueueHandler to return overflow status from QueueValue and Enqueue, updating MonitoredItem to log overflows accurately. Update IDataChangeQueueHandler interface accordingly. Enhance ConsoleTelemetry logger configuration management and ensure proper disposal of old logger factories.
Change UserNameIdentityToken password/nonce failure to return BadIdentityTokenInvalid for more precise error reporting. To prevent the leakage of information useful to attackers, Servers shall ensure that the process of validating UserIdentityTokens completes in a fixed interval independent of whether an error occurs or not. The process of validation includes decrypting, check for padding and checking for a valid nonce. If any errors occur the return code is Bad_IdentityTokenInvalid.

* fix GDS ApplicationNames to include the Locale

* fix ctt testcase by allowing faster sampling for XmlNodeNode
2026-02-05 11:57:12 +01:00
romanett 6765151a00 Fix EndpointIncomingRequest to do serviceLookup at invocation time instead of construction. This makes the object smaller and fixes a bug where the transport channel response was not sent due to unhandled exception (#3505) 2026-01-27 07:42:01 +01:00
Copilot 9f335c39d8 Change DebugCheck conditional compilation from DEBUG to CHECKED (#3496)
* Initial plan

* Change [Conditional("DEBUG")] to [Conditional("CHECKED")] in DebugCheck methods

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
2026-01-24 05:42:59 +01:00
Copilot e314cf53f7 Fix SourceTimestamp for variables without explicit timestamps in BaseVariableState (#3451)
* Initial plan

* Add OnReadValue callback to update timestamps on variable reads

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Add test to verify timestamp updates on variable reads

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* fix timestamp for scalar values

set loglevel in session publish when no subscriptions

ignore more keepalive errors in Client Fixture

* Fix timestamp updates for all variables (scalars and arrays)

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* create a proper fix

* Add Order parameter to test to check the timestamp before an explicit write was done

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Co-authored-by: Roman Ettlinger <romanett98@gmail.com>
2026-01-19 15:18:28 +01:00
Marc Schier 288f02f20a Allow status code variant creation from uint (#3472)
* Allow status code variant creation from uint

* Initial plan

* Add comprehensive tests for StatusCode variant creation from uint

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

* Remove redundant assertions in StatusCode variant tests

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
2026-01-14 06:12:00 +01:00
romanett f7c3c4e18f Fix Server/ServerStatus/State SourceTimestamp. Fix Reference Server config, not loading OperationLimits due to wrong order. (#3454)
* fix ServerSourceTimestamp

* fix OperationLimits not being set for ReferenceServer
2026-01-12 13:09:15 +01:00
wxmayifei 6ab1bf7a5d fix format string (#3441) 2026-01-08 21:16:37 +09:00
romanett 5c80f9bc5a [Client & Server] Remove all usages of SoftwareCertificates (#3443)
* remove all usages of SoftwareCertificates
- Client
- Server

As per spec they are not relevant for security.
If an SDK User wants to use the SoftwareCertificates ActivateSession can be overriden

* remove from SessionClientBatchTests
2026-01-08 21:12:07 +09:00
Suciu Mircea Adrian d7da70b81e Refactor ApplicationConfiguration serialization for deprecated/modern settings and add tests for configuration behavior (#3415)
* Refactor ApplicationConfiguration serialization for deprecated settings and add tests for configuration behavior

* Update ApplicationConfiguration to prefer modern elements in "hybrid" configurations and add corresponding tests

* Fix GDS Tests on netstandard2.1 custom test target

* Add Test reading file containing ApplicationCertificate and ApplicationCertificates ensuring it is not marked legacy.

* Add legacy config test with only one ApplicationCertificate

---------

Co-authored-by: Roman Ettlinger <romanett98@gmail.com>
2025-12-17 14:08:08 +02:00
opcfoundation-org 75f2a6ac6a Add OPCUA_EXCLUDE_AccessLevelExType to Opc.Ua.Core.csproj (#3421)
Co-authored-by: Randy Armstrong <randy@sparhawksoftware.com>
2025-12-17 01:19:09 -08:00
Copilot 7c684f4f87 Fix client returning BadUserAccessDenied when SecurityPolicy or SecurityMode not matching (#3270)
* Initial plan

* Fix BadUserAccessDenied when SecurityPolicy/SecurityMode not matching

Modified MatchEndpoints method to throw appropriate exceptions:
- BadSecurityPolicyRejected when requested policy is not supported
- BadSecurityModeRejected when requested mode is not supported
- Maintains backward compatibility when no specific security settings requested

Added comprehensive tests to verify the fix.

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Improve code readability with extracted boolean variables

Applied code review feedback to extract parameter validation checks
into separate boolean variables for better readability.

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Add integration test for unsupported security policy

Added ConnectWithUnsupportedSecurityPolicyAsync test that:
- Uses ClientFixture to connect to test server
- Requests a security policy not supported by server
- Verifies BadSecurityPolicyRejected is thrown instead of BadUserAccessDenied
- Tests run successfully on net8.0 and net9.0 targets

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Add policy that will never work

* ignore faulty test

* update

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Co-authored-by: Roman Ettlinger <romanett98@gmail.com>
2025-12-12 11:50:25 +02:00
romanett 1e6a043597 Fix MinNonceLength for SecurityPolicies.Basic128Rsa15 (#3410) 2025-12-12 10:38:50 +02:00
Copilot ae03267fbd Add optional parent-child linking when importing NodeSet2.xml (#3396)
* Initial plan

* Fix parent-child references when importing NodeSet2.xml

- Added LinkParentChildRelationships method to establish parent-child links after import
- Sets Parent property and adds child to parent's children collection
- Added test to verify parent-child references work correctly after import
- All existing tests continue to pass

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Make parent-child linking optional with default false

- Added linkParentChild parameter to Import method (defaults to false)
- Maintains backward compatibility by not establishing parent-child relationships by default
- Added test to verify backward compatibility (default behavior)
- Updated ParentChildReferencesTest to explicitly enable the feature
- All 7 tests pass

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
2025-12-09 21:24:41 +01:00
Copilot dc85d522a6 Add support for private encodeable factory in server initialization (#3366)
* Initial plan

* Add support for private encodeable factory in server initialization

- Add new ServiceMessageContext constructor that accepts a custom IEncodeableFactory
- Add CreateMessageContext(IEncodeableFactory) overload to ApplicationConfiguration
- Mark CreateMessageContext(bool) as obsolete since the clonedFactory parameter was never used
- Add PrivateEncodeableFactory property to ServerBase for specifying a private factory
- Update all internal calls to use the new parameterless CreateMessageContext()

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Add unit tests for ServiceMessageContext private factory support

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Improve documentation for ServiceMessageContext constructors

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
2025-12-05 14:20:50 +01:00
Copilot 7cd5ae34ec Fix ExtractValueFromVariant method call condition (#3382)
* Initial plan

* Changes before error encountered

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Fix ExtractValueFromVariant condition and add comprehensive tests

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
2025-12-05 08:32:47 +01:00
Copilot 74c3cb08d4 Fix: State helper methods now update timestamps and clear change masks (#3371)
* Initial plan

* Fix: Add timestamp updates and ClearChangeMasks calls to State helper methods

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Add tests for State helper method timestamp and change mask updates

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Improve test reliability by removing Thread.Sleep

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Resolve merge conflict with master by incorporating EvaluateRetainStateOnEnable method

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

* rename for merge

* merge update

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
Co-authored-by: Roman Ettlinger <romanett98@gmail.com>
2025-12-05 06:35:11 +01:00
Copilot 3f660af97d Fix BaseVariableState to return correct BuiltInType for Byte arrays vs ByteString (#3384)
* Initial plan

* Fix ByteString vs Byte array distinction in WrappedValue

Modified BaseVariableState.WrappedValue to use DataType and ValueRank
when creating Variant to correctly distinguish between byte[] (Byte array)
and ByteString. Added tests to verify the fix.

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Address code review feedback

- Remove redundant null check for NodeId (NodeId.IsNull handles null)
- Update comment in test to be more specific about ByteString testing

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
2025-12-04 20:13:01 +01:00
Marc Schier 2960388560 Update headers and license files (#3388)
Update license headers to copy right year 2025, replace RCL/GPL headers with MIT, replace the nuget license with MIT (via license expression).
2025-12-04 19:44:40 +01:00
Copilot b8ed3cc782 Fix BaseEventState.MemberwiseClone() to pass Parent to Activator.CreateInstance (#3361)
* Fix BaseEventState.MemberwiseClone() to pass Parent to Activator.CreateInstance

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
2025-12-04 15:34:51 +01:00
Copilot 30f4fa26ab Include failed value in XmlDecoder error messages (#3374)
* Initial plan

* Add enhanced error messages for XML decoding failures

- Updated CreateBadDecodingError to optionally include failed value
- Modified SafeXmlConvert to pass XML value to error handler
- Updated ReadFloat, ReadDouble, ReadDateTime, ReadGuid, ReadNodeId, ReadExpandedNodeId, and ReadEnumerated to include values in error messages
- Added comprehensive tests to validate enhanced error messages

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Fix parameter order consistency in SafeXmlConvert

Use named parameter for value argument to maintain consistency with other calls

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

* Use named parameters consistently in SafeXmlConvert

Use named parameters for both functionName and value for better code clarity

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
2025-12-04 15:33:40 +01:00
Rico Suter 0e8273e729 performance: Reduce allocations (logger factory reuse, check enabled) (#3387)
* Performance: Reduce memory allocations (logging, etc.)
2025-12-04 15:30:28 +01:00
Copilot 064c1516e2 Remove hardcoded Retain=true in ConditionState.UpdateStateAfterEnable (#3370)
* Initial plan

* Add EvaluateRetainStateOnEnable virtual method for ConditionState

- Removed hardcoded `Retain.Value = true` in UpdateStateAfterEnable
- Added virtual EvaluateRetainStateOnEnable method that derived classes can override
- Default implementation calls UpdateRetainState() which uses GetRetainState()
- This allows concrete classes to customize Retain evaluation when enabling conditions
- Added comprehensive tests for the new functionality
- All existing tests pass (7846 tests)

Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: romanett <7413710+romanett@users.noreply.github.com>
2025-12-03 19:42:15 +01:00
romanett 4459e70d98 [Server] Make EndpointIncomingRequest a ReadonlyStruct & pool ValueTaks (#3363)
* Make EndpointIncomingRequest a readonly struct
* Switch to ValueTask & pool ValueTasks using ValueTaskSource
2025-12-02 09:57:28 +01:00
Copilot f31d37ba52 Fix GetDataTypeId to return specific DataTypeId for IEncodeable types (#3353)
Modified TypeInfo.GetDataTypeId(Type) to check if IEncodeable types have a specific TypeId and return it instead of the generic Structure (i=22) DataTypeId. Added comprehensive tests for EUInformation and other well-known IEncodeable types.

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

* Simplify GetDataTypeId fix based on code review feedback

Removed unnecessary static property check and simplified the instance creation logic. Caught specific exceptions (MissingMethodException, TargetInvocationException) instead of using bare catch.

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

* Add additional exception handling for GetDataTypeId

Added handling for MethodAccessException and NotSupportedException to provide more comprehensive error handling when creating instances via Activator.CreateInstance.

Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com>
2025-12-01 07:43:20 +01:00
Suciu Mircea Adrian 03d5d691e5 Normalize distinguished name field abbreviations for platform compatibility of attribute State/ProvinceName (#3358)
* Normalize distinguished name field abbreviations for platform compatibility of attribute State/ProvinceName

* Fix warning ca1845

* netstandard2.1 doesn’t support string.Concat with spans.
2025-11-27 09:38:11 +02:00
romanett e63a7ccaff [Server] Make SubscriptionManagement Methods Async & Fix Publishing of GoodSubscriptionTransferred Message (#3350) 2025-11-21 16:15:56 +01:00
opcfoundation-org a2e3fc8157 Update Generated Files with latest 1.5.6. (#3344)
Co-authored-by: Randy Armstrong <randy@sparhawksoftware.com>
2025-11-16 14:56:12 +01:00
romanett 0e4b4619c8 Obsolete Sync Certificate Validator Methods (#3338)
* Obsolete Sync Certificate Validator Methods

* Update Tests

* Use HttpClientHandler directly instead of relying on reflection
2025-11-15 07:04:58 +01:00
romanett e58b759488 [Server] Pass SecureChannelContext explicitly (#3340)
* Pass SecureChannelContext explicitly in the Server Library
2025-11-14 12:00:19 +01:00
romanett 0d78fbf6f6 [Server] Obsolete APM & Sync Methods (#3334)
* Add new Generated files with NET_STANDARD_OBSOLETE_SYNC_SERVER
* Obsolete ProcessRequestAsyncResult
* Activate NET_STANDARD_OBSOLETE_SYNC_SERVER & remove StandardServerSync Methods
* Remove sync calls
2025-11-13 10:46:21 +01:00
Marc Schier 35db52a7a6 Move from .net 9 to .net 10 SDK and build new target framework .net 10 (#3333) 2025-11-13 10:45:47 +01:00
romanett d25caffb03 [Server] ActivateSessionAsync / CreateSessionAsync / FindServersAsync / GetEndpointsAsync / CloseSessionAsync (#3225)
Co-authored-by: Marc Schier <marcschier@users.noreply.github.com>
2025-11-11 21:06:17 +01:00
Marc Schier 8b2f5299b1 Fix strong name signing and IVT (#3331)
* Fix IVT with sn signing and clean up unused constants.
* Update signlists
2025-11-11 13:29:37 +01:00
Marc Schier 712e770fbe Restructure core and built in types into base assembly and nuget (#3326)
This change adds a **new Opc.Ua.Types** nuget that contains core types that do not rely on generated code.  Why the name?  Because almost all code that was in the Types subfolder is part of it, and because we do not want to change the name of the Opc.Ua.Core nuget/assembly because code relies on it.  Any other name like base or bootstrap felt out of place due to the current structure already defining the name "types".  Key design is to depend on only a small set of libraries with limited transitive dependencies, that includes hashcode, logging.abstraction, and for non standard20 builds System.Text.Json (needed for localizedText mul parsing).  Also, key is to support .netstd 2.0 to support source generators and to allow removal of EEC_SUPPORT defines by removing std2.0 from core and all libraries.

The changes are mostly restructuring, and thus small but contain some key changes:

- **Status code** struct now comes with a Symbol field, which is used to carry symbols in case the code is not generated.  Currently (until generated) the status code struct must be manually created with a symbol or the ToSymbolicId extension must be called in the core project.  Future will generate Status code constants just like NodeId that contain the symbol which also removes the reflection-based lookup.  Several tests needed to be adjusted as they checked the status code symbol strings instead of the code.
- **Core identifiers** are copied as they were needed for code to compile, that includes attributes, a subset of status codes and node identifiers.  These will never change so no need to generate them.
- The types folder now contains **encoders**, except for json which is still in core.  Once the json encoder is ported to system.text.json it will also be included and Newtonsoft.Json dropped as dependency (-> #3329).  
- Since types relies on **IOperationContext** and **ISystemContext**, and these export IUserIdentity which relies on crypto, these were split and extended in core with ISessionOperationContext and ISessionSystemContext, which mean changes to ServerSystemContext and introduction of SessionOperationContext and SessionSystemContext classes that extend OperationContext and SystemContext.  Some runtime checks in the server are therefore needed to get at the session and auth info, however, those are anyway optional fields and are not on the critical paths, and thus a type check is in order (and was done in the past already, but against OperationContext class).
- **Manifest resources** are now split between Core (nodeset zip, some generated resoures) and Types (built in bsd/xsds).  This needs to be revisited later if the bsd/xsd need to be regenerated during type generation.  Note that the embedded resource names changed as a result. Since these are only used internally and do not constitute public API this feels reasonable vs duplication of resources in 2 assemblies.
- Reflection however now needs to load not just the built in **encodeables** from Opc.Ua.Types assembly, but also the generated encodeables from Opc.Ua.Core assembly.  For this a new helper Utils method was added to get the Core assembly when linked against Opc.Ua.Core otherwise null.
- Whatever utils methods needed to be split out into the new Opc.Ua.Types assembly, they are now in **CoreUtils** static class in Opc.Ua.Types, and Utils.xxxx forwards to them to ensure minimal changes.  Later we would want to obsolete them in favor of CoreUtils, although it might make sense to split them again into domain specific utilities, such as networking, files, etc
2025-11-10 19:33:24 +01:00
Marc Schier e980d825fa Use connect async instead of BeginConnect (#3321)
* Use Connect async in channels
* Add more logging to debug connectivity issues
2025-11-10 15:44:05 +01:00