agentlink

package
v0.1.35 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package agentlink contains the versioned signed-link handshake shared by the panel and node agent.

Index

Constants

View Source
const MaxFrameSize = 4 << 20

MaxFrameSize is the maximum encoded link frame size in bytes (4 MiB).

Variables

View Source
var ErrFrameTooLarge = errors.New("link frame too large")

ErrFrameTooLarge reports a link frame whose encoded payload exceeds MaxFrameSize.

Functions

func AgentDigest

func AgentDigest(nodeID, audience string, panelNonce []byte) []byte

AgentDigest hashes the mistgate-agent-link/1 domain, NUL-separated node ID and audience, and panel nonce with SHA-256.

func PanelDigest

func PanelDigest(nodeID, audience string, panelNonce, agentNonce []byte) []byte

PanelDigest hashes the mistgate-panel-link/1 domain, NUL-separated node ID and audience, and concatenated nonces with SHA-256.

func ReadFrame

func ReadFrame(ctx context.Context, ws *websocket.Conn) (websocket.MessageType, []byte, error)

ReadFrame reads one WebSocket frame and rejects payloads larger than MaxFrameSize.

func Sign

func Sign(key *ecdsa.PrivateKey, digest []byte) ([]byte, error)

Sign signs digest and encodes the ECDSA signature as fixed-width r||s: two 32-byte big-endian scalars.

func Verify

func Verify(key *ecdsa.PublicKey, digest, signature []byte) bool

Verify reports whether digest matches the fixed-width 64-byte r||s ECDSA signature.

func WriteFrame

func WriteFrame(ctx context.Context, ws *websocket.Conn, message proto.Message) error

WriteFrame protobuf-encodes message as a binary WebSocket frame capped at MaxFrameSize.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL