]> nmode's Git Repositories - signal-cli/commit
Exposing Signal CLI as HTTP Server (#1078)
authorced-b <cedric@cos.flag.org>
Wed, 2 Nov 2022 16:44:12 +0000 (12:44 -0400)
committerGitHub <noreply@github.com>
Wed, 2 Nov 2022 16:44:12 +0000 (17:44 +0100)
commit1ad0e94b640d16a8d832287362e1785c78d3ec49
treea5b8f51ede9bb8cb66f7720f92287720e58f796f
parent43face8ead95344e3d0dcbc94c6cf85959f26203
Exposing Signal CLI as HTTP Server (#1078)

* Add initial proof of concept for http server

* Add support for registration commands

* Add support  for MultiLocalCommands

* Improve handling of HTTP responses

Makes it so that responses area all uniformly JSON and wrapped
into the proper response envelope.

* Add caching for workflows

* Run http server with daemon command

This fits the existing command line API better

* Wrap the existing JSON RPC handler in HTTP Service

This is a redesign of earlier attempts to make an HTTP service. Fixing
that service turned out that it would have to be a copy of the
SignalJsonRpcDispatcherHandler. So instead of copy pasting all the
code the existing service is simply being wrapped.

* Switch http server to use command handler

* Clean up and simplification

* Pass full InetSocketAddress

* Minor fixes and improvements

Based on code review.

Co-authored-by: cedb <cedb@keylimebox.org>
src/main/java/org/asamk/signal/commands/DaemonCommand.java
src/main/java/org/asamk/signal/http/HttpServerHandler.java [new file with mode: 0644]
src/main/java/org/asamk/signal/jsonrpc/SignalJsonRpcCommandHandler.java