enigma-signaling 0.0.1

Canonical signaling messages (SDP/ICE) for Enigma. No network layer.
Documentation

enigma-signaling

Canonical JSON encoding for Enigma signaling envelopes (SDP/ICE) with strict validation.

Features

  • Typed signaling envelope with UUID identifiers
  • Strict serde JSON codec (unknown fields rejected)
  • Validation helpers for sender/receiver ids, timestamps, and media payloads

Quick start

use enigma_signaling::{decode, encode, validate, SignalingEnvelope, SignalingKind};
use uuid::Uuid;

let envelope = SignalingEnvelope {
    id: Uuid::new_v4(),
    from: "caller".to_string(),
    to: "callee".to_string(),
    ts_ms: 1,
    kind: SignalingKind::Offer {
        sdp: "v=0...".to_string(),
    },
};

validate(&envelope)?;
let json = encode(&envelope)?;
let roundtrip = decode(&json)?;
assert_eq!(roundtrip.kind, envelope.kind);

Validation rules

  • from and to are non-empty and at most 64 chars
  • ts_ms is strictly positive
  • Offers/answers require non-empty SDP
  • ICE candidates require non-empty candidate
  • Unknown JSON fields are rejected

License MIT 2025 Sébastien TOUILLEUX (Gladius33)