fix: apply body limits, throttler, synchronize:false, idempotency config#670
Open
Userhorlie wants to merge 2 commits into
Open
fix: apply body limits, throttler, synchronize:false, idempotency config#670Userhorlie wants to merge 2 commits into
Userhorlie wants to merge 2 commits into
Conversation
- Issue Nexacore-Org#557: retrieve limits.json/urlencoded from ConfigService in main.ts and apply via express.json/urlencoded middleware - Issue Nexacore-Org#559: install @nestjs/throttler, wire ThrottlerModule.forRootAsync() in AppModule using rateLimit config, register ThrottlerGuard as APP_GUARD, add @SkipThrottle() on AppController - Issue Nexacore-Org#560: set synchronize:false unconditionally in TypeORM config, add CI workflow with migration:dryrun step, document migration workflow in README - Issue Nexacore-Org#558: inject ConfigService into IdempotencyService (TTL from env), make cleanup cron configurable via IDEMPOTENCY_CLEANUP_CRON env var, add IDEMPOTENCY_TTL_HOURS and IDEMPOTENCY_CLEANUP_CRON to env validation and configuration, document defaults in .env.example Closes Nexacore-Org#557, Closes Nexacore-Org#558, Closes Nexacore-Org#559, Closes Nexacore-Org#560
|
@Userhorlie 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! 🚀 |
4 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.
Summary
Fixes four open issues in a single commit.
Issue #557 — Body size limits never applied
limits.jsonandlimits.urlencodedfromConfigServiceinmain.tsexpress.json({ limit })andexpress.urlencoded({ limit })middlewareIssue #559 — Rate limiting config unused
@nestjs/throttlerThrottlerModule.forRootAsync()inAppModuleusingrateLimit.windowMs/rateLimit.maxRequestsconfig valuesThrottlerGuardglobally viaAPP_GUARD@SkipThrottle()onAppController(health/root endpoint)Issue #560 — synchronize:true risks data loss
synchronize: falseunconditionally inTypeOrmModuleconfig.github/workflows/ci.ymlwith amigration:dryrunstep to catch missing migrations on every PRREADME.mdIssue #558 — Idempotency TTL and cron hardcoded
IDEMPOTENCY_TTL_HOURSandIDEMPOTENCY_CLEANUP_CRONtoenv.validation.tsandconfiguration.tsConfigServiceintoIdempotencyService; TTL now reads from config (default 24h)IdempotencyCleanupJobcron driven byIDEMPOTENCY_CLEANUP_CRONenv var (default0 0 * * *).env.exampleTesting
npm run buildpasses with no errorsCloses #557
Closes #558
Closes #559
Closes #560