mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-19 07:02:16 +08:00
f9a8343dea
# Full OPC UA Part 14 (PubSub) — v1.05.06 This PR replaces the legacy PubSub stack with a modern, **OPC UA Part 14 v1.05.06**-compliant reimplementation built on current .NET: fully `async`, dependency-injection-first with a fluent builder (`services.AddOpcUa().AddPubSub(...)`), NativeAOT/trim-safe, and designed for high-throughput, highly-available, distributed deployments. The libraries — `Opc.Ua.PubSub`, `Opc.Ua.PubSub.Udp`, `Opc.Ua.PubSub.Mqtt`, `Opc.Ua.PubSub.Server`, and `Opc.Ua.PubSub.Adapter` — keep source compatibility with 1.5.378 where practical (obsolete shims) and ship a complete migration path. See the **[PubSub guide](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/PubSub.md)** and the **[2.0.x migration guide](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/migrate/2.0.x/pubsub.md)**. **Encodings & transports.** Both wire encodings are implemented in full — **UADP** (key/delta/event/keepalive, RawData, chunked, signed+encrypted) and **JSON** (verbose/compact, single-message, metadata; migrated from `Newtonsoft.Json` to `System.Text.Json`) — across **UDP** (uni/multi/broadcast + discovery), **MQTT** (3.1.1/5.0, retained metadata, TLS), and a from-scratch **DTLS 1.3** secured datagram transport (`opc.dtls://`) implemented on the .NET BCL crypto primitives (ECDHE, HelloRetryRequest cookies, certificate auth, AEAD record protection, HKDF key schedule), wired through `AddUdpTransport().WithDtls(...)`. Details in [Transports](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/PubSub.md#transports) and [Encodings](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/PubSub.md#encodings). A raw **Ethernet (Layer 2)** transport (`opc.eth://`, EtherType `0xB62C`, optional 802.1Q VLAN) carries UADP NetworkMessages directly in Ethernet II frames with no IP/UDP, via `AddEthTransport()` (`.WithPcap()` for cross-platform capture). See [Ethernet transport](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/PubSub.md#ethernet--uadp-opceth). **Runtime schema generation.** A new schema subsystem (`Opc.Ua.Core.Schema`, `Opc.Ua.PubSub.Schema`) generates **XSD**, **OPC Binary (BSD)**, and **JSON Schema** for OPC UA data types at runtime — including PubSub NetworkMessage/DataSet message schemas — driven from the type system and source-generated metadata (no reflection; NativeAOT/trim-safe). It is consumable from the client, server, and PubSub stacks. See the **[Schema generation guide](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/SchemaGeneration.md)**. **Security, fail-closed.** Message-level security is wired end-to-end through `IPubSubSecurityWrapperResolver`: publishers are fail-closed (a secured group with no key source throws rather than emitting plaintext) and subscribers enforce per-reader inbound security. It includes AES-CTR (128/256) policies with HMAC-SHA-256, a deterministic 96-bit nonce with a messages-per-key cap, a monotonic sliding replay window, and a Security Key Service (SKS) pull client + in-memory server with SecurityGroups and key rotation. Two independent security assessments (IEC 62443-4-2 × OPC UA Part 2/4/14, plus a Microsoft SDL/SFI delta pass) drove remediation of all actionable findings — including orphaned message security, chunked-frame security bypass, unauthenticated Action invocation, pre-auth reassembly DoS, and DTLS hardening. See [Security](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/PubSub.md#security) and [SKS](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/PubSub.md#security-key-service-sks). **Server-side & high availability.** The runtime can optionally surface through a standard in-process OPC UA address space (`Opc.Ua.PubSub.Server`) with configuration methods, per-component diagnostics, the full PubSubState model, KeepAlive and MessageReceiveTimeout. Pluggable configuration/runtime-state stores, an id allocator, and HA runtime-state providers with failover support running publishers/subscribers in a distributed system. See [Server-side address space](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/PubSub.md#server-side-address-space) and [High availability](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/PubSub.md#high-availability-state-providers). **External-server adapter (bridge) with hot-reload.** A new `Opc.Ua.PubSub.Adapter` binds PubSub publishers, subscribers, and Action responders to an **external** OPC UA server over `ManagedSession` — cyclic Read or subscription-backed sources, browse-path node mapping, and metadata that resolves/retries and re-emits on model-change events. Adapter and PubSub configuration **hot-reload incrementally** (only changed writers/readers/responders are rewired; unchanged sessions are reused), driven by `IPubSubConfigurationStore.Changed` and `IOptionsMonitor`, with a pluggable change-feed source (e.g. etcd). See [Binding PubSub to an external server](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/PubSub.md#binding-pubsub-to-an-external-opc-ua-server-client-session-adapters). **Samples, packaging & quality.** One combined sample, `ConsoleReferencePubSubClient`, demonstrates publisher, subscriber, and external-server modes on `Host.CreateApplicationBuilder` with full fluent/DI wiring; all libraries publish **NativeAOT with zero IL2026/IL3050 warnings** ([Native AOT](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/PubSub.md#native-aot), [DI](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/DependencyInjection.md)). The change ships comprehensive NUnit/integration suites and a libFuzzer harness, maintains ≥80% coverage on the new libraries, and is documented end-to-end ([What's new in 2.0](https://github.com/OPCFoundation/UA-.NETStandard/blob/part14pubsub/Docs/WhatsNewIn2.0.md)).
137 lines
6.8 KiB
XML
137 lines
6.8 KiB
XML
<Project>
|
|
<PropertyGroup>
|
|
<Product>OPC UA .NET Standard Library</Product>
|
|
<RepositoryUrl>https://github.com/OPCFoundation/UA-.NETStandard</RepositoryUrl>
|
|
<VersionPrefix>2.0</VersionPrefix>
|
|
<VersionSuffix>preview-$([System.DateTime]::Now.ToString("yyyyMMdd"))</VersionSuffix>
|
|
<Copyright>Copyright © 2004-2025 OPC Foundation, Inc</Copyright>
|
|
<PackagePrefix>OPCFoundation.NetStandard</PackagePrefix>
|
|
<AssemblyPrefix>Opc.Ua</AssemblyPrefix>
|
|
<Company>OPC Foundation</Company>
|
|
<Authors>OPC Foundation</Authors>
|
|
<NeutralLanguage>en-US</NeutralLanguage>
|
|
<HighEntropyVA>true</HighEntropyVA>
|
|
<IsPackable>false</IsPackable>
|
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
|
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
|
|
<LangVersion>14.0</LangVersion>
|
|
<!-- to enable package validation, uncomment here -->
|
|
<!--<EnablePackageValidation>true</EnablePackageValidation>-->
|
|
<!-- to check the package validation on a release build, uncomment here -->
|
|
<!--<PackageValidationBaselineVersion>1.5.374.27</PackageValidationBaselineVersion>-->
|
|
<!-- to regenerate the compatibility suppression file, uncomment here -->
|
|
<!--<GenerateCompatibilitySuppressionFile>true</GenerateCompatibilitySuppressionFile>-->
|
|
<NuGetAuditMode>all</NuGetAuditMode>
|
|
<NuGetAudit>true</NuGetAudit>
|
|
</PropertyGroup>
|
|
<PropertyGroup>
|
|
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
|
|
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
|
<RunAnalyzersDuringBuild Condition="'$(RunAnalyzersDuringBuild)' == ''">true</RunAnalyzersDuringBuild>
|
|
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
|
|
<AnalysisLevel>preview</AnalysisLevel>
|
|
<AnalysisMode>all</AnalysisMode>
|
|
<AnalysisModeStyle>default</AnalysisModeStyle>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'">
|
|
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
|
</PropertyGroup>
|
|
<ItemGroup Condition="'$(NoRoslynatorAnalzers)' == ''">
|
|
<PackageReference Include="Roslynator.Analyzers" PrivateAssets="All" />
|
|
<PackageReference Include="Roslynator.Formatting.Analyzers" PrivateAssets="All" />
|
|
</ItemGroup>
|
|
<PropertyGroup>
|
|
<NoWarn>$(NoWarn);NU1510</NoWarn>
|
|
<PackageIcon>images/logo.jpg</PackageIcon>
|
|
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
|
|
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
|
<!--<PackageLicenseExpression>MIT</PackageLicenseExpression>-->
|
|
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
|
|
<PackageReleaseNotes>$(RepositoryUrl)/releases</PackageReleaseNotes>
|
|
<!--
|
|
Every package ships its own package-local README (`NugetREADME.md`
|
|
next to the csproj, or the established `McpREADME.md` for the
|
|
command-line tool package). Per-package READMEs are wired in each
|
|
csproj via <PackageReadmeFile> + a matching <None Include=...
|
|
Pack="true">. A generic shared README at this `common.props`
|
|
level was deliberately removed in favor of per-package READMEs
|
|
because it was misleading on nuget.org (every package described
|
|
itself identically).
|
|
-->
|
|
<PackageTags>OPCFoundation OPC UA ios linux dotnet net netcore</PackageTags>
|
|
</PropertyGroup>
|
|
<PropertyGroup Condition="'$(SignAssembly)' == 'true'">
|
|
<!-- OPC Foundation public key -->
|
|
<PublicKey>0024000004800000940000000602000000240000</PublicKey>
|
|
<PublicKey>$(PublicKey)525341310004000001000100d987b12f068b3580</PublicKey>
|
|
<PublicKey>$(PublicKey)429f3dde01397508880fc7e62621397618456ca1</PublicKey>
|
|
<PublicKey>$(PublicKey)549aeacfbdb90c62adfe918f05ce3677b390f783</PublicKey>
|
|
<PublicKey>$(PublicKey)57b8745cb6e1334655afce1a9527ac92fc829ff5</PublicKey>
|
|
<PublicKey>$(PublicKey)85ea79f007e52ba0f83ead627e3edda40bec5ae5</PublicKey>
|
|
<PublicKey>$(PublicKey)74128fc9342cb57cb8285aa4e5b589c0ebef3be5</PublicKey>
|
|
<PublicKey>$(PublicKey)71b5c8f2ab1067f7c880e8f8882a73c80a12a1ef</PublicKey>
|
|
</PropertyGroup>
|
|
<Choose>
|
|
<When Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net5.0'))">
|
|
<PropertyGroup>
|
|
<!-- Disable strongname warning as that's not been enforced since .net 5.-->
|
|
<NoWarn>$(NoWarn);CS8002</NoWarn>
|
|
</PropertyGroup>
|
|
</When>
|
|
<Otherwise>
|
|
<PropertyGroup>
|
|
<!-- Disable nullable warning as it is not as meaningful on .net framework as on .net -->
|
|
<NoWarn>$(NoWarn);nullable</NoWarn>
|
|
</PropertyGroup>
|
|
</Otherwise>
|
|
</Choose>
|
|
<PropertyGroup Condition="'$(TargetFramework)' == 'net472' OR '$(TargetFramework)' == 'net48'">
|
|
<!--
|
|
The Microsoft.Extensions.* graph used across the stack (Http.Resilience and
|
|
its transitive Telemetry / AmbientMetadata / Diagnostics packages) ships
|
|
net462 assets that build and run on .NET Framework, but their buildTransitive
|
|
support targets still emit "doesn't support net48/net472" warnings. These are
|
|
benign on net462-compatible TFMs, so suppress them once here for all projects
|
|
instead of scattering per-project SuppressTfmSupportBuildWarnings blocks.
|
|
TODO: remove when the library matrix drops .NET Framework or the packages stop warning.
|
|
-->
|
|
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
|
|
</PropertyGroup>
|
|
<ItemGroup Condition="'$(IsPackable)' != 'false'">
|
|
<None
|
|
Include="$(MSBuildThisFileDirectory)/LICENSE.txt"
|
|
Pack="true"
|
|
PackagePath="$(PackageLicenseFile)"
|
|
/>
|
|
<None
|
|
Include="$(MSBuildThisFileDirectory)/nuget/logo.jpg"
|
|
Pack="true"
|
|
PackagePath="$(PackageIcon)"
|
|
/>
|
|
<!--
|
|
Each NuGet package owns its own package-local README -
|
|
`NugetREADME.md` next to the csproj, or the established
|
|
`McpREADME.md` for the command-line tool package. Each csproj
|
|
wires its README via <PackageReadmeFile> and packs the file at
|
|
the package root with
|
|
<None Include="..." Pack="true" PackagePath="\" />.
|
|
A generic shared README would be misleading on nuget.org because
|
|
every package would describe itself identically.
|
|
-->
|
|
</ItemGroup>
|
|
<ItemGroup Condition="'$(NBGV_PublicRelease)' != ''">
|
|
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
|
|
</ItemGroup>
|
|
<!-- Deterministic build is currently not supported for code coverage tests. -->
|
|
<PropertyGroup Condition="'$(CollectCoverage)' != 'true' AND ('$(TF_BUILD)' == 'true' OR '$(GITHUB_ACTIONS)' == 'true')">
|
|
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
|
</PropertyGroup>
|
|
<PropertyGroup>
|
|
<IncludeSymbols>true</IncludeSymbols>
|
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
|
</PropertyGroup>
|
|
</Project>
|