feat(api): input validation layer, supertest integration tests & DLQ admin API#106
Open
jadonamite wants to merge 1 commit intoFluxora-Org:mainfrom
Open
feat(api): input validation layer, supertest integration tests & DLQ admin API#106jadonamite wants to merge 1 commit intoFluxora-Org:mainfrom
jadonamite wants to merge 1 commit intoFluxora-Org:mainfrom
Conversation
- Issue Fluxora-Org#6: Add Zod input validation layer for JSON bodies (src/validation/schemas.ts) - Issue Fluxora-Org#34: Add Supertest integration tests for HTTP API (tests/streams.test.ts) - Issue Fluxora-Org#43: Add dead-letter queue inspection API admin-only (src/routes/dlq.ts, tests/dlq.test.ts) - Fix auth middleware undefined apiKey reference - Fix errorHandler requestId propagation - Add missing src/config/stellar.ts Closes Fluxora-Org#6 Closes Fluxora-Org#34 Closes Fluxora-Org#43
|
@jadonamite Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Summary
This PR closes three related issues in one cohesive change set, all scoped to operator-grade reliability of the Fluxora HTTP surface:
Changes
Issue #6 — Input Validation Layer (Zod) for JSON Bodies
src/validation/schemas.tswith reusable Zod schemas for all incoming JSON bodiesCreateStreamSchemaenforces decimal strings (not numbers) fordepositAmountandratePerSecond, preventing floating-point precision loss across the chain/API boundaryListStreamsQuerySchemavalidates cursor, limit, and include_total query parametersDlqListQuerySchemavalidates DLQ pagination parametersparseBody()andformatZodIssues()provide consistent validation error formatting400 VALIDATION_ERRORwith per-field detailsIssue #34 — Supertest Integration Tests for HTTP API
tests/streams.test.tswith full Supertest coverageIssue #43 — Dead-Letter Queue Inspection API (Admin Only)
src/routes/dlq.tsimplementingGET /admin/dlq,GET /admin/dlq/:id, andDELETE /admin/dlq/:id/admin/dlq— operator JWT role required on all routesenqueueDeadLetter()for internal workers to write to the DLQtests/dlq.test.tswith full Supertest coverage: auth guards, pagination, topic filter, single entry fetch, acknowledge/delete, shape validationSupporting Fixes
src/middleware/auth.tsundefinedapiKeyreference causing 500ssrc/middleware/errorHandler.tsrequestId propagation into error responsessrc/config/stellar.ts(upstream dependency)src/types/express.d.tsto declareuserandcorrelationIdon Express RequestTest Results
Non-Goals (Intentionally Deferred)
Closes #6
Closes #34
Closes #43