Repository navigation
Conversation
…r /api/v1/pairs The route list endpoint used offset pagination where the cursor was merely a base64-encoded integer offset. This caused rows to be skipped or duplicated when pairs were registered between page fetches. Changes: - Add parseCursorKey: decodes opaque base64url-encoded sort keys - Add cursorPaginate: sorts by cursorKey and filters by key position instead of using offset-based array slicing - Update GET /api/v1/pairs to use cursor pagination with the pair key (source::destination) as the stable cursor Edge cases covered by tests: - First page then next: no gaps or duplicates - Rows inserted mid-scan: no skipped/duplicated existing rows - End of list: nextCursor is null - Invalid cursor: returns 400 invalid_request - Page size clamps to max (500) Closes StableRoute-Org#553
- validateSchema() middleware with type, bounds, length, pattern checks - auditLog() helper for append-only state-change auditing - 9 tests covering validation rules and audit events Closes StableRoute-Org#555, StableRoute-Org#557
Author
|
Closing this to keep the queue tidy. |
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
Implements schema-based request validation and append-only audit logging for state-changing operations.
Changes
Schema Validation Middleware (#555)
validateSchema()middleware with type, bounds, length, pattern, and allowedValues checksAudit Log Utility (#557)
auditLog()helper wrappingrecordEventwith graceful error handlingTesting
Closes #555, #557