Commit Graph

509 Commits

Author SHA1 Message Date
Martin Regen 33ae8bbec5 Set DefaultEncodingId in DataTypeDefinition, was always null NodeId (#1523)
- DefaultEncodingId is always set to binary encoding id. Helper added to StructureDefinition for other use cases (e.g. PubSub)
- the default encoding id is derived for the encodeable factory, since the typetree does not contain sufficent information to find the proper binary encoding id
- add a few helper functions in core for an upcoming PR that was used for testing with custom types, will simplify to add more nodemanagers to servers with custom types
2021-09-24 16:25:21 +02:00
Cristian Pogacean 7d310d57bd Fix NodeSet import/export of ArrayDimensions in StructureField #1115 (#1517)
Fix NodeSet import/export of ArrayDimensions in StructureField #1115
2021-09-20 14:36:38 +02:00
Suciu Mircea Adrian 33cbddb49b Enable the coexistence of a Server and Client sessions in the same process, which consume custom data types. (#1514)
Called ServerBase::CreateMessageContext(true) to use a clone of EncodeableFactory.GlobalFactory
2021-09-20 11:56:14 +03:00
Cristian Pogacean 5048189195 fix bug - nodeset2 export of namespace index #689 (#1510)
* fix bug - nodeset2 export of namespace index #689

* the actual fix for #689
2021-09-16 22:30:29 +03:00
Martin Regen 2b54136969 Add missing vars in session less message (#1505)
**Type of Issue**
[X] Bug [ ] Enhancement [ ] Compliance [ ] Question [ ] Help wanted

The `SessionLessServiceMessage` misses the urisVersion field and localeIds

https://reference.opcfoundation.org/v104/Core/docs/Part4/6.3.2/

The urisVersion field is a VersionTime.
The urisVersion was misspelled in the Nodeset as an array. Nodeset was fixed in errata 1.04.8
2021-09-13 15:53:20 +02:00
Martin Regen 76afe829b4 Add async versions of subscription API to session client (#1498)
fixes #919 and #921

- enable async client stubs in core
- add async versions for subscription management
- APM versions will not be included...

based on PR #919 from @mibos-kremer

Co-authored-by: Michiel <m.bos@kremer.nl>
2021-09-07 16:23:00 +02:00
opcfoundation-org 9b89bd070f Modelcompiler 1.04.10 (#1492)
* Changes needed for model compiler needed for Errata 1.04.10. 
* Errata 1.04.10.
2021-09-03 19:38:31 +02:00
Martin Regen 4a2f13efaf Improve https clien/server support (#1490)
- add support for security header in client/server libs
fixes #1118
2021-08-20 16:07:10 +02:00
Suciu Mircea Adrian 198cec64bf Enhance GetBuiltintype to support simple datatypes (#1488)
* Return the correct BuiltInType for Simple numeric type ids in nanespace 0

* Added unit test BuiltInTypeOfSimpleDataTypes
2021-08-19 16:36:18 +03:00
Dmitry Tikhonov c37f66cfeb Fix the behavior in case of the server is reachable only via an alternate address (#1480)
Fix the behavior in case of the server is reachable only via an alternate address - this alternate address matching the address, the client provides, is added to the list of accessible addresses so that the TranslateApplicationDescription method works correctly and the client gets back appropriate endpoints with the corresponding alternate address within them (#1480)
2021-08-19 08:10:01 +02:00
Martin Regen 73e0e59f98 macOS mono build fix, Https tests, bench improvements (#1486)
- on VS2019 for mac the https lib doesn't build, now get the properties at runtime to set server validation callback
- add client tests for https
- fix an issue with SslProtocol selection, where tools recommend None it only works on all platform combinations if Tls12 is used
- use the benchmark .NET command line parser 
- benchmarks for StreamWriter buffer size
- StreamWriter default buffer size reduced to 1k, according to bench results best compromise
fixes #1443
2021-08-18 11:01:04 +02:00
Suciu Mircea Adrian 98634b1cc7 Fixes issue #1462 (#1465)
* Added default switch case for the CreateStore method; reported in issue #1462
2021-07-23 13:41:05 +03:00
Martin Regen c435e5844d Improve JsonDecoder StreamWriter dispose (#1448)
- only dispose StreamWriter if owned by JsonEncoder
- only dispose if dispose is called
- on external stream writer, return text by using reflection on basestream, if memorystream is used
- improve benchmark common code
- fixes #1444
2021-07-09 07:44:54 +02:00
Martin Regen 0236d082b1 Create client and server test projects, increase test coverage (#1434)
- Add Operation limit parameter and fix server. Fixes #1363 
- Add client/server test projects
- Add client and server fixture for test runs
- Server tests can test services without client connection
- Client tests can use common services to write tests which can run directly on server on via client server connection
- Increase code coverage > 50%
- Code coverage excludes the generated code
- Improve codecoverage local tests with report (see Tests/codecoverage scripts)
- Add a benchmark framework to client server tests
2021-07-06 18:01:54 +02:00
Martin Regen 96ecb4dd9c Add a no file fluent API for application configuration. (#1422)
* Add no file configuration fluent API
* ensure secure settings are produced by default
* most if not all settings can be reached by .Set/.Add functions
* switched gds tests to use no file config (also good as starter)
2021-06-15 19:14:09 +02:00
Martin Regen 24f90c410a Add interfaces IServiceMessageContext, IEncodeableFactory (#1407)
* use IServiceMessageContext instead of ServiceMessageContext across the board.
* same for IEncodeableFactory
2021-06-11 16:35:46 +02:00
Martin Regen 9923141e70 Enable .NET analyzers for all projects (#1414)
* Enable .NET analyzers for all projects
* fix all new warnings, mostly security and perf
2021-06-05 07:58:38 +02:00
Alin Moldovean 8406716bf9 Fixes #1302. Use value from OnReadUserAccessLevel at Read/WriteNonValueAttribute if handler exists. (#1413) 2021-05-31 09:15:41 +03:00
Alin Moldovean 923597eac2 improve encode/decode for array/matrix of Iencodeable (#1398)
Add tests for encode/decode of array/matrix of all IEncodeable
2021-05-12 15:10:11 +03:00
Alin Moldovean a5e1f4c8cd PubSub fixes (#1394) 2021-05-12 13:33:29 +03:00
Nyphus 244b26e22f Port thread scheduler and servicehost from UA .NET legacy. (#1389)
* Add minThreadCount and maxThreadCount setting for ThreadPool
* Port thread based scheduler back from UA.NET legacy. 
* The UA Expert perf test shows better response times than Task.Run implementation. 
* Old implementation to compare against is ifdefed,
* Port servicehost from UA.NET legacy
* a few minor backports in serverbase e.g. alias names for hostname
* fix editorconfig, as it caused false positives in ref server

Co-Authored-By: macheronte <79026457+macheronte@users.noreply.github.com>
2021-05-04 15:39:17 +02:00
Martin Regen 7e736d22fc Improve auto accept in cert validation handler, add tests (#1386)
- if a cert validator is enabled, use it and ignore auto accept flag.
- trace auto accept message, if used
- make all config flags public, otherwise they can only be configured using a SecurityConfiguration. Once a config flag is set using a property, it is protected from modification by a SecurityConfiguration. This way apps can consistently override.
- add tests for the SHA1 and AutoAccept configuration flags
- add a method to reset the validated list of certificates. The list of certs should be revalidated from time to time to catch expired or revoked certificates. Applications can call `ResetValidatedCertificates` to clear the list with a daily timer.
2021-04-30 10:27:02 +02:00
Martin Regen 631e729787 Fix warnings, improve complex type exception handler (#1384)
- catch exception in complex type system not only for ServiceResultException
- add fast path for single type loader if type already exists
- fix many warnings, no function change
- fix template for legacy nuget packages to include cert lib
2021-04-28 18:34:43 +02:00
Sebastian Baeumler e8df315193 ComplexTypes Improvements (#1383)
- Fixed typo in StructureDefinitionAttribute
- Adapt using of fixed StructureDefinitionAttribute
- Resolve method internal name conflict
- Enable TypeInfo.GetSystemType to support ExpandedNodeId
- Redirect request with absolute NodeIds an directly use the EncodableFactory.GetSystemType method
2021-04-28 15:08:14 +02:00
Alin Moldovean 7a4a22201b MQTT support in PubSub library (#1376)
Implementation of MQTT support in PubSub library
2021-04-28 15:31:06 +03:00
Alin Moldovean f0c467410e Implement AutoAcceptUntrustedCertificates flag for Client side also. Fixes #1228 (#1380) 2021-04-26 17:00:23 +03:00
Martin Regen e34eb9b512 Fix Perf warnings (#1372)
- use Array.Empty
- improve StringBuilder, Where
- use .Equals instead Compare
- use ConfigureAwait
2021-04-21 09:28:25 +02:00
Alin Moldovean 087415be1b Complex data types fix for passing TypeId to IComplexTypeInstance (#1371) 2021-04-20 18:44:58 +03:00
Martin Regen 77a3da8ecd Prohibit Xml Dtd processing (#1370)
- enable CA3075 as warning (on windows)
- Dtd processing is by default not prohibited, only limited to 10000000 chars.
- ensure to only use safe defaults for all xml processing
2021-04-20 10:45:50 +02:00
Martin Regen c996e7933d Add ifdef to support Net5.0 build with ECC support (#1367)
- for dev only ifdefs,  but not added to target props
2021-04-19 10:42:26 +02:00
Alin Moldovean 901a1715e9 Fixes #1140 - Ensure UserTokenPolicy.policyId is unique within the context of the server. (#1357)
Fix #1140
2021-04-13 10:00:38 +03:00
Alin Moldovean cb1abb1ec3 Implement encoders support for Arrays and multi-dimensional Arrays. (#1350)
* Implement encoders support Arrays and multi-dimensional Arrays.
* JsonEncoder/Decoder fix for non reversible encoding of NodeId, ExpandedNodeId and QualifiedName
2021-04-07 14:40:40 +03:00
Martin Regen 1d5e87c784 Remove RSA dispose special handling for Mono (#1347)
-Issue has been fixed in Mono, no more workarounds
-Fixes #1214 
-fix some Roslynator and other warnings
2021-04-01 14:32:20 +02:00
Martin Regen 25e0998081 Create codeql-analysis.yml (#1345)
-Add CodeQL code scanner
-EnableNetAnalyzers
-small tweak for .editorconfig
2021-04-01 08:55:42 +02:00
opcfoundation-org 0f97945858 Modelcompiler updates, errata 1.04.9 nodeset (#1284)
- Use updated Modelcompiler code generator to produce code which has no dependency on System.Servicemodel
- breaking change, .NET stack which used the NET_STANDARD version have to fix dependencies on System.Servicemodel
- new codegenerator also provides stubs for async client API (NET_STANDARD_ASYNC), currently disabled
- latest V1.04.9 Nodeset
2021-03-29 17:19:49 +02:00
Alin Moldovean 20957233ae Allow to set HiResClock Enabled/Disabled only once. Fixes #1269 (#1341)
fixes #1269 
- Add a reset method for testing
2021-03-26 21:35:17 +01:00
tobiasdroessler d9498f523c bugfix in RelativePath.ParseName(..): update variable last for loop i… (#1330)
* bugfix in RelativePath.ParseName(..): update variable last for loop increment statement to keep it for further processing
2021-03-24 10:04:35 +02:00
Camille Guérin be1aadeaf5 Fixed FormatException and Fixed missing sourcePicoseconds in DataValue Equals (#1335)
* Fixed FormatException

* Fixed missing sourcePicoseconds in DataValue Equals
2021-03-23 13:35:16 +02:00
Alin Moldovean 0ebe579448 Fixes #1300 - Minor fix in NodeId constructor comment. (#1326)
* Fixes #1300 - Minor fix in NodeId constructor comment.

* Minor fix in NodeId constructor comment.
2021-03-23 13:34:36 +02:00
Jonas Arndt bcfed5e698 Fix: Format Exception (#1307)
fixed the index in a format string
2021-03-08 09:41:50 +02:00
Alin Moldovean c541994ca2 Limit recursion level in XmlDecoder.ReadMatrix() and XmlEncoder.WriteMatrix() (#1295) 2021-02-25 09:25:23 +02:00
Martin Regen 46ada27179 Add certificate password provider interface to support password protected pfx files. (#1291)
* Add a certificate password provider.
2021-02-23 11:31:42 +02:00
Lyubomyr Vyhovskyy 61eede8628 Fix issue with https binding .net core 3.0 #1283 (#1286)
commenting out Kestrel listenOptions.NoDelay b/c:
1. the default value = true
2. it was removed in .net core 3.0 and this can be configured in SocketTransportOptions

fixes #1283
2021-02-15 15:23:29 +01:00
Randy Armstrong e016a9bb29 Fix unit tests errors. 2021-02-05 23:53:30 +09:00
Randy Armstrong c22ecec8f5 Fix XmlEncoder. 2021-02-05 19:14:10 +09:00
Randy Armstrong 1305e94182 Merge model compiler fixes with latest code. 2021-02-05 18:35:53 +09:00
Archie Miller a2e8489d91 Fix Issues 1274 and 1275 (#1277)
* Fix Issues 1274 and 1275
* Update Documentation for Publicly visible UnshelveTimeUpdateRate
* Adds a timer specifically to update UnshelveTime periodically.
* Initializes Unshelve to double maximum value or MaxTimeShelved if it exists, even for OneShotShelve method calls (Mantis 6462).
2021-02-04 18:16:12 +01:00
Bill Berry e138777638 fix comment spelling mistakes - 'refernces' to 'references' (#1273) 2021-02-03 11:14:45 +02:00
dependabot[bot] 9ce1c33b78 Bump System.ServiceModel.Primitives from 4.8.0 to 4.8.1 (#1268)
Bumps [System.ServiceModel.Primitives](https://github.com/dotnet/wcf) from 4.8.0 to 4.8.1.
- [Release notes](https://github.com/dotnet/wcf/releases)
- [Commits](https://github.com/dotnet/wcf/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-02 07:36:16 +01:00
Archie Miller fac8ed2fc8 Fix issue setting empty comments Issue #1264 (#1265)
* Fix issue setting empty comments

On Acknowledge and Confirm, if a comment with an empty Locale and empty Text is passed from the client, then the comment should remain untouched.
Also fixed issue when firing an event, clearing the change mask on all children of the alarm will update any monitored item watching the alarm parameters, like Comment, EventId, etc.

fixes #1264
2021-01-29 16:08:41 +01:00