fix: resolve issues #860, #861, #862#871
Merged
Merged
Conversation
Issue AgesEmpire#860 — API key scope validation per endpoint - Add ApiKeyScope enum (signals:read/write, trades:read/write, portfolio:read, analytics:read, admin:*) - Create ApiKeyScopesGuard that reads @RequireScopes metadata and rejects with 403 on missing scopes - Update @RequireScopes decorator to use ApiKeyScope enum (type-safe) - Update CreateApiKeyDto, ApiKeyResponseDto, ApiKey entity to use ApiKeyScope enum - Refactor ApiKeyAuthGuard to handle auth only; scope enforcement moved to ApiKeyScopesGuard - Apply @RequireScopes to all trade and signal endpoints - Export ApiKeyScopesGuard from ApiKeysModule - Unit tests: correct scope granted, missing scope 403, admin wildcard, no key 401 Issue AgesEmpire#861 — Mandatory idempotency key for trade execution and signal creation - Add RequireIdempotencyKeyGuard that enforces Idempotency-Key header - Missing header returns 400 Bad Request with clear instructions - Concurrent duplicate returns 409 Conflict with Retry-After: 2 header - Add @UseGuards(RequireIdempotencyKeyGuard) to POST /trades/execute - Add @UseGuards(RequireIdempotencyKeyGuard) and IdempotencyInterceptor to POST /signals - Unit tests: missing header 400, empty header 400, valid header pass, concurrent 409, post-finish reuse Issue AgesEmpire#862 — Comprehensive health check probes - Add GET /health/live explicit liveness endpoint (process-alive, no dependency checks) - Existing GET /health/ready readiness probe checks database, Redis, BullMQ, Soroban RPC - Update k8s/base/deployment.yaml to use /health/live for startup and liveness probes - Unit tests: /live returns 200 with empty indicator list, /ready returns 503 on each dependency failure (postgres, redis, soroban), latency field present in all results
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #860
closes #861
closes #862
Issue #860 — API key scope validation per endpoint
Issue #861 — Mandatory idempotency key for trade execution and signal creation
Issue #862 — Comprehensive health check probes