feat(rate-limiting): Implement core rate limiting functionality with configuration, decision-making, metrics, middleware, and service registration

- Add RateLimitConfig for configuration management with YAML binding support.
- Introduce RateLimitDecision to encapsulate the result of rate limit checks.
- Implement RateLimitMetrics for OpenTelemetry metrics tracking.
- Create RateLimitMiddleware for enforcing rate limits on incoming requests.
- Develop RateLimitService to orchestrate instance and environment rate limit checks.
- Add RateLimitServiceCollectionExtensions for dependency injection registration.
This commit is contained in:
master
2025-12-17 18:02:37 +02:00
parent 394b57f6bf
commit 8bbfe4d2d2
211 changed files with 47179 additions and 1590 deletions

View File

@@ -23,7 +23,7 @@ Core concepts:
- Install from the curated offline kit (no network); pin SDK + tool versions in `inputs.lock`.
- Use DSSE-signed configs and keep signing keys in offline `~/.stellaops/keys` with short-lived tokens.
- Run `dotnet format` / `dotnet test` with `--blame-crash --blame-hang` using fixed seeds (`Random(1337)`) to avoid flakiness.
- Capture DB/queue matrix upfront: MongoDB (pinned version), optional Postgres slices, and local cache paths; set `TZ=UTC` for all runs.
- Capture DB/queue matrix upfront: PostgreSQL (pinned version) and local cache paths; set `TZ=UTC` for all runs.
If you think “content-addressed trust pipeline for SBOMs + VEX,” youre in the right mental model.
@@ -57,8 +57,7 @@ UI note: Console remains in flux; focus on backend determinism first, then follo
## 3. Environment & DB matrix
- MongoDB: 6.0.12 (pin in `inputs.lock`).
- Optional Postgres slices: see sprint 340x series; keep read-only in dev until instructed.
- PostgreSQL: 16.x (pin in `inputs.lock`).
- Offline feeds: `offline-cache-2025-11-30` (scanner, advisories, VEX).
- Timezone: `TZ=UTC` for all tests and tooling.
@@ -99,7 +98,7 @@ docker compose -f compose/offline-kit.yml up -d
This usually includes:
- MongoDB or Postgres (configurable).
- PostgreSQL.
- RabbitMQ (or equivalent queue).
- MinIO / object storage (depending on profile).
@@ -111,7 +110,7 @@ cp env/example.local.env .env
Key settings:
- `STELLAOPS_DB=Mongo` or `Postgres`.
- `STELLAOPS_DB=Postgres`.
- `AUTHORITY_*` key material and config (see comments in `example.local.env`).
- Optional: `AUTHORITY_PQC=on` to enable post-quantum keys (Dilithium).
@@ -288,7 +287,7 @@ These introduce the canonical data model and determinism mindset.
---
## 8. Database Notes (Mongo ↔ Postgres)
## 8. Database Notes (PostgreSQL)
- Use `StellaOps.Shared.Persistence` repository interfaces.
- Canonical/public IDs are hash-derived; DB keys are internal details.