Updated databse security#20
Merged
Merged
Conversation
- removed unused React Native state-related functions and dead code - added shared constants.js for reusable constants across components - replaced manual scaling logic with d3.scale
Backend (routes/scenarios.js):
- Replace inline validateData with centralized validateCanonical
- Use VALID_TOOL_TYPES constant for toolType checks
- Remove stale minLifespan/maxLifespan from PUT route
- Remove duplicate POST /upload endpoint (handled by datasets.js)
- Trim scenario names on create/update
Frontend (minitool_1.jsx):
- Send canonical shape { bars, minLifespan, maxLifespan } instead of
{ originalFileName, columns, dataPoints }
- Update load handlers to read from data.bars
- Fix typo (conslole → console), remove duplicate payload block
- Add helmet for HTTP security headers (XSS, MIME sniffing, clickjacking) - Add express-mongo-sanitize to prevent NoSQL injection - Restrict CORS to ALLOWED_ORIGINS env var (defaults to localhost:8081) - Limit JSON request body to 1mb to prevent large payload abuse - Validate MongoDB ObjectId format before all DB lookups - Enforce max length on name (100) and description (500) fields - Sanitize 500 error messages to avoid leaking internals in production
minitool_1.test.jsx:
- Replace toMatchObject({width}) with toContainEqual(objectContaining)
to correctly assert against array-style props
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.
No description provided.