A number of smaller fixes, as well as some improvements to codegen, and the release of the async-opcua-codegen crate.
- Improved structured tracing per request.
- Add
Session::close_on_drop()which creates a way to have an owned guard that when dropped signals the session to close.
- Most client methods now return
opcua_types::Errorinstead ofStatusCode. In some cases this will include more information about what caused the error, which might make debugging easier without relying on logging.
- Do not ack keep-alive messages.
- Discard acknowledgements when transfering subscriptions.
- Correctly verify certificate in CreateSession responses.
- Correctly avoid reusing nonces for
ActivateSessioncalls.
- Fixed a mismatch with the standard when decoding
Argument. - Fixed our binary encoding of Guids. Turns out OPC-UA uses microsofts pseudo-LE encoding, while we were using the UUID BE encoding.
- Changed the default minimum refresh rate of the
SyncSamplerto a more reasonable value. - Do not resend keep-alive messages, to comply with the standard.
- Make sure the server itself is added to its
ServerArray. - Fixed a bug causing nodeset imports to fail due to missing
index_map.
- Codegen is now released as
async-opcua-codegenon crates.io. - Properly derive data type definition and base data type when creating node hierarchies from NodeSet2 files.
Mostly bug fixes and refactoring, some of which is externally visible.
- Fix race condition when creating monitored items causing the first message to sometimes be missed.
- Fix an error causing sequence numbers to get out of sync after a cancelled or timed out request.
- Correctly accept values between 1 and 1024 for the initial sequence number from the server.
- Refactor the internal transport representation and expose a generic
StreamTransportandStreamConnectorwhich can be used to build custom transports over OPC-UA binary. - The client event loop is now generic over the transport layer. Most usage should not be affected, but if you ever pass the event loop between functions you will need to change the signature.
- Expose
MonitoredItemMapto make it possible to create custom subscription callbacks more easily.
- Refactor crypto internals in preparation of ECC support. Unless you use the OPC-UA crypto primitives directly, this should not affect you at all.
Fix to a critical issue in the client causing a busy-loop.
- Fixed issue causing a busy loop in the subscription event loop in the client.
A number of important fixes, some affecting the core protocol. Improvements to codegen, support for reverse connect, and a few other features.
- Treat empty remote certificate as missing during channel establishment.
- Treat empty as null in a few more cases. Some misbehaving clients or servers send empty values instead of null values, but we can treat them the same in a few cases.
- Add fallback type loader, enabled by default. This captures
ExtensionObjectpayloads without a matching type loader. - Added
NodeIdRefand use this in a few places that acceptNodeIds. This lets you pass, for example,(1, "hello")as a node ID, instead of needing to construct an owned copy. - Add support for OPC-UA reverse connect.
- Add support for environment variable expansion in config files.
- Added a
ValueRanktype, which is convenient in both client and server applications.
- Fixed nonces created as part of CreateSession, which fixes support for SHA128 legacy encryption.
- Correctly use
max_chunk_countfrom config in the connection. - Fixed issue that caused a race condition during secure channel renewal.
- Certain errors from the subscription event loop are now forwarded to the main event loop, meaning that subscriptions can act as a keep alive in some cases.
- Fixed issue causing the available sequence numbers sent to the client to not include the sequence number of the publish itself.
- Add support for OPC-UA reverse connect.
- Delay notifications that arrived too early, to emulate actually sampling the data. This avoids losing information if values are reported irregularly.
- Correctly set
DefaultEncodingIdin nodeset code generation. - Add support for dependent nodesets during types codegen.
- Removed unused functionality to load
documentation.csvfiles as part of nodeset codegen.
Various fixes and adjustments. Support for IssuedToken authentication and OfType event filters.
- Improve logic for dealing with sequence numbers, and add internal support for the new kind of sequence numbers defined in recent versions of the OPC-UA standard.
- Added a comprehensive sample with multiple node managers to showcase more complex uses of the server SDK.
- Option to enable lock tracing. Set the environment variable
OPCUA_TRACE_LOCKSto enable. This can be useful for debugging deadlocks.
- Support for
IssuedTokenbased authentication. Actually obtaining the token will require custom code. - Pause the publishing loop when receiving
BadNoSubscriptionfrom the server. This typically happens due to a race-condition or an issue on the server. - The
OnSubscriptionNotificationCoretrait is used as a base for subscription notifications, making it possible to control, on a low-level, the exact behavior when a publish notification is received.
- Ignore port when matching server endpoints, which better adheres to the standard and is in general more correct.
- Make the subscription services stateless. This is a breaking change if you are using the low-level subscription services directly. They no longer require the session subscription state, instead assuming that the caller will correctly track state and produce publish requests.
- Support for
IssuedTokenbased authentication, you will need to use a custom authenticator that does the necessary validation. - Support for the
OfTypeoperator in event subscriptions. This uses theTypeTreeForUser, so different users can see different type trees here too, like in other services. - Expose the
TcpConfigandCertificateValidationstructs in server config.
- Fixed a panic caused by updating a variable to a time before the latest value while clients were subscribed to that value.
- Fixed an issue where we would incorrectly increment subscription sequence numbers for keep-alive messages.
- Infer namespace URIs from the schema instead of requiring them to be specified in config. This makes it easier to configure custom codegen, and is less likely to cause issues.
Fix to a build issue in types when compiling with the xml feature but not the json feature,
or only json and not xml.
- Fix build of
async-opcua-typeswhen only one of thejsonorxmlfeatures are enabled.
Further changes and polish of the library. This release adds more comprehensive support for XML and JSON encoding, fixes a few bugs, and improves the ergonomics of defining custom types on servers.
- Support for
StructureWithOptionalFields - A common
OpcUaErrortype used in a few places when parsing and building common types. - Support for
Unionsin encoding macros, whenEncodable/Decodableare derived on rust enums. - Replace
FromXmlwithXmlEncodableandXmlDecodable, adding full support for OPC-UA XML. - Support for XML in JSON and binary extension object payloads.
- The
#[ua_encodable]attribute macro, to automatically derive all the encodable traits with appropriate features.
- Fix issues related to unions in custom structs.
- Properly clear padding in legacy encrypted token secrets.
- The
console_loggingfeature has been removed. You need to use a library like env_logger to enable logging instead.
- Implement a few more server diagnostics.
- Fix the data type of server capabilities, should be
u16, notu32. - Make
NodeId::next_numnericstart at 1, not 0.
- The simple node manager will now write values to memory if nodes are set to writable but no write callback is provided.
- Logging now uses
tracing. Behavior should be mostly the same, but if you want to have tracing on your server, it should now be much simpler to implement. We write tracing events to logging, so no additional action is necessary if you just want to log like before.
- Support for using
NodeSet2.xmlfiles for types codegen. - Better system for reusing XML files over different codegen targets.
- Numerous improvements to custom codegen.
- Logging in
async-opcua-codegennow useslog, enabled by default.
First release of the async-opcua library. Version number picks up where this forked from opcua. This changelog is almost certainly incomplete, the library has in large part been rewritten.
- The libraries are now named
async-opcua-*. The root module is stillopcua. Do not use this together with the old opcua library. ExtensionObjectis now stored as an extension ofdyn Any.- We no longer depend on OpenSSL, all crypto is now done with pure rust crates.
- Generated types and address space now targets OPC-UA version 1.05.
- The library is separated into multiple crates. Most users should still just depend on the
async-opcuacrate with appropriate features. - A number of minor optimizations in the common comms layer.
async-opcua-xml, a library for parsing a number of OPC-UA XML structures. Included inasync-opcuaif you enable thexmlfeature.async-opcua-macros, a common macro library forasync-opcua. Macros are re-exported depending on enabled features.- Basic support for custom structures.
- Much more tooling around generated code, enough that it should be possible to implement a companion standard using the same tooling that generates the core address space. See samples/custom-codegen.
- A number of deviations from the standard and other bugs related to generated types.
- A few common issues in encoding, and opc/tcp.
- Generated certificates are now fully compliant with the OPC-UA standard.
- The server library is rewritten from scratch, and has a completely new interface. Instead of defining a single
AddressSpaceand simply mutating that, servers now define a number ofNodeManagers which may present parts of the address space in different ways. The closest equivalent to the old behavior is adding aSimpleNodeManager. See docs/server.md for details. - The server no longer automatically samples data from nodes. Instead, you must
notifythe server of changes to variables. TheSyncSamplertype can be used to do this with sampling, and theSimpleNodeManagerdoes this automatically. - The server is now fully async, and does not define its own tokio runtime.
- It is now possible to define servers that are far more flexible than before, including storing the entire address space in databases or external systems, using notification-based mechanisms for notifications, etc.
- Tools for managing the server runtime, including graceful shutdown notifying clients, tools for managing the service level, and more.
- The web interface for the server has been completely removed.
- The client is now fully async, and does not define its own tokio runtime. All services are async.
- The client is now able to efficiently restore subscriptions on reconnect. This can be turned off.
- There are a few more configuration options.
- A flexible system for request building, making it possible to automatically retry OPC-UA services.
- A builder-pattern for creating OPC-UA connections, making the connection establishment part of the client more flexible.