CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

tokio-rs/axum

Scanned commit f8b02f22cf dated 2026-09-30 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/tokio-rs/axum ↗ · 500 files · 1.7 MB

axum axum is an HTTP routing and request-handling library that focuses on ergonomics and modularity.

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (395s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

Overview

Axum is a Rust HTTP routing and request-handling library for developers building asynchronous services with Tokio, Hyper, and Tower. Its distinctive interface connects ordinary async handlers to typed request extractors and response conversions, while reusing Tower middleware rather than introducing a separate middleware protocol. This brief examines commit f8b02f22cf10bee707bda19b58265b9e33677535, including the four library crates, every listed binary entrypoint, selected internals, tests, and CI; the inspection is bounded, and no repository code or tests were executed.

System map

The repository is a library ecosystem with application examples, rather than one deployable service. The root workspace divides foundational contracts, HTTP execution, optional utilities, and procedural macros across four crates. Example binaries assemble their own listeners, application state, middleware, and external integrations in a separate workspace. Build and release behavior is described by Cargo manifests and GitHub Actions.

Feature catalog

The principal user-facing surface is Rust APIs for routing, typed request extraction, middleware composition, and response generation. Feature flags add protocol and serialization capabilities without making every dependency mandatory. Optional crates extend the surface with cookies, typed routes, streaming formats, and compile-time diagnostics. The inspected examples demonstrate authentication, database access, forms, validation, static assets, TLS, and live connections.

Data flow

Incoming connections are converted into per-connection services, and incoming HTTP bodies are normalized before routing. Path matching enriches request extensions, method dispatch selects an endpoint, and handler adapters construct typed arguments in sequence. Response conversion provides the common output boundary for successful values and rejections. Durable data, session storage, and file writes are owned by example applications rather than the routing library.

Behavior traces

The inspected flows span library execution and concrete example applications. Server startup proceeds from application construction to listener acceptance and Hyper connection execution. Request processing includes conditional rejection before business logic, while authentication and persistence examples introduce additional state and network boundaries. These traces describe source execution order; none were exercised at runtime.

Testing signals

Tests and CI were inspected, not executed; test existence is not evidence of a passing result. The inspected suite combines Tokio runtime tests, direct Tower service calls, real HTTP/WebSocket clients, and nightly compile-time fixtures. Assertions cover several important protocol and rejection behaviors, while individual example tests have narrower scopes. This is a bounded assessment without measured coverage or live integration verification.

Risk map

These findings are source observations and explicitly identified hypotheses, not confirmed vulnerabilities. The main boundaries worth reviewing are request resource limits, example authentication, network integrations, HTML generation, database startup, and upload IO. Framework safeguards have conditions: extractor-local limits do not cover every body consumer, and middleware placement affects which requests receive protection. Example code should be assessed in its deployment context before reuse.

Extension points

Extensions are expressed through Rust traits, router builders, Cargo features, and generated implementations. Applications can add typed request inputs and outputs without changing the router internals. Tower services and layers supply middleware composition, while Listener and Executor customize serving within the Tokio/Hyper architecture. axum-extra and axum-macros provide additional integration points for typed routes, cookies, and generated extraction.

Contributor handoff

Start future work from the pinned source and the owning crate rather than assuming released behavior matches main. Keep changes aligned with crate boundaries, feature gates, and the distinction between library contracts and runnable examples. Tests and CI were inspected, not executed; future execution needs its own authorization and reported results. This brief is bounded and does not establish whole-repository coverage, live integration health, or confirmed vulnerabilities.

Languages

LanguageFilesShare of source
Rust30180%
TOML6417%
Markdown39docs/config
HTML8docs/config
JavaScript51%
YAML5docs/config
SQL41%
JSON2docs/config

Start reading here

Probable source entrypoint: Cargo.toml — inferred from the directory tree and manifest, not the upstream docs.

Source roots

axum/ (85 files)

Source layout — axum/

PathFiles
axum/benches/1
axum/src/79
axum/tests/1
axum/CHANGELOG.md1
axum/Cargo.toml1
axum/LICENSE1
axum/README.md1

Repository structure

Top-level pathFiles
axum-macros/184
examples/153
axum/85
axum-extra/37
axum-core/23
.github/8
contrib/1

Docs found: CONTRIBUTING.mdREADME.md

Package

Cargo.toml — , 0 declared dependencies.

CI & config entrypoints

Structural health signals

Average score 6.7/10 across 96 analyzed source files; 27 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history