Skip to content

Add gRPC protocol definition for HedgehogPanel in proto package#7

Draft
Batacek wants to merge 1 commit intomasterfrom
HedgehogProto
Draft

Add gRPC protocol definition for HedgehogPanel in proto package#7
Batacek wants to merge 1 commit intomasterfrom
HedgehogProto

Conversation

@Batacek
Copy link
Copy Markdown
Owner

@Batacek Batacek commented Mar 30, 2026

gRPC integration — shared protocol, Daemon server, Panel client

Overview

Implements the full gRPC integration layer between HedgehogPanel (C#) and HedgehogDaemon (Rust). Defines a shared .proto contract and implements both sides — Daemon as gRPC server, Panel as gRPC client — verified by an end-to-end integration test.


Checklist

  • proto/hedgehog.proto — shared contract definition
  • Daemon (Rust) — add tonic + prost, implement gRPC server
  • Panel (C#) — add Grpc.AspNetCore + Grpc.Tools, implement gRPC client
  • Integration test — mock server + client, verify end-to-end connectivity

Protocol structure (hedgehog.v1)

Shared types

  • ErrorCode — unified error enum used across all responses
  • Status — daemon health status (STATUS_OK, STATUS_ERRORED, STATUS_UNKNOWN)
  • AuthContext — reusable authentication context (panel_uuid + token) passed in every authenticated request

Endpoints defined

RPC Auth Description
PublicHealthCheck Basic liveness check, intentionally returns minimal information without authentication
DetailedHealth Full metrics (CPU, RAM, processes, uptime) including public health status
RegisterPanel Exchange a one-time installation code for a long-term token
Handshake Verify token validity for an existing Panel↔Daemon relationship

Design decisions

  • Public health intentionally omits daemon_uuid and version — endpoint is unauthenticated and publicly accessible, exposing daemon identity would be an unnecessary information leak
  • DetailedHealthResponse embeds PublicHealthCheckResponse — reuses status, error_code and uptime fields without duplication
  • ErrorCode is defined at package level — shared across all messages instead of being duplicated per-message
  • Many-to-many Panel↔Daemon support via AuthContext — each Panel+Daemon pair has its own token, Daemon identifies the caller via panel_uuid + token lookup

Compatibility guarantees

  • Field tags are final and will never be reordered or reused
  • Removed fields will always be marked with reserved
  • New fields will always use new tag numbers
  • Breaking changes will bump the package version to hedgehog.v2

Files changed

  • proto/hedgehog.proto
  • Cargo.toml
  • build.rs
  • HedgehogPanel/HedgehogPanel.csproj
  • HedgehogPanel/Infrastructure/Daemon/ (gRPC client)

@Batacek Batacek self-assigned this Mar 30, 2026
@Batacek Batacek linked an issue Mar 30, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gRPC Interface Definition (Hedgehog Proto)

1 participant