feat: general project intake form#433
feat: general project intake form#433qhanson55 merged 15 commits intofeature/release-general-projectfrom
Conversation
Now can be given a tab index, and report if they have an error.
Handles step change logic internally instead of via callbacks
housing -> projectCommon
Additional: Minor restructuring of all intake types to align them as closely as possible
Also incl various lint fixes
| import roadmap from './roadmap.ts'; | ||
|
|
||
| const router = express.Router(); | ||
| router.use(currentContext(Initiative.GENERAL)); |
Check failure
Code scanning / CodeQL
Missing rate limiting
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 days ago
In general, the fix is to introduce a rate-limiting middleware (e.g., using express-rate-limit) and apply it to the routes protected by currentContext, so that expensive authorization and subsequent handlers cannot be invoked at an unbounded rate.
The best minimal-impact fix here is:
- Import
express-rate-limit. - Define a limiter instance (e.g., a reasonable window and max request count).
- Apply the limiter immediately before or along with
currentContext(Initiative.GENERAL)on this router usingrouter.use. This preserves all existing routes and behavior; it just gates them behind rate limiting. We do not change any route handlers or paths.
Concretely, in app/src/routes/v1/general.ts:
- Add an import of
express-rate-limit. - After
const router = express.Router();, define aconst generalRateLimiter = rateLimit({ ... }). - Insert
router.use(generalRateLimiter);beforerouter.use(currentContext(Initiative.GENERAL));.
| @@ -11,8 +11,16 @@ | ||
| import noteHistory from './noteHistory.ts'; | ||
| import permit from './permit.ts'; | ||
| import roadmap from './roadmap.ts'; | ||
| import rateLimit from 'express-rate-limit'; | ||
|
|
||
| const router = express.Router(); | ||
|
|
||
| const generalRateLimiter = rateLimit({ | ||
| windowMs: 15 * 60 * 1000, // 15 minutes | ||
| max: 100 // limit each IP to 100 requests per windowMs for general routes | ||
| }); | ||
|
|
||
| router.use(generalRateLimiter); | ||
| router.use(currentContext(Initiative.GENERAL)); | ||
|
|
||
| // Base v1 Responder |
| @@ -81,7 +81,8 @@ | ||
| "proj4": "^2.20.2", | ||
| "tsx": "^4.21.0", | ||
| "uuid": "^11.1.0", | ||
| "winston-transport": "^4.9.0" | ||
| "winston-transport": "^4.9.0", | ||
| "express-rate-limit": "^8.2.1" | ||
| }, | ||
| "devDependencies": { | ||
| "@eslint/js": "9.39.1", |
| Package | Version | Security advisories |
| express-rate-limit (npm) | 8.2.1 | None |
53d61ce to
87eb4bd
Compare
|
44f8c21 to
abffbb4
Compare
abffbb4 to
15ebf4e
Compare
qhanson55
left a comment
There was a problem hiding this comment.
consider going through some of the sonarqube alerts
frontend/src/components/form/common/FinanciallySupportedCard.vue
Outdated
Show resolved
Hide resolved
|
Reduce onBeforeMount complexity. Resolve improper label usages.
1fda0f3 to
60e317e
Compare
|
3687320
into
feature/release-general-project





Description
formstore has been added. This store tracks the formtypeandstate. These 2 states dictate if a form is editable or not. The card components also communicate with the store to track which form tabs currently have errors.Contactintake field names have been aligned with the actual type. No more weird transformations required!https://apps.nrs.gov.bc.ca/int/jira/browse/PADS-709
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Checklist
Further comments