- define protocols.ClientHandler interface as base for client implementations
- implement protocols.ClientHandler in clientsim's ClientHandler type
- move protocol state handling into protocols.ServerProtocol and
protocols.ClientProtocol
- move protocolState type into protocols.go
- reduce clientsim's TestCommandGenerator responsibility to test command
generation
- rename protocols.Handler to ServerHandler
- rename ServerHandler methods to better express their purpose
- pass command and response as parameters
- simplify state machine and handle errors in serial/seriallink.go
- implement command read timeout
- remove currentCommand and currentResponse fields from MsgPackHandler
- add a client generated command ID for tracing commands and responses
- define protocol delimiter in protocol.CobsDelimiter
- apply code simplifications suggested by golangci-lint
- add Makefile
- add compile time build information for signer binary
- make sure that dependencies for msgpackgen survive go mod tidy
- extract MsgPackHandler into its own file
- add CRL number to fetch CRL response
- remove port.Flush() to avoid removing written data before it reaches the
client
This commit changes the wire protocol to split between command
announcement and command payload to allow proper typing of sent and
received msgpack messages.
CRL fetching has been implemented as second command after the existing
health check command.
This commit adds basic serial link and protocol support. None of the commands
from the docs/design.md document is implemented yet.
The following new packages have been added:
- seriallink containing the serial link handler including COBS decoding and
encoding
- protocol containing the protocol handler including msgpack unmarshalling
and marshaling
- health containing a rudimentary health check implementation
- messages containing command and response types and generated msgpack
marshaling code
A client simulation command has been added in cmd/clientsim.
README.md got instructions how to run the client simulator. The
docs/config.sample.yaml contains a new section for the serial connection
parameters.