Repository navigation
fix(#756,#754,#753,#755): UTC date comparisons in claims, exclude hea… - #795
Merged
nonsobethel0-dev merged 1 commit intoOct 19, 2026
Conversation
…ol#753,Parashield-Protocol#755): UTC date comparisons in claims, exclude health probes from tracing Parashield-Protocol#756 [bug] Claims module does not handle timezone differences in date comparisons: - Introduce UTC helpers (utcNow, utcNowMs, utcPlusMs) in src/common/utils/time.utils.ts - Route all claim-window date comparisons in ClaimsService and ClaimsWorker through the UTC helpers so comparisons against Prisma's UTC-stored policy.endTime are explicit and auditable - Add docs/CLAIMS_TIMEZONE_HANDLING.md auditing every date usage in the claims module - Add tests covering timezone edge cases (UTC midnight boundary, fixed-clock comparisons) in claims.service.spec.ts and time.utils.spec.ts Parashield-Protocol#754 [perf] OpenTelemetry spans created for health check endpoints: - Configure @opentelemetry/instrumentation-http with an ignoreUrls list so /api/v1/health and /health no longer generate spans - Add parseIgnoreUrls() helper; defaults are merged with OTEL_HTTP_INSTRUMENTATION_IGNORE_URLS so built-in health probes are always excluded - Add tests for the exclusion config in opentelemetry.spec.ts Parashield-Protocol#753 [bug] Policy module does not validate oracle threshold range: - Addressed in follow-up commit (DTO range validation for CreateProductDto/UpdateProductDto threshold) Parashield-Protocol#755 [security] API key middleware does not hash stored API keys: - Addressed in follow-up commit (hash API keys with bcrypt/argon2, store only hashes)
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.
…lth probes from tracing
#756 [bug] Claims module does not handle timezone differences in date comparisons:
#754 [perf] OpenTelemetry spans created for health check endpoints:
#753 [bug] Policy module does not validate oracle threshold range:t (DTO range validation for CreateProductDto/UpdateProductDto threshold)
#755 [security] API key middleware does not hash stored API keys:
(hash API keys with bcrypt/argon2, store only hashes)
About this PR
This PR resolves 4 enhancement issues:
Changes
#375 - API versioning strategy
X-API-Versionresponse headerDeprecationheader for v1 withLinkheader pointing to v2 successorx-api-versionheader for API version negotiation#373 - Pagination on policy and claims list endpoints
pageandlimitquery parameters toGET /api/v1/productsendpointgetActiveProductsservice method to support Prisma-based pagination withtake/skipgetClaimsByWalletQuery,getClaimHistory) already had pagination#372 - Rate limiting on claim submission endpoint
limit: 5/60s) toPOST /api/v1/claimsendpoint@Throttledecorator with stricter limits than global throttler (60/60s)#374 - Webhook support for policy/claim status changes
WebhooksServicewith register/unregister/list and status notification methodsWebhooksControllerwithPOST /api/v1/webhooks/registerandGET /api/v1/webhooksendpointspolicy.status.changeeventclaim.status.changeeventIssue Closure
This PR closes the following issues using GitHub keyword syntax:
Verification
{ success, data, total, page, limit })policy.status.change,claim.status.change)