feat: implement 5 QA-driven security and quality proposals
Implemented proposals from comprehensive QA review: 1. extend-csrf-protection - Add POST to CSRF protected methods in frontend - Global CSRF middleware for all state-changing operations - Update tests with CSRF token fixtures 2. tighten-cors-websocket-security - Replace wildcard CORS with explicit method/header lists - Disable query parameter auth in production (code 4002) - Add per-user WebSocket connection limit (max 5, code 4005) 3. shorten-jwt-expiry - Reduce JWT expiry from 7 days to 60 minutes - Add refresh token support with 7-day expiry - Implement token rotation on refresh - Frontend auto-refresh when token near expiry (<5 min) 4. fix-frontend-quality - Add React.lazy() code splitting for all pages - Fix useCallback dependency arrays (Dashboard, Comments) - Add localStorage data validation in AuthContext - Complete i18n for AttachmentUpload component 5. enhance-backend-validation - Add SecurityAuditMiddleware for access denied logging - Add ErrorSanitizerMiddleware for production error messages - Protect /health/detailed with admin authentication - Add input length validation (comment 5000, desc 10000) All 521 backend tests passing. Frontend builds successfully. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -161,6 +161,33 @@ The system SHALL support project templates to standardize project creation.
|
||||
- **THEN** system creates template with project's CustomField definitions
|
||||
- **THEN** template is available for future project creation
|
||||
|
||||
### Requirement: Code Splitting
|
||||
The application SHALL use code splitting with React.lazy() to reduce initial bundle size and improve load times.
|
||||
|
||||
#### Scenario: Initial page load
|
||||
- **WHEN** user navigates to application
|
||||
- **THEN** only core framework and current route are loaded
|
||||
- **AND** other routes are loaded on demand
|
||||
|
||||
#### Scenario: Route-based splitting
|
||||
- **WHEN** user navigates to a different page
|
||||
- **THEN** that page's code chunk is loaded dynamically
|
||||
- **AND** loading fallback is displayed during load
|
||||
|
||||
### Requirement: LocalStorage Data Validation
|
||||
User data loaded from localStorage SHALL be validated before use to prevent crashes from corrupted data.
|
||||
|
||||
#### Scenario: Corrupted localStorage data
|
||||
- **WHEN** localStorage contains malformed user JSON
|
||||
- **THEN** invalid data is cleared
|
||||
- **AND** user is redirected to login page
|
||||
- **AND** no application crash occurs
|
||||
|
||||
#### Scenario: Valid localStorage data
|
||||
- **WHEN** localStorage contains valid user JSON
|
||||
- **THEN** user is authenticated from stored data
|
||||
- **AND** application loads normally
|
||||
|
||||
### Requirement: Error Boundary Protection
|
||||
The frontend application SHALL gracefully handle component render errors without crashing the entire application.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user