hero/interfaces/websocket/server
Timur Gordon 8ed40ce99c wip
2025-08-01 00:01:08 +02:00
..
cmd wip 2025-08-01 00:01:08 +02:00
docs wip 2025-08-01 00:01:08 +02:00
examples end to end job management support 2025-07-30 08:36:55 +02:00
src wip 2025-08-01 00:01:08 +02:00
tests initial commit 2025-07-29 01:15:23 +02:00
.DS_Store initial commit 2025-07-29 01:15:23 +02:00
.env.example initial commit 2025-07-29 01:15:23 +02:00
.gitignore initial commit 2025-07-29 01:15:23 +02:00
Cargo.lock wip 2025-08-01 00:01:08 +02:00
Cargo.toml wip 2025-08-01 00:01:08 +02:00
openrpc.json initial commit 2025-07-29 01:15:23 +02:00
README.md wip 2025-08-01 00:01:08 +02:00

server: The Hero WebSocket Server

An OpenRPC WebSocket Server to interface with the cores of authorized circles.

  • OpenRPC Specification defines the API.
  • There are RPC Operations specified to authorize a websocket connection.
  • Authorized clients can manage jobs.
  • The server uses the [supervisor] to dispatch [jobs] to the [workers].

Circles

Circles are contexts which a hero can act in. Each circle has a unique public key and a set of members. The server offers a separate path for each circle.

Authentication

The server provides a robust authentication mechanism to ensure that only authorized clients can execute scripts. The entire flow is handled over the WebSocket connection using two dedicated JSON-RPC methods:

  1. fetch_nonce: The client requests a unique, single-use nonce (a challenge) from the server.
  2. authenticate: The client sends back the nonce signed with its private key. The CircleWs actor verifies the signature to confirm the client's identity.

For a more detailed breakdown of the authentication architecture, please see the ARCHITECTURE.md file.

How to Run

cargo run