Development

Guide for contributors and developers working on Zentinel and its ecosystem.

Quick Start

# Clone and build
git clone https://github.com/zentinelproxy/zentinel.git
cd zentinel
cargo build --release

# Run tests
cargo test

# Check formatting and lints
cargo fmt --check
cargo clippy

Section Overview

GuideDescription
Building from SourceCompile Zentinel and agents from source
Development SetupIDE configuration, recommended tools
Code StyleFormatting, naming conventions, best practices
TestingTesting strategy and philosophy
Unit TestsWriting and running unit tests
Integration TestsEnd-to-end testing with real connections
Load TestingPerformance and stress testing
ContributingHow to contribute to the project
Pull Request ProcessSubmitting and reviewing PRs
Release ProcessVersioning and release workflow

Repository Structure

zentinel/
├── src/
│   ├── main.rs              # Entry point
│   ├── config/              # KDL configuration parsing
│   ├── server/              # HTTP server, listeners
│   ├── routing/             # Route matching, upstream selection
│   ├── proxy/               # Request/response proxying
│   ├── agents/              # Agent client, protocol handling
│   ├── health/              # Health checks
│   └── observability/       # Metrics, logging, tracing
├── tests/
│   ├── unit/                # Unit tests
│   └── integration/         # Integration tests
├── benches/                 # Benchmarks
└── examples/                # Example configurations

Agent Repositories

Each agent is maintained in its own repository:

AgentRepository
WAFzentinel-agent-waf
ModSecurityzentinel-agent-modsec
Authzentinel-agent-auth
Rate Limitzentinel-agent-ratelimit
JavaScriptzentinel-agent-js
AI Gatewayzentinel-agent-ai-gateway
WebSocket Inspectorzentinel-agent-websocket-inspector

Agent Protocol

All agents use the shared protocol library:

[dependencies]
zentinel-agent-protocol = "0.1"

See Agent Development for creating custom agents.