Commit Graph
1478 Commits
Author SHA1 Message Date
Martin RegenandRandy Armstrong 0cb51ea050 GDS Server fixes for 1.05.02 and .NET 4.8 (#1973)
* Fix for ReadTrustList test failure.
* fix .NET4.8 GDS push
* include .NET 4.8 in test pipeline
* fix audit event that may throw exception when server is halted

Co-authored-by: Randy Armstrong <randy@sparhawksoftware.com>
2022-11-04 08:32:49 +01:00
dependabot[bot] 788464460c Bump NUnit3TestAdapter from 4.2.1 to 4.3.0 and coverlet.collector from 3.1.2 to 3.2.0 (#1966)
* Bump NUnit3TestAdapter from 4.2.1 to 4.3.0

Bumps [NUnit3TestAdapter](https://github.com/nunit/nunit3-vs-adapter) from 4.2.1 to 4.3.0.
- [Release notes](https://github.com/nunit/nunit3-vs-adapter/releases)
- [Commits](https://github.com/nunit/nunit3-vs-adapter/compare/V4.2.1...V4.3.0)

* Bump coverlet.collector from 3.1.2 to 3.2.0 (#1968)

Bumps [coverlet.collector](https://github.com/coverlet-coverage/coverlet) from 3.1.2 to 3.2.0.
- [Release notes](https://github.com/coverlet-coverage/coverlet/releases)
- [Commits](https://github.com/coverlet-coverage/coverlet/commits/v3.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-01 12:39:47 +01:00
Martin Regen 20514d92c4 Support .NET 4.8 assemblies and enable package validation (#1964)
-Enable package validation to catch API differences on target platforms
-Build and release .NET 4.8 assemblies in preparation of retirement of .NET 4.6.2. support
-.NET 4.8 does not rely on bouncy castle for cert creation and supports ECC certificates. Bouncy castle is only used on this platform to read and write PEM encoded certificates.
2022-11-01 11:51:18 +01:00
Martin Regen ea8ceb6d59 Only load optional bindings assemblies if needed (#1963)
-Currently the server startup tries to load bindings for all known schemes, even if no baseaddress was specified.
Filter the required schemes to load only if necessary.
-Make GetDiscoveryUrl helper public
2022-11-01 11:47:12 +01:00
dependabot[bot]andMartin Regen 430d7c6b51 Bump Nerdbank.GitVersioning from 3.2.31 to 3.5.119 (#1961)
* Bump Nerdbank.GitVersioning from 3.2.31 to 3.5.119
* bump also powershell script

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Regen <mregen@microsoft.com>
2022-10-26 09:00:44 +02:00
Suciu Mircea Adrian 3e273facbe Encode and decode CRL time values as UTC or GeneralizedTime depending on the value of the year. (#1959)
- Follow RFC to encode time/date >=2050 as generalized time
- Fix bug that encoded generalized time was not properly decoded
2022-10-26 08:40:27 +02:00
Suciu Mircea Adrian 8c7da18657 Refactor the handling of matrix dimensions. (#1927)
- Move Matrix class to Matrix.cs 
- refactor helper to catch invalid dimension in a single function
- More tests
2022-10-24 14:24:30 +02:00
opcfoundation-org c070f0b421 Ua 1.04.11 update for 1.05.02 (#1955)
-Minor documentation fixes to be merged.
-Add IJsonEncodeable support.
Co-authored-by: Randy Armstrong <randy@sparhawksoftware.com>
2022-10-24 14:10:54 +02:00
Martin Regen a3408e71f6 Fix .NET7 build (#1952)
.NET7 introduces a X509AuthorityKeyIdentifierExtension datatype which causes some ambigous datatype build errors.
Tested on .NET7 rc2

Note: Targetframework as .NET7 has not been added yet. Fix just the build if somebody tries.
2022-10-24 10:17:17 +02:00
opcfoundation-organdRandy Armstrong 226b0ceb66 Update 1.04.11 generated files with 1.05.02 Modelcompiler update. (#1954)
-Modelcompiler Update 1.04.11 generated files.
-Update of UANodeset.xsd with 1.05.02 version.
-Add generated templates for ISessionClientMethods 

Co-authored-by: Randy Armstrong <randy@sparhawksoftware.com>
2022-10-17 11:55:20 +02:00
dependabot[bot] 66436a9b6d Bump Serilog.Expressions from 3.4.0 to 3.4.1 (#1947)
Bumps [Serilog.Expressions](https://github.com/serilog/serilog-expressions) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/serilog/serilog-expressions/releases)
- [Commits](https://github.com/serilog/serilog-expressions/compare/v3.4.0...v3.4.1)

---
updated-dependencies:
- dependency-name: Serilog.Expressions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-14 17:28:52 +02:00
Martin Regen da1b1a7112 Add Session.CloseAsync, fix UANodesetHelper.Save (#1944)
-Add Session.CloseAsync methods.
-Add missing Close signatures to ISession
-Mark the CloseSession service call as obsolete to prevent invalid usage
-fix UANodeSetHelper.Save(stream), to not close the stream
-fix a deadlock in the ref server app, due to the new default behavior of the cert validator not caching the approved certificates
2022-10-11 11:03:00 +02:00
Ivan van Heerden 1f2a30d7ca Add abstraction 'ISession' for Session object in the Client library (#1702)
Expose an 'ISession' interface as abstraction to ease unit testing. 

Breaking changes are kept to minimal impact, but some changes maybe required to use ISession objects instead of Session.

Note: ISessionClientMethods is hand created, not yet by ModelCompiler
2022-10-07 20:11:53 +02:00
Martin Regen 72842f1379 New self signed certificates set CA flag to false (#1941)
Based on discussions in the security WG the default for the CA flag of self signed certificates is now 'false'.
- see https://mantis.opcfoundation.org/view.php?id=8370
2022-10-06 12:14:39 +02:00
Martin Regen 77b89500f9 Use of validated certificates needs opt-in. (#1925)
Currently, the validated certificates are stored in a dictionary for fast compare of the certificate validation when an application reconnects, until manually cleared by e.g. `ResetValidatedCertificates()`. After discussion it was decided to make this function an opt-in feature to avoid use cases where changes in the trusted store or CRL are not reflected in the list of validated certificates.
The runtime penalty of a full check can be avoided if needed with the 'Opt-In' by configuration or by application setting the property. After opt-in it is the application responsibility to clear the list of validated certificates if needed.

+++ Other cert validator improvements/fixes

- Setting the `ValidationOptions.SuppressRevocationStatusUnknown` on a trustlist (e.g. issuer) was ignored
- If another client/server connects with a chain, the whole chain is saved to the rejected store, not only the leaf certificate.
2022-10-06 10:53:32 +02:00
Martin Regen 1fec89b073 Complex types improvements (#1915)
Improvements for complex types.

- Support to encode/decode complex type structures with multidimensional arrays.
- Perf improvements for type loader using new NodeCache fetch multiple interfaces.
- DataTypeDictionary validation when dependencies are used.
- interface for complex type resolver, to build custom types in code.
- improvements of console client to demonstrate browse/read of custom values

+++ Breaking changes +++

IDecoder interface change of the `ReadArray` method

- Return type is now `Array` for all types of arrays. Previously the method returned an array for 1-dim and a `Matrix` type for multidimensional arrays. In addition the convention in generated code is to use `Collection` for all 1-dim arrays, and so was built the `BaseComplexType`. The new convention is to expose the native `Array` type from a complex type, in all cases, hence the return type of `ReadArray` was changed to reflect that for a consistent programming model.
- `ReadArray` has a new parameter `systemType` to efficiently read encodeable types. Previously the `Type` of an encodeable was determined by the encodingid and lookup in the type factory, even when the Type is already known by the caller.  The 'old' style is still supported.
- `ReadArray` supports to read encodeable type arrays which are directly encoded in structures. These arrays differ from standard encoding of arrays and they are handled when `BuiltInType.Null` is used as parameter.
2022-10-04 19:45:26 +02:00
dependabot[bot] 677edb94e3 Bump Microsoft.NET.Test.Sdk from 17.3.1 to 17.3.2 (#1937)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.3.1 to 17.3.2.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v17.3.1...v17.3.2)

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-27 07:12:04 +02:00
dependabot[bot]andMartin Regen 95c384f454 Bump Microsoft.Extensions.Logging.Abstractions from 6.0.1 to 6.0.2 (#1932)
* Bump Microsoft.Extensions.Logging.Abstractions from 6.0.1 to 6.0.2

Bumps [Microsoft.Extensions.Logging.Abstractions](https://github.com/dotnet/runtime) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/dotnet/runtime/releases)
- [Commits](https://github.com/dotnet/runtime/compare/v6.0.1...v6.0.2)

---
updated-dependencies:
- dependency-name: Microsoft.Extensions.Logging.Abstractions
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update Opc.Ua.Core.csproj

* Update UA Client Controls.csproj

* Update UA Server Controls.csproj

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Regen <mregen@microsoft.com>
2022-09-26 10:41:18 +03:00
dependabot[bot] b42d37740e Bump Serilog from 2.11.0 to 2.12.0 (#1931)
Bumps [Serilog](https://github.com/serilog/serilog) from 2.11.0 to 2.12.0.
- [Release notes](https://github.com/serilog/serilog/releases)
- [Changelog](https://github.com/serilog/serilog/blob/dev/CHANGES.md)
- [Commits](https://github.com/serilog/serilog/compare/v2.11.0...v2.12.0)

---
updated-dependencies:
- dependency-name: Serilog
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-14 17:24:19 +03:00
dependabot[bot] 441fbaeba6 Bump NunitXml.TestLogger from 3.0.107 to 3.0.127 (#1929)
Bumps [NunitXml.TestLogger](https://github.com/spekt/nunit.testlogger) from 3.0.107 to 3.0.127.
- [Release notes](https://github.com/spekt/nunit.testlogger/releases)
- [Changelog](https://github.com/spekt/nunit.testlogger/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spekt/nunit.testlogger/compare/v3.0.107...v3.0.127)

---
updated-dependencies:
- dependency-name: NunitXml.TestLogger
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-14 14:53:00 +03:00
Suciu Mircea Adrian 0e4f8f371f Merge pull request #1926 from OPCFoundation/dependabot/nuget/Serilog.Sinks.Console-4.1.0
Bump Serilog.Sinks.Console from 4.0.1 to 4.1.0
2022-09-07 16:59:22 +03:00
dependabot[bot] 35adf40abf Bump Serilog.Sinks.Console from 4.0.1 to 4.1.0
Bumps [Serilog.Sinks.Console](https://github.com/serilog/serilog-sinks-console) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/serilog/serilog-sinks-console/releases)
- [Commits](https://github.com/serilog/serilog-sinks-console/compare/v4.0.1...v4.1.0)

---
updated-dependencies:
- dependency-name: Serilog.Sinks.Console
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-06 10:01:43 +00:00
TeaTime762 29b1bbe412 Rethrow exception on MasterNodeManager StartUp (#1906)
* So far errors during startup of MasterNodeManager were consumed and only logged, so the app did not know there is an issue
* New behavior is to rethrow exception to retrieve it outside the NuGet package
* Update MasterNodeManager.cs
2022-08-31 08:41:36 +02:00
Martin Regen 885c7b2d2c Fix server url mismatch handling (#1914)
* change the Certificate domain validation to work also for the server case
* do not refuse a connection if the check fails, only trigger the audit event
* bump up test Nuget
2022-08-30 22:18:15 +02:00
dependabot[bot]andMartin Regen 0f5ad5ea6d Bump BenchmarkDotNet and CI VM versions (#1922)
* bump up VM versions
* Bump BenchmarkDotNet from 0.13.1 to 0.13.2

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Martin Regen <mregen@microsoft.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-26 20:13:18 +02:00
Martin Regen d0fb11dddd Set higher default client chunk count limit (#1916)
-Issue: A server might return a much smaller send and receive buffer size than what was proposed in the hello message by a client. Given the current default max chunk count, which is based on the default buffer size, the response message size is also limited by the calculated max chunk count.
- fix: Calculate the default max chunk counts based on the TCP client min buffer size.
2022-08-22 13:52:21 +02:00
Martin Regen f273634d74 Improve https transport and other bug fixes (#1908)
-Make the https callbacks fully async / code cleanup. 
-Default https client to use MaxConnectionsToServer = 64 for #1550
-Fix https missing reconnect error code
other fixes unrelated to https:
- move trust list audit event to AuditEvents.cs, fix issue that the event is not filtered since reportAuditEvent cannot be used
- fix an issue when BrowseNext for multiple continuation tokens doesn't add the results array properly
- bump up .NET Core 3.1 Nuget dependencies
- improve .NET reference client app for use with https
2022-08-20 23:44:09 +02:00
opcfoundation-organdRandy Armstrong 346e7a61f9 JSON objects cannot have the DataTypeEncodingId (#1911)
*The EncodableFactory does not index the JSON DataTypeEncodingIds because they are not defined on the types.
As a result, a JSON document that complies with the specification (see https://reference.opcfoundation.org/Core/Part6/5.4.2/#5.4.2.16) cannot be parsed.

* This change creates the JSON encoding types ids from generated code using reflection, so the JSON documents which comply with the spec can be decoded.

* Fixes type id on a JSON encoded ExtensionObject that contains binary or xml encoded data.

Co-authored-by: Randy Armstrong <randy@sparhawksoftware.com>
2022-08-18 16:49:24 +02:00
Suciu Mircea Adrian 0a9a3f3a7d Fix a few audit events for CTT pass (#1910)
- Fixed ReportAuditCreateSessionEvent 
- removed unnecessary calls to ReportAuditAddNodesEvent, ReportAuditDeleteNodesEvent
- added ReportAuditUpdateMethodEvent
2022-08-15 13:04:22 +02:00
Cristian Kohlmann 885a61ba75 Use HashSet for validation cache in MasterNodeManager (#1907)
To improve Contains method performance I changed List type for HashSet.
2022-08-12 20:22:28 +02:00
Martin Regen 0ad5c4c3a3 Refactor audit events (#1895)
- Move the auditing flag to server internal
- Hook up new configuration setting to the Auditing node
- A Security Admin can change the Audit setting.
- Refactor audit events to be extensions in one class.
- enable auditing and diagnostics by default for higher test coverage.
- refactor dependency of some events to bindings, e.g. TcpServerChannel should not be used as reportevent parameter
2022-08-12 20:04:02 +02:00
dependabot[bot] c49295008d Bump Microsoft.NET.Test.Sdk from 17.2.0 to 17.3.0 (#1902)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 17.2.0 to 17.3.0.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v17.2.0...v17.3.0)

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-11 11:08:39 +02:00
OctaviaStan 8147552cc9 - Refactor the ReceiveEvents permission type validation to be taken into account also when ConditionRefresh method is called. (#1899)
- Fix error in validating PermissionType.ReceiveEvents.
The specs state that "A Client only receives an Event if this bit is set on the Node identified by the EventTypeId field and on the Node identified by the SourceNode field.
This Permission is only valid for EventType Nodes or SourceNodes."
The previous code was only checking the Node id of event state instance.
2022-08-10 13:45:38 +03:00
Martin Regen dd78c0be93 Client perf updates for NodeCache and service call layer to batch Operation Limits. (#1876)
- Add methods to support to Read/Browse multiple nodes in session and NodeCache.
- Add methods to find references of multiple nodes in NodeCache.
- By default the client fetches the operation limits from the server.
- Add operation limit object to client config, settings are overwritten by server limits if server limits are smaller.
- Split client service calls if operation limits are exceeded with an override of the SessionClient. All sync/async service calls are implemented, but not the servcie calls using the Begin/End pattern.
2022-08-08 11:43:55 +02:00
Martin Regen 5a77423265 Update codeql action script to v2 (#1894)
* bump up abstraction logging 3.1.27, add references to solve some warnings
2022-08-08 05:38:24 +02:00
Suciu Mircea Adrian 9b05714fa8 Handle processing matrixes with array dimensions that overflow. (#1891) 2022-08-07 18:44:59 +03:00
OctaviaStan 931b9b90c6 Audit events; add methods for reporting Add/Delete nodes audit events & fixes (#1890)
* Audit events; add methods for reporting Add/Delete nodes audit events and call these methods in CreateNode and DeleteNode methods
- fix values for AuditActivateSessionEventState.ClientSoftwareCertificates and AuditWriteUpdateEventState.IndexRange properties that were set to values of wrong type and generated exception when the client used filters for these properties.
2022-08-07 18:43:43 +03:00
dependabot[bot] d4da42067e Bump Moq from 4.18.1 to 4.18.2 (#1884)
Bumps [Moq](https://github.com/moq/moq4) from 4.18.1 to 4.18.2.
- [Release notes](https://github.com/moq/moq4/releases)
- [Changelog](https://github.com/moq/moq4/blob/main/CHANGELOG.md)
- [Commits](https://github.com/moq/moq4/compare/v4.18.1...v4.18.2)

---
updated-dependencies:
- dependency-name: Moq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-04 10:52:39 +02:00
Suciu Mircea Adrian 313aa2a249 Allow diagnostic nodes to be accessed by determined users (#1878) 2022-08-02 10:36:48 +03:00
Suciu Mircea Adrian 1d123da6a9 Bump to version to 1.4.370 (#1871) 2022-07-19 10:20:04 +02:00
Tim Jöhnk 5732286a11 Feature/recursive complex types (#1870)
* fixes recursive complex types 
* fix IComplexTypebuilder interface
2022-07-18 11:50:36 +02:00
Joshua Leger 8c0111b5ec Adding UnregisterNamespaceManager support to MasterNodeManager (#1869)
* Introducing MasterNodeManager::UnregisterNamespaceManager function
2022-07-17 19:21:07 +03:00
Suciu Mircea Adrian 274dfaddba Implementation of audit event triggers (#1867)
* Implementation of audit event triggers
2022-07-17 18:41:43 +03:00
Vincenzo CarlinoandMartin Regen cf0c878283 Add methods for reading multiple nodes (#1522)
* Add new methods for reading a set of nodes
* ReadNodes(NodeIdCollection, out DataValueCollection, out IList<ServiceResult>, bool optionalAttributes)
* (DataValueCollection, IList<ServiceResult>) ReadNodesAsync (NodeIdCollection, bool optionalAttributes)
to reduce the amount of attributes read from a server ReadNodes first reads only the NodeClass, then reads only the mandatory attributes per nodeclass to reduce the overall number of attributes to read.
If the NodeClass of all nodes is already known, the read can be further optimized to read only the attributes for a known class:
* ReadNodes(NodeIdCollection, NodeClass, out DataValueCollection, out IList<ServiceResult>, bool optionalAttributes)
* (DataValueCollection, IList<ServiceResult>) ReadNodesAsync (NodeIdCollection, NodeClass, bool optionalAttributes)
to complete async and collection operation, there is a:
* ReadNodeAsync and 
* ReadValues/ReadValuesAsync

* An issue was fixed in the https async codepath, the security header was not properly set in async operation

sidenote: operation limits must be handled by caller!

Co-authored-by: Martin Regen <mregen@microsoft.com>
2022-07-17 06:19:11 +02:00
Martin Regen 8fc68e3fbc return value also for uncertain (#1861) 2022-07-01 09:19:57 +03:00
Zigby 559c382666 Fix Server JWT Token Support (#1817)
* Handle JWT and set the IssuedTokenType in the server based on the policy referenced by the PolicyId in the client supplied UserIdentityToken .
* Connect/Reconnect tests cases with JWT
2022-06-30 14:02:07 +02:00
dependabot[bot] e07cba15ba Bump NUnit.Console from 3.15.0 to 3.15.2 (#1860)
Bumps [NUnit.Console](https://github.com/nunit/nunit-console) from 3.15.0 to 3.15.2.
- [Release notes](https://github.com/nunit/nunit-console/releases)
- [Changelog](https://github.com/nunit/nunit-console/blob/main/CHANGES.txt)
- [Commits](https://github.com/nunit/nunit-console/compare/3.15.0...3.15.2)

---
updated-dependencies:
- dependency-name: NUnit.Console
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 13:51:07 +02:00
Martin Regen 10d4dbcaa9 Improve ResendData server support (#1854)
* add resend data support to sample node manager
* After WG discussion, ensure after ResendData only a single value per monitored item is sent in the next publish (sync client cache)
* Seperate resend data state from ready to publish with IsResendData property
2022-06-29 06:41:59 +02:00
Suciu Mircea Adrian c0fc029c8d Avoid deadlock on processing events. (#1853)
* Moved validation of RolePermission from MonitoredItem::Publish to MonitoredNode::OnReportEvent.
Refactor MasterNodeManager::GetManagerHandle to avoid calling other node manager's GetManagerHandle inside a lock statement
2022-06-21 11:53:47 +03:00
opcfoundation-org df71776c75 Modelcompiler 1.04.11 (#1850)
* latest nodeset without reference to servicemodel
2022-06-21 11:51:41 +03:00