Commit Graph
1243 Commits
Author SHA1 Message Date
Martin Regen ab05d09d66 Tag PubSub lib as beta in release builds (#1396)
- in release builds tag PubSub lib as beta until MQTT API surface is finalized
- tag as 'beta' to avoid nuget collision with preview builds from master
- Move PubSub samples to seperate Solution
2021-05-11 14:45:03 +02:00
Alin Moldovean 49909c6b34 Implement logic for ApplyRestrictionsToBrowse flag in AccessRestrictionType (#1395) 2021-05-11 10:10:02 +03:00
Suciu Mircea Adrian 8b9bbe20fc Optimize GetNodeMetadata (#1392)
* Optimized GetNodeMetadata to support reading AccessRestrictions and RolePermission attributes when specified; All service calls use only these attributes on validating AccessRestrictions and RolePermissions. Read and Browse services also cache the values for avoiding unnecessary calls.
1.4.366.31-preview
2021-05-05 15:10:02 +03:00
Nyphusandmacheronte 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
Alin Moldovean 323c8c9010 Minor fixes in PubSub tests (#1393) 2021-05-04 15:52:07 +03: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
Sebastian Baeumler ea1e2b35db Fixed issue with XML namespace schema while decode an XML nodeset (#1385)
- added protected property XmlNamespace to BaseComplexType class
- use XmlNamespace instead of TypeId.NamespaceUri for PushNamespace of
  encoder/decoder
- adapt Encode/Decode method in OptionalFieldsCompexType and
  UnionComplexType class

Change was needed if Xml schema in Xml nodeset differ from the custom OPC UA namespace. 
Only effects XML encoding and decoding from values of customized structured datatypes.

Example:

The OPC UA Namespace of the nodeset is http://MyTestOfExtensions but the xml namespace for the xml schema is http://MyTestOfExtensions/Types.xsd
These 2 namespaces are not forced to be equal, therefor the XmlDecoder need to Push the XmlNamespace for the schema to the Reader stack. Otherwise the ExtensionObject Body will not be read.

```XML
<?xml version="1.0" encoding="utf-8"?>
<UANodeSet LastModified="2021-04-08T11:57:22.286Z" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://opcfoundation.org/UA/2011/03/UANodeSet.xsd" xmlns:uax="http://opcfoundation.org/UA/2008/02/Types.xsd" xmlns:si="http://www.siemens.com/OPCUA/2017/SimaticNodeSetExtensions" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <NamespaceUris>
        <Uri>http://MyTestOfExtensions</Uri>
    </NamespaceUris>
    <Models>
        <Model ModelUri="http://MyTestOfExtensions" PublicationDate="2020-07-20T00:00:00Z" Version="1.00">
            <RequiredModel ModelUri="http://opcfoundation.org/UA/" PublicationDate="2020-07-15T00:00:00Z" Version="1.04.7"/>
        </Model>
    </Models>
    <Aliases>
        <Alias Alias="Boolean">i=1</Alias>
        <Alias Alias="DateTime">i=13</Alias>
        <Alias Alias="String">i=12</Alias>
        <Alias Alias="NodeId">i=17</Alias>
        <Alias Alias="QualifiedName">i=20</Alias>
        <Alias Alias="HasComponent">i=47</Alias>
        <Alias Alias="HasProperty">i=46</Alias>
        <Alias Alias="Organizes">i=35</Alias>
        <Alias Alias="HasSubtype">i=45</Alias>
        <Alias Alias="HasTypeDefinition">i=40</Alias>
        <Alias Alias="HasModellingRule">i=37</Alias>
        <Alias Alias="HasEncoding">i=38</Alias>
    </Aliases>
    <Extensions>
        <Extension>
            <si:Generator Product="SiOME" Edition="Standard" Version="2.2.3-beta24"/>
        </Extension>
        <Extension>
            <si:GeneratorExtension Hash="cee97a4b7b32c169214c2bbc22b555d2"/>
        </Extension>
    </Extensions>
    <UAObject SymbolicName="http___MyTestOfExtensions" NodeId="ns=1;i=5000" BrowseName="1:http://MyTestOfExtensions" ParentNodeId="i=11715">
        <DisplayName>http://MyTestOfExtensions</DisplayName>
        <References>
            <Reference ReferenceType="HasComponent" IsForward="false">i=11715</Reference>
            <Reference ReferenceType="HasTypeDefinition">i=11616</Reference>
        </References>
    </UAObject>
    <UAVariable DataType="String" NodeId="ns=1;i=6002" BrowseName="NamespaceUri" ParentNodeId="ns=1;i=5000">
        <DisplayName>NamespaceUri</DisplayName>
        <References>
            <Reference ReferenceType="HasProperty" IsForward="false">ns=1;i=5000</Reference>
            <Reference ReferenceType="HasTypeDefinition">i=68</Reference>
        </References>
        <Value>
            <uax:String>http://MyTestOfExtensions</uax:String>
        </Value>
    </UAVariable>
    <UADataType NodeId="ns=1;i=3000" BrowseName="1:MyStructureType">
        <DisplayName>MyStructureType</DisplayName>
        <References>
            <Reference ReferenceType="HasSubtype" IsForward="false">i=22</Reference>
            <Reference ReferenceType="HasEncoding">ns=1;i=5001</Reference>
            <Reference ReferenceType="HasEncoding">ns=1;i=5002</Reference>
        </References>
        <Definition Name="1:MyStructureType">
            <Field DataType="i=17" Name="NodeId"/>
            <Field DataType="i=20" Name="QualifiedName"/>
        </Definition>
    </UADataType>
    <UAObject SymbolicName="DefaultBinary" NodeId="ns=1;i=5001" BrowseName="Default Binary">
        <DisplayName>Default Binary</DisplayName>
        <References>
            <Reference ReferenceType="HasTypeDefinition">i=76</Reference>
        </References>
    </UAObject>
    <UAObject SymbolicName="DefaultXML" NodeId="ns=1;i=5002" BrowseName="Default XML">
        <DisplayName>Default XML</DisplayName>
        <References>
            <Reference ReferenceType="HasTypeDefinition">i=76</Reference>
        </References>
    </UAObject>
    <UAVariable DataType="ns=1;i=3000" NodeId="ns=1;i=6021" BrowseName="1:StructureTest" ParentNodeId="i=2253" UserAccessLevel="3" AccessLevel="3">
        <DisplayName>StructureTest</DisplayName>
        <References>
            <Reference ReferenceType="Organizes" IsForward="false">i=2253</Reference>
            <Reference ReferenceType="HasTypeDefinition">i=63</Reference>
        </References>
        <Value>
            <uax:ExtensionObject>
                <uax:TypeId>
                    <uax:Identifier>ns=1;i=5002</uax:Identifier>
                </uax:TypeId>
                <uax:Body>
                    <MyStructureType xmlns="http://MyTestOfExtensions/Types.xsd">
                        <NodeId>
                            <uax:Identifier>ns=1;i=42</uax:Identifier>
                        </NodeId>
                        <QualifiedName>
                            <uax:NamespaceIndex>1</uax:NamespaceIndex>
                            <uax:Name>zweiundvierzig</uax:Name>
                        </QualifiedName>
                    </MyStructureType>
                </uax:Body>
            </uax:ExtensionObject>
        </Value>
    </UAVariable>
</UANodeSet>
```
2021-04-30 07:42:53 +02:00
dependabot[bot] aba60b953e Bump System.ServiceProcess.ServiceController from 4.3.0 to 5.0.0 (#1388)
Bumps [System.ServiceProcess.ServiceController](https://github.com/dotnet/runtime) from 4.3.0 to 5.0.0.
2021-04-29 14:47:31 +03:00
dependabot[bot] 1dd0ef33ee Bump MQTTnet from 3.0.14 to 3.0.15 (#1387)
Bumps [MQTTnet](https://github.com/chkr1011/MQTTnet) from 3.0.14 to 3.0.15.
2021-04-29 14:46:14 +03: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
dependabot[bot] e15605c8f8 Bump NUnit from 3.13.1 to 3.13.2 (#1381)
Bumps [NUnit](https://github.com/nunit/nunit) from 3.13.1 to 3.13.2.
- [Release notes](https://github.com/nunit/nunit/releases)
- [Changelog](https://github.com/nunit/nunit/blob/v3.13.2/CHANGES.md)
- [Commits](https://github.com/nunit/nunit/compare/v3.13.1...v3.13.2)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-28 15:10:40 +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
Archie Miller 88b16b3c01 Implement ConditionRefresh2 (#1353)
* Implement ConditionRefresh2
2021-04-19 09:24:06 +03:00
Simon Jäger 0c735eb038 Add interface for NodeCache (#1364)
* feat: add node cache interface
2021-04-16 11:42:09 +03:00
Alin Moldovean f2b5c45bdd Remove obsolete classes from Diagnostics\V10 (#1362) 2021-04-16 09:55:37 +03:00
dependabot[bot] 59cef07bf3 Bump Microsoft.NET.Test.Sdk from 16.9.1 to 16.9.4 (#1365)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.9.1 to 16.9.4.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v16.9.1...v16.9.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-16 08:54:05 +02:00
Martin Regen 558c395b71 Codecov update (#1359)
- switch to the codecov collector
- add codecoverage batch command for local execution
2021-04-15 09:24:52 +02:00
Alin Moldovean fafc4427bd ActivateSession fix for changing identity from UserName to Anonymous. Fixes #1149 (#1360)
Check for unsupported UserIdentity type in ReferenceServer e.g. IssuedToken identity
2021-04-14 10:09:29 +03:00
Martin Regen 8a8a38287e Format opc.ua.client - no bug fixes / features (#1358)
for upcoming async improvements, changes will not be cluttered with formatting
2021-04-13 13:13:38 +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
dependabot[bot] 7b20fcbdf2 Bump Microsoft.NET.Test.Sdk from 16.9.1 to 16.9.4 (#1349)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.9.1 to 16.9.4.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v16.9.1...v16.9.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-12 09:55:04 +02: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
Alin Moldovean d7c7cbc07c Fixes #1181 - Provide underlying error at LoadApplicationConfiguration() (#1346)
* Fixes #1181 - Provide underlying error at LoadApplicationConfiguration()
2021-04-01 10:07:00 +03: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
Martin Regen 89da78dc22 Better buttons in Issue report (#1344) 2021-03-31 11:49:39 +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
Alin Moldovean 4f861a2067 Add reference to Configuration library in Client and Server project. (#1340)
In this way a single Nuget package reference is required for a UA Client or UA Server application project.
2021-03-26 21:33:15 +01:00
David LinderandMartin Regen b3bc1615ec fix commands and .NET-version in README (#1331)
* fix commands and .NET-version in README
* enable mandatory build for doc changes

Co-authored-by: Martin Regen <mregen@microsoft.com>
2021-03-25 17:36:45 +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
Alin Moldovean 7e501ff416 Fix for duplicated HistoryServerCapabilities node in DiagnosticsNodeManager. Fixes #1320. (#1334) 2021-03-23 13:32:20 +02:00
Tobias HoffandAlin Moldovean 4014aa646b Stick with EndpointDescription if SecPol is null for the UserToken (#1324)
Co-authored-by: Alin Moldovean <aam@softing.com>
2021-03-23 13:30:50 +02:00
Alin Moldovean d7236cebc1 Update compliance test project for latest CTT -ver. 1.4.340.396 (#1317) 2021-03-12 10:23:52 +02:00
dependabot[bot] 4f36fca7a9 Bump NunitXml.TestLogger from 3.0.91 to 3.0.97 (#1316)
Bumps [NunitXml.TestLogger](https://github.com/spekt/nunit.testlogger) from 3.0.91 to 3.0.97.
- [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.91...v3.0.97)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-11 13:45:17 +02:00
Jonas Arndt bcfed5e698 Fix: Format Exception (#1307)
fixed the index in a format string
2021-03-08 09:41:50 +02:00
dependabot[bot] 426dcba055 Bump Microsoft.NET.Test.Sdk from 16.8.3 to 16.9.1 (#1297)
Bumps [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest) from 16.8.3 to 16.9.1.
- [Release notes](https://github.com/microsoft/vstest/releases)
- [Commits](https://github.com/microsoft/vstest/compare/v16.8.3...v16.9.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-26 09:05:20 +02:00
dependabot[bot] f4fd3cc012 Bump Portable.BouncyCastle from 1.8.9 to 1.8.10 (#1294)
Bumps [Portable.BouncyCastle](https://github.com/novotnyllc/bc-csharp) from 1.8.9 to 1.8.10.
- [Release notes](https://github.com/novotnyllc/bc-csharp/releases)
- [Commits](https://github.com/novotnyllc/bc-csharp/compare/pcl-v1.8.9...pcl-v1.8.10)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-25 09:26:57 +02:00
dependabot[bot] dbb5927881 Bump Moq from 4.16.0 to 4.16.1 (#1296)
Bumps [Moq](https://github.com/moq/moq4) from 4.16.0 to 4.16.1.
- [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.16.0...v4.16.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-02-25 09:26:23 +02:00
Alin Moldovean c541994ca2 Limit recursion level in XmlDecoder.ReadMatrix() and XmlEncoder.WriteMatrix() (#1295) 2021-02-25 09:25:23 +02:00
dependabot[bot] c382922b3b Bump coverlet.msbuild from 3.0.2 to 3.0.3 (#1293)
Bumps [coverlet.msbuild](https://github.com/coverlet-coverage/coverlet) from 3.0.2 to 3.0.3.
2021-02-23 11:38:33 +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