guard/docs/roadmap/v0.5-grpc-plugin.md
loki5512344 280284667f
docs: per-task roadmap, architecture and changelog
- Split TODO into a thin status index plus docs/roadmap/ with one file per
  task (v0.4 reliability, v0.5 product, v0.6 research, icebox).
- Add docs/architecture.md (current processes, packet/data path, layers,
  storage, metrics) and docs/development.md (rules, gates, DoD).
- Add CHANGELOG.md reconstructed from history; move round details out of
  TODO.
- Align docs with the code: config defaults and missing [detect]/
  [protocol.http] sections, XDP metric names, ClickHouse table and TTL,
  Redis RDB restore, multiarch clang include, CLI binary name.
- Add scripts/check_docs_links.sh and run it in CI.
- release profile: thin LTO + one codegen unit. Binary 12.3 MB -> 9.7 MB,
  http parser bench 314 ns -> 278 ns; panic=abort stays off for
  catch_unwind in the Redis subscriber.
- Drop the unused JWT role claim; fix 'rampart doctor' hints in the CLI.
2026-11-16 14:51:50 +01:00

45 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# v0.5 — gRPC protocol plugin
| | |
|---|---|
| Milestone | v0.5 |
| Status | idea |
| Priority | P2 |
| Depends on | стабильный `ProtocolHandler` API |
## Цель
Плагин, который понимает gRPC поверх HTTP/2: валидирует префикс запроса, умеет
отклонять мусор до upstream, поддерживает multiplexing без потери соединений.
## Зачем
После HTTP/1.1 логичный следующий протокол: gRPC — стандарт для внутренних API, а
его handshake (HTTP/2 preface + SETTINGS) дешёво проверяется в userspace. Даёт
кейс «защитить внутренний сервис», а не только публичный сайт.
## Scope
- Разбор HTTP/2 preface и первых фреймов (SETTINGS/HEADERS) с лимитами.
- Решение Allow/Reject и туннелирование на upstream без буферизации всего потока.
- Конфиг `[protocol.grpc]`: лимиты заголовков, таймауты, разрешённые пути.
- Тесты на фрагментацию (парсер обязан переживать «один read»).
## Non-goals
- Полноценный HTTP/2-прокси с приоритетами и flow control.
- gRPC-рефлексия и десериализация сообщений.
## Approach
1. Переиспользовать HTTP/1.1-парсер там, где применимо; HTTP/2 preface —
отдельная маленькая стейт-машина.
2. Новый feature `protocol-grpc`, регистрация в `ProtocolRegistry`.
3. Fuzz-цель `http2_preface` рядом с существующими.
4. Документация: `docs/configuration.md` + отдельный пример конфига.
## Критерии приёмки
- [ ] `--features protocol-grpc` собирается и покрыт тестами в CI.
- [ ] Парсер не выходит за буфер на произвольных байтах (fuzz 60 с в `make fuzz`).
- [ ] Нет регрессии латентности HTTP/1.1-пути (bench hot_paths).