feat(security): standardize security headers and CORS policy#860
feat(security): standardize security headers and CORS policy#860Exodus2004 wants to merge 31 commits into
Conversation
Implemented consolidated security configuration in security_config.py and cleaned up redundant middleware in main.py. Standardized CSP, HSTS, and strict CORS origins for production readiness. Closes ritesh-1918#637.
|
Someone is attempting to deploy a commit to the ritesh Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Added KnowledgeGapService to identify recurring ticket themes with poor Knowledge Base coverage. This allows support teams to proactively documentation missing troubleshooting steps. Closes ritesh-1918#611.
Added SLABreachPredictionService to identify tickets at risk of exceeding SLA deadlines. This allows support managers to prioritize tickets before they breach. Closes ritesh-1918#609.
…1-knowledge-gap-engine
…9-sla-prediction-engine
1. Fixed corrupted App.jsx and normalized route splitting. 2. Fixed duplicated declarations in Login.jsx and missing imports in AdminSidebar.jsx. 3. Fixed missing variables and state management loops in AdminTickets.jsx and AdminHeader.jsx. 4. Corrected backend SyntaxError in classifier_service.py and standardized metrics imports. 5. Resolved serialized variable error in persistenceMiddleware.js.
…ax issues 1. Fixed SyntaxError in classifier_service.py by properly closing try-except blocks. 2. Added missing imports (time, metrics) to classifier_service.py. 3. Resolved ESLint globals and unused variable errors in Cypress tests. 4. Fixed 'Cannot access refs during render' in BackToTop.jsx and useKeyboardShortcuts.js. 5. Fixed undefined 'axios' and unused 'apiClient' in TicketTracking.jsx. 6. Synchronized package-lock.json.
1. Fixed SyntaxError in classifier_service.py by properly nesting try-except-finally blocks. 2. Exported missing SHORTCUTS_LEGEND from useKeyboardShortcuts.js. 3. Synchronized package-lock.json.
…7-security-headers-cors
…11-knowledge-gap-engine
1. Wrapped torch import in DuplicateService with try-except for CI compatibility. 2. Added missing numpy and threading imports to DuplicateService. 3. Fixed SyntaxError in ClassifierService.
…-security-headers-cors
Wrapped google.generativeai import in tag_service.py with try-except to prevent ModuleNotFoundError in CI smoke tests.
…7-security-headers-cors
Removed invalid 'buckets' argument from request_size and response_size metric calls in main.py to fix TypeError in production environment.
…-security-headers-cors
Added missing 'Header' import in main.py to fix NameError in metrics verification function.
…7-security-headers-cors
The slowapi limiter requires a 'request' argument to be present in the decorated function. Added 'request: Request' to analyze_stream.
…-security-headers-cors
1. Added missing 'request: Request' argument to analyze_stream to satisfy slowapi requirement. 2. Removed duplicate /metrics route registration. 3. Cleaned up redundant imports and code blocks.
…7-security-headers-cors
…instrumentator 1. Consolidated Instrumentator initialization into a single block. 2. Removed duplicate /metrics route registration. 3. Removed redundant expose() call from instrumentator.
Closes #637
Proposed Solution Approach
Instead of disparate and conflicting middleware blocks, I've implemented a centralized security configuration in \�ackend/security_config.py.
Why this approach is better: