miroir/crates/miroir-proxy/Cargo.toml
jedarden eeee4c1df1 P5.7 §13.7: Complete atomic index alias implementation
Implements plan §13.7 atomic index aliases for blue-green reindexing.

## Implementation Summary

All components are fully implemented and tested:

**Database & Storage:**
- Aliases table with history tracking (001_initial.sql)
- TaskStore trait: create_alias, get_alias, flip_alias, delete_alias, list_aliases
- SQLite implementation with atomic flip transactions
- History retention bound (default: 10 entries)

**In-Memory Cache:**
- AliasRegistry with sync_from_store() for hot path resolution
- resolve() for single/multi-target lookup
- is_multi_target_alias() for write rejection

**Admin API Endpoints:**
- POST /_miroir/aliases/{name} - create single or multi-target
- GET /_miroir/aliases - list all
- GET /_miroir/aliases/{name} - get with flip history
- PUT /_miroir/aliases/{name} - atomic flip
- DELETE /_miroir/aliases/{name} - delete alias

**Routing Integration:**
- Search route resolves aliases before scatter
- Documents route rejects writes to multi-target aliases (409)
- Multi-target aliases fan out to all targets

**Config & Metrics:**
- aliases.enabled, aliases.history_retention, aliases.require_target_exists
- miroir_alias_resolutions_total{alias}
- miroir_alias_flips_total{alias}

## Acceptance Criteria (All Met)

✓ Create single-target alias → both writes + reads resolve
✓ Flip: new writes land on new target; in-flight requests complete against old target
✓ Create multi-target alias → read fans out; write returns 409
✓ Operator edit of ILM-managed multi-target alias → 409 (only ILM can modify)
✓ History: 11th flip evicts the oldest

All 17 acceptance tests pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-23 02:12:50 -04:00

57 lines
1.6 KiB
TOML

[package]
name = "miroir-proxy"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
[features]
default = []
tracing = ["opentelemetry", "opentelemetry-otlp", "opentelemetry_sdk", "tracing-opentelemetry"]
[[bin]]
name = "miroir-proxy"
path = "src/main.rs"
[dependencies]
anyhow = "1"
async-trait = "0.1"
axum = "0.7"
http = "1.1"
tokio = { version = "1", features = ["rt-multi-thread", "signal"] }
reqwest = { version = "0.12", features = ["json", "rustls-tls"], default-features = false }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
config = "0.14"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
prometheus = "0.13"
uuid = { version = "1.11", features = ["v7"] }
subtle = "2"
hmac = "0.12"
sha2 = "0.10"
base64 = "0.22"
chacha20poly1305 = "0.10"
rand = "0.8"
dashmap = "6"
hex = "0.4"
tower = "0.5"
miroir-core = { path = "../miroir-core", features = ["axum", "redis-store", "peer-discovery"] }
rust-embed = "8"
mime_guess = "2"
chrono = "0.4"
# OpenTelemetry (optional - use feature flag to enable)
opentelemetry = { version = "0.27", optional = true }
opentelemetry-otlp = { version = "0.27", features = ["grpc-tonic"], optional = true }
opentelemetry_sdk = { version = "0.27", features = ["rt-tokio"], optional = true }
tracing-opentelemetry = { version = "0.28", optional = true }
[dev-dependencies]
tower = "0.5"
http-body-util = "0.1"
mockito = "1"
tokio = { version = "1", features = ["rt", "macros", "rt-multi-thread"] }
testcontainers = "0.23"
testcontainers-modules = { version = "0.11", features = ["redis"] }
tempfile = "3"