Skip to content

Updated databse security#20

Merged
EndiUN merged 10 commits into
mainfrom
database_dev
May 11, 2026
Merged

Updated databse security#20
EndiUN merged 10 commits into
mainfrom
database_dev

Conversation

@EndiUN
Copy link
Copy Markdown
Collaborator

@EndiUN EndiUN commented May 11, 2026

No description provided.

EndiUN added 10 commits April 29, 2026 09:28
- 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
@EndiUN EndiUN merged commit 267d69e into main May 11, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant