All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Close of TTY client causing
TypeError
to be raised in receive task
- Invalid unpack of date and time from ChainPack for dates before 2018-02-02
- Re-release due to error in this file causing deployment failure
RpcMethodDesc
now correctly handlesnull
for the signal parameterCancelledError
raised from login task when reset is received before login is finished
- Support for WebSockets transport
- NixOS module for pyshvbroker
RpcLogin
now provides password validation algorithm and conversion from and to SHV login parameter- RPC servers now have
terminate
andwait_terminated
method that terminates not server but also its clients - Support for string arguments in places where
RpcUrl
is being used
- Broker's configuration format changed from INI to TOML as well as the concept of the configuractuion changed. Please update your configuration according to the new documentation.
- Broker now filters signals based on the source method not signal name
RpcBrokerConfig
completely rewrittenRpcBroker
client are now registered only if they are activeRpcProtocol.SERIAL
renamed toRpcProtocol.TTY
RpcInvalidParamsError
was renamed toRpcInvalidParamError
RpcErrorCode.INVALID_PARAMS
was renamed toRpcErrorCode.INVALID_PARAM
RpcRI
in favor of using strings andrpcri_*
functions
SimpleBase.ping
now uses.broker/app
instead of.broker/currentClient
on pre-SHV3 brokersis_shvlist
now excludes strings and bytes to not invalidly classify them as listsshvarg
andshvargt
now correctly manages single values and provides them only as for zero index (was for all indexes)RpcServerTTY
no longer raiseasyncio.CancelledError
when its being closed
is_shvtype
andis_shvlist
functions that validates Python object as beingSHVType
andSHVListType
respectively
is_shvmap
andis_shvimap
now inspect also values withis_shvtype
- Compatibility for
RpcSubscription
when all methods are requested SimpleBase
sometimes causing error on exit due to not having any task to finish
- Automatic reconnects for
SimpleClient
init_rpc_client
that only initializesRpcClient
without connecting itRpcMessage.make_response
now accepts result as argument so you can use it as initializator- Support for Access Level for RPC messages
- Support for Client's ID in
SimpleBase
as well as inRpcBroker
. - New RPC error
RpcUserIDRequiredError
- RPC Broker configuration option
config.name
- SHV value getting utilities for common parameter formats (
shvarg
,shvgett
) SimpleBase.dir_exists
that is consistent withSimpleBase.ls_has_child
RpcNotImplementedError
SimpleBase
and thusSimpleClient
method_method_call
has new argumentuser_id
and order of old arguments changes. Please update your code!RpcUrl
login specific options were moved toRpcLogin
.app/broker
and.app/device
were moved to.broker
and.device
according to the SHV 3.0 standardRpcMethodDesc.SIGNAL
renamed toRpcMethodDesc.NOT_CALLABLE
and should not be used and at the same time new fieldRpcMethodDesc.signals
was added. Signals now should be specified there and not as a separate items.SimpleClient
has now new baseSimpleBase
RpcClient.reset
no longer disconnects and instead sends reset signal to peer. TheRpcClient.receive
now receives not only messages but also these control signals.RpcBroker
now lowers access level instead of overwriting it- Command
pycp2cp
renamed to more appropriatepycpconv
RpcBroker.Client
andRpcBroker
API changed to center mount point management inRpcBroker
.RpcSubscription
has now different fields due to subscription changes- The format of logging changed to identify different clients from each other
- Access level numerical values adjusted to match SHV standard
SimpleBase
and thusSimpleClient
no longer provides public ability to send messages and signals. Instead it is now implemented as protected methods and implementations based on it must expose them appropriately if that is required..app:date
SHV RPC method toSimpleBase
- Failing import on Windows
- Subscription are now compared case sensitive (as it should have been)
ValueClient
documentation forprop_change_wait
timeout parameterValueClient.prop_get
now usesmax_age
forget
and correctly uses local cache
rpc_login
andrpc_login_url
in favor ofRpcLogin
SimpleClient.dir_description
that is replaced withSimpleBase.dir_exists
RpcMethodDesc.signal
as it is invalid with latest changesRpcMethodDesc.description
that was replaced withRpcMethodDesc.extra["description"]
- Broker no longer provides
.app/broker/clientInfo
- Broker no longer provides method
.app/broker/currentClient:rejectNotSubscribed
RpcMessage.chng
because that is now default forRpcMessage.signal
- Broker now has ability to establish connection on its own instead of just listening for them
RpcClientPipe
that supports working with Unix pipesRpcServerTTY
that waits for TTY to appear
RpcUrl.password
is now expected to be only string and default value is empty string.RpcUrl.login_type
is nowPLAIN
to be valid for default password value.rpclogin
replacesPLAIN
login withSHA1
for increased security. The new parameterforce_plain
was added to actually usePLAIN
anyway.connect_rpc_client
now usesRpcProtocolSerialCRC
instead ofRpcProtocolSerial
forRpcProtocol.SERIAL
.RpcUrl.parse
now enforces thatshapass
must have 40 characters..app/broker:mountPoints
renamed to.app/bnroker:mounts
according to the standard update.- All methods working with subscription in
.app/broker/currentClient
now use keywordpaths
instead ofpattern
(change in SHV standard) - Methods in
.app/broker
now have access level Super-Service according to the SHV standard - Methods in
.app/broker/currentClient
are now reported with Browse access level but on access the level is not verified at all and thus access is not limited
- Login to RPC Broker with PLAIN password when server has SHA1 configured for that user
.app/broker:mountedClientInfo
is now reported by.app/broker:dir
RpcUrl
now correctly escapes options when converting to URL string and supportsuser
option
pySHV now conforms with work in progress SHV standard 3.0!
SimpleClient.ls_has_child
to query if child node existsSimpleClient.dir_description
to get description of a single methodSimpleClient
now supports multiple call attemptsSimpleDevice
that should be used with devices
RpcMessage
API to now use properties instead of methods- Removed unused argument
login_options
forSimpleClient.connect
SimpleClient.dir_details
is nowSimpleClient.dir
and olddir
implementation is removedRpcClientStream
is replaced withRpcClientTCP
andRpcClientUnix
RpcClientSerial
is replaced withRpcClientTTY
RpcServerStream
is not replaced withRpcServerTCP
andRpcServerUnix
- Broker configuration now no longer contains
rules
sections and instead we specifymethods
inroles
sections. Methods are combination of path and method that is used to identify methods this role is applied to. RpcClient.connected
is not property instead of plain method- Broker now allows all users browse access to the
.app
and read access to the.app/broker/currentClient
. - Received invalid messages are now skipped instead of raising exception.
SimpleClient.login
andSimpleClient.urllogin
renamed and moved torpclogin
andrpclogin_url
respectively
SimpleClient.ls_with_children
as that is now invalid with SHV 3.0- Support of UDP (not part of standard)
ValueClient.wait_for_change
that blocks task until value change is detected.ValueClient.prop_change_wait
that simplifies a common operation of waiting for a new value.ValueClient.get_snapshot
is now able to snapshot multiple paths or subscribed paths if no path is given.ValueClient.clean_cache
method to remove old entried for no longer subscribed paths.ValueClient.prop_get
now supportsmax_age
parameter- Support for UDP/IP protocol
- Initial support for Serial protocol
- Ability to reset the client connection (
RpcClient.reset
)
- URL now uses field
location
instead ofhost
as it is more descriptive considering the usage. - Login is now allowed for local socket because it can be used to elevate access rights of some clients without need to have multiple sockets.
ValueClient
now caches new value for subscribed paths whenprop_get
is used and optionally right onprop_set
.ValueClient.unsubscribe
now callsValueClient.clean_cache
on successful unsubscribe (this can be suppressed with argument).create_rpc_server
returnsRpcServer
instead ofasyncio.Server
- Running pyshvbroker as a standalone application not working
- Packing of
Decimal
in ChainPack that in some cases packed invalid value - Unpacking of strings in Cpon that mangled UTF-8 encoding.
- Packing of
str
in Cpon that invalidly escaped some characters. ValueClient.get_snapshot
no longer fails when node is not implementingls
method.ValueClient.is_subscribed
now correctly matches only paths for subscribed nodes and its children instead of just generic string prefix.ValueClient.prop_get
reports value change only when it really happened.ValueClient.prop_change_wait
implementationRpcUrl
uses local user's name instead of empty string- Handling of idle ping for
SimpleClient
when used only to listen pycp2cp
invocation with file
SimpleClient
that provides simple API to connect to the broker and perform calls as well as to handle requests and signalsRpcError
that represents SHV RPC errorsSHVMeta
and variation on SHV types based on it with companion functions to manage these custom extended types- Small broker implemented purely in Python
RpcMessage.ErrorCode
moved and renamed toRpcErrorCode
RpcClient.read_rpc_message
now raisesRpcError
instead ofRpcClient.MethodCallError
ChainPackWriter
,ChainPackReader
,CponWriter
andCponReader
now requireio.BytesIO
instead ofUnpackContext
andPackContext
RpcMessage
has now attributevalue
instead ofrpcValue
(this is intentional break to force users to review their code due to the type change)RpcClient
methods for sending and receiving RPC messages were replaced withsend
andreceive
methods.rpcclient.get_next_rpc_request_id
was moved toRpcMessage.next_request_id
ClinetConnection
, please useSimpleClient
orValueClient
insteadRpcClient.LoginType.NONE
as login needs to be always performed even when any authentication is accepted to actually pass optionsRpcValue
and instead native types orSHVMeta
based types are usedcpcontext
andctx
attributes ofChainPackWriter
,ChainPackReader
,CponWriter
andCponReader
ChainPack.is_little_endian
as it can be easilly done directly
- Handler lookup in
ClientConnection
now correctly selects longest match rather than shortest
- The original implementation under name
libshv-py
- Methods
shverror
andset_shverror
toRpcMessage
with an appropriate SHV error format RpcServer
that listens for new client connectionsRpcClient.disconnect
method to disconnect the connection
- Top-level package
chainpack
renamed toshv
RpcValue
now explicitly converts Python representation to its internal one and also back- Tags and Keys in
RpcMessage
are now in Enum instead of being constants RpcClient
's methodconnect
is now class method that creates new instanceRpcClient
now has to he initialized with writter and readerRpcClient.LoginType
are now capitalized to match Python paradigmRpcClient.State
is removed
- Terminate loop of
RpcClient
on EOF - Packing of empty string