Skip to content

CipherMQ 1.8.0

Latest

Choose a tag to compare

@Emasoumi Emasoumi released this 15 Sep 07:27
· 1 commit to main since this release

✨ New: Role-based Access Control

  • New server/src/acl.rs: Role (sender / receiver / admin / unknown),
    AclManager (mTLS certificate CN → role), AuthResult, and a documented
    command permission matrix. Covered by unit tests for every role.
  • ACL is enforced in two places:
    • Connection time unknown CNs are rejected immediately with
      Access denied: unrecognized client identity.
    • Per command each command is validated against the role's permission matrix;
      denied commands receive Access denied: <reason> (role=<role>).
  • The admin console now verifies that connecting clients hold an admin CN before
    serving status or metrics data.

🔧 Configuration

  • New [acl] section in server/config.toml:
    sender_cns, receiver_cns, admin_cns.
  • [admin].allowed_cns now restricts which CNs may query the admin endpoint.

⚠️ Upgrade notes

  • The default ACL is deny-all: any client whose CN is not listed in [acl] is
    rejected at connection time. Populate [acl] (or [admin].allowed_cns) before
    upgrading an existing deployment, otherwise connected clients will be refused.

✨ New: Prometheus-compatible metrics

  • New server/src/metrics.rs with lock-free AtomicU64 counters and gauges.
  • Counters: ciphermq_messages_published_total, ciphermq_messages_acked_total,
    ciphermq_messages_delivered_total, ciphermq_errors_total, ciphermq_connections_total,
    ciphermq_connections_rejected_rate_limit_total,
    ciphermq_connections_rejected_conn_limit_total, ciphermq_requests_rate_limited_total.
  • Gauges: ciphermq_connected_clients, ciphermq_queue_count,
    ciphermq_messages_in_queues, ciphermq_consumer_count, ciphermq_uptime_seconds.
  • Exporter renders plain Prometheus text format, ready to scrape.

✨ New: Token-bucket rate limiting

  • New server/src/rate_limiter.rs: global per-CN request bucket plus a separate
    publish bucket, and per-IP / per-CN concurrent connection caps.
  • Defaults: global_rps = 100, global_burst = 200, publish_rps = 50,
    publish_burst = 100, max_connections_per_ip = 50, max_connections_per_cn = 20.
  • Rate-limited requests receive Rate limited; connections rejected by the connection
    limits are closed silently.

✨ New: Admin console & real-time dashboard

  • New mTLS-secured admin listener (server/src/admin_server.rs) with commands:
    status, json, metrics, queues, connections, quit/exit.
  • JSON node status exposes queues, bindings, exchanges and connection statistics.
  • New admin web dashboard (Axum + HTML) that polls the admin endpoint and renders live
    server health, uptime, queue details, the binding map, per-IP/per-CN connections and counters.

✨ New: Heartbeat monitoring

  • Receivers send periodic heartbeats; the server tracks last-seen time per client and
    cleans up timed-out connections automatically.

🔧 Sender client rework

  • Semaphore-bounded async pipeline with configurable max_inflight for backpressure.
  • Retries with exponential backoff (max_retries, ack_timeout_secs) and TCP connect timeout.
  • Multi-receiver fan-out via receiver_client_ids, batch pacing
    (batch_size, batch_delay_ms), and templated message bodies
    ({sender_id}, {correlation_id}, {timestamp}, {seq}, plus extra_fields).
  • Final throughput and failure-count reporting.

🔧 Receiver client rework

  • Public key registration, push consumption, decryption, message_id deduplication,
    JSONL persistence (data/received_messages.jsonl), ACK with retries, automatic
    reconnect on connection loss, and periodic heartbeats.

🔧 Configuration

  • New server sections with sensible serde defaults (backwards compatible when omitted):
    [performance], [admin], [rate_limit].
  • Client config.json schemas changed for sender, receiver and admin clients.

⚠️ Upgrade notes

  • server/src/admin_server.rs, metrics.rs and rate_limiter.rs are new modules; the
    server must be rebuilt.
  • Existing clients/*/config.json files must be updated to the new schema
    (sender.max_inflight, ack_timeout_secs, tcp_connect_timeout_secs, receiver_client_ids,
    admin.poll_interval_secs, server.admin_address, etc.).
  • [rate_limit].enabled and [admin].enabled default to false enable explicitly.