Expand DI / Fluent API: injectability + one-shot ergonomics (client, server, PubSub, discovery/bindings) - #8
Closed
marcschier wants to merge 1 commit into
Closed
Conversation
…ient, server, PubSub and discovery/bindings Completes the dependency-injection / fluent-API review follow-up so every feature is reachable and configurable from the services.AddOpcUa() chain, while keeping all existing granular registrations and direct-construct fallbacks (backward compatible; the one rename keeps an [Obsolete] alias). Client: chainable IOpcUaClientBuilder overloads (AddComplexTypes/AddAlarms/ AddWebApiTransportChannel); ManagedSessionOptions.LoadComplexTypes + AddManagedClient(); injectable multi-endpoint IManagedSessionFactory; DI factories AddHistorian/ AddRoleManagement/AddFileTransfer/AddAliasNames; options fail-fast validation + AddDiscovery(). Server: IOpcUaServerFactory / AddServer<TServer>() seam -> injectable durable subscriptions, session/subscription managers; AddHistorian, AddFileSystem (Part 20), AddSecretStore/AddCertificateManager/AddAliasNameStore; secure-by-default anonymous authenticator (marker-guarded). PubSub: AddUdpPubSub()/AddMqttPubSub() one-shots; IPubSubBuilder anchor unification (SKS/schema/pcap); ConfigureConfiguration(); IMqttTransportBuilder parity; order-independent pcap decoration. Discovery/Bindings: fail-loud non-TCP endpoints; GDS AddInMemoryStores()/fast-fail; order-independent AddHttpsTransport() one-shot; AddAuthorizationService ([Obsolete] alias for WithAuthorizationService), root-level AddPcap(), WotCon prerequisite guard. Docs updated (DependencyInjection.md, PubSub.md, Transports.md, WebApi.md). Validated: 12 libraries + 9 test projects build clean on net10.0 and net48; full net10 sweep ~7,700 tests pass; net48 new-feature suites pass.
Owner
Author
|
Superseded — retargeted to upstream OPCFoundation#3957. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Completes the dependency-injection / fluent-API review follow-up so that every feature is reachable and configurable from the
services.AddOpcUa()chain, while keeping all existing granular registrations and direct-construct (new) fallbacks. The change is backward compatible — the single rename (WithAuthorizationService→AddAuthorizationService) keeps an[Obsolete]alias.Client — chainable
IOpcUaClientBuilderoverloads ofAddComplexTypes/AddAlarms/AddWebApiTransportChannel;ManagedSessionOptions.LoadComplexTypes+AddManagedClient()one-shot; injectable multi-endpointIManagedSessionFactory; DI factoriesAddHistorian/AddRoleManagement/AddFileTransfer/AddAliasNames; fail-fast options validation +AddDiscovery().Server —
IOpcUaServerFactory/AddServer<TServer>()seam (the hosted service no longer hardcodesnew StandardServer) unlocking injectable durable subscriptions and session/subscription managers; plusAddHistorian,AddFileSystem(Part 20),AddSecretStore/AddCertificateManager/AddAliasNameStore; secure-by-default anonymous authenticator (marker-guarded, no double-registration).PubSub —
AddUdpPubSub()/AddMqttPubSub()one-shots;IPubSubBuilderanchor unification (AddSecurityKeyServiceClient/Server/PushTarget,AddSchema,AddPcapCapture);ConfigureConfiguration()config-authoring bridge;IMqttTransportBuilderparity with UDP/Eth; order-independent pcap decoration.Discovery / Bindings — LDS/GDS non-TCP endpoints fail loudly instead of silently; GDS
AddInMemoryStores()+ fast-fail when stores are missing; order-independent one-shotAddHttpsTransport()(Kestrel + HTTPS/WSS + optional WebApi/auth);AddAuthorizationService([Obsolete]alias forWithAuthorizationService); root-levelIOpcUaBuilder.AddPcap(); WotCon-server-without-AddServerstartup guard.Docs updated:
Docs/DependencyInjection.md,Docs/PubSub.md,Docs/Transports.md,Docs/WebApi.md.Validation performed locally: the 12 changed libraries and 9 affected test projects build clean (0 warnings / 0 errors) on net10.0 and net48; the full net10.0 sweep of the affected suites passes (~7,700 tests — Server 1920, GDS 904, LDS 149, Client 1577, ComplexTypes 2733, PubSub 1141 + Diagnostics 53, WotCon 344, HTTPS.WebApi 319); the net48 new-feature suites pass (Client 123, Server 43, PubSub 49, GDS 21, LDS 10, WotCon 8, ComplexTypes 7).
Related Issues
Follow-up to an internal DI / Fluent-API surface review (no single tracking issue). Happy to open a tracking issue / ADR if maintainers prefer before merge.
Checklist
Put an
xin the boxes that apply. You can complete these step by step after opening the PR.