Files
OmniRoute/package.json
T
diegosouzapw 1cbbc33f20 feat(security): FASE-01 to FASE-06 security hardening
FASE-01 — Security Hardening:
- Remove hardcoded JWT_SECRET and API_KEY_SECRET fallbacks (fail-fast)
- Create secretsValidator.js with enforceSecrets() at startup
- Create inputSanitizer.js (prompt injection + PII detection)
- Integrate sanitizer in chat.js handler pipeline
- Add structured logging to silent catch blocks in proxy.js
- Remove .passthrough() from Zod updateSettingsSchema
- Remove insecure npm fs dependency
- Update .env.example with generation commands

FASE-02 — CI/CD & Tests:
- Create ci.yml workflow (lint, build, test, coverage, e2e)
- Fix test scripts (test now runs actual tests)
- Add test:unit, test:security, test:coverage (c8), test:all
- Add security rules to ESLint (no-eval, no-implied-eval, no-new-func)

FASE-03 — Architecture:
- Create settingsCache.js (eliminate self-fetch anti-pattern)
- Create domain/types.js and domain/responses.js

FASE-04 — Observability:
- Create correlationId.js (AsyncLocalStorage tracing)
- Create circuitBreaker.js (full state machine + registry)
- Create requestTimeout.js (per-provider timeouts)

FASE-05 — Code Quality:
- Create structuredLogger.js (JSON/human-readable logging)

FASE-06 — Documentation:
- Update SECURITY.md with hardening practices
- Create CONTRIBUTING.md with dev setup and PR checklist

Tests: 52/52 pass (23 security + 15 observability + 14 integration)
2026-02-14 18:21:47 -03:00

113 lines
3.0 KiB
JSON

{
"name": "omniroute",
"version": "0.2.0",
"description": "Smart AI Router with auto fallback — route to FREE & cheap models, zero downtime. Works with Cursor, Cline, Claude Desktop, Codex, and any OpenAI-compatible tool.",
"type": "module",
"bin": {
"omniroute": "bin/omniroute.mjs"
},
"files": [
"bin/",
"app/",
"README.md",
"LICENSE"
],
"workspaces": [
"open-sse"
],
"engines": {
"node": ">=18.0.0"
},
"keywords": [
"ai",
"router",
"proxy",
"openai",
"claude",
"anthropic",
"gemini",
"fallback",
"cursor",
"cline",
"codex",
"llm",
"auto-fallback"
],
"license": "MIT",
"author": "diegosouzapw",
"repository": {
"type": "git",
"url": "https://github.com/diegosouzapw/OmniRoute"
},
"homepage": "https://github.com/diegosouzapw/OmniRoute",
"scripts": {
"dev": "next dev --webpack --port 20128",
"build": "next build --webpack",
"build:cli": "node scripts/prepublish.mjs",
"start": "next start --port 20128",
"lint": "eslint .",
"test": "node --test tests/unit/*.test.mjs",
"test:unit": "node --test tests/unit/*.test.mjs",
"test:plan3": "node --test tests/unit/plan3-p0.test.mjs",
"test:fixes": "node --test tests/unit/fixes-p1.test.mjs",
"test:security": "node --test tests/unit/security-fase01.test.mjs",
"test:e2e": "npx playwright test",
"test:coverage": "npx c8 --check-coverage --lines 40 --functions 30 --branches 30 node --test tests/unit/*.test.mjs",
"test:all": "npm run test:unit && npm run test:e2e",
"check": "npm run lint && npm run test",
"prepublishOnly": "npm run build:cli",
"prepare": "husky"
},
"dependencies": {
"@monaco-editor/react": "^4.7.0",
"bcryptjs": "^3.0.3",
"better-sqlite3": "^12.6.2",
"bottleneck": "^2.19.5",
"express": "^5.2.1",
"fetch-socks": "^1.3.2",
"http-proxy-middleware": "^3.0.5",
"https-proxy-agent": "^7.0.6",
"jose": "^6.1.3",
"lowdb": "^7.0.1",
"monaco-editor": "^0.55.1",
"next": "^16.1.6",
"node-machine-id": "^1.1.12",
"open": "^11.0.0",
"ora": "^9.1.0",
"pino": "^10.3.1",
"pino-pretty": "^13.1.3",
"react": "19.2.4",
"react-dom": "19.2.4",
"recharts": "^3.7.0",
"selfsigned": "^5.5.0",
"undici": "^7.19.2",
"uuid": "^13.0.0",
"zod": "^4.3.6",
"zustand": "^5.0.10"
},
"devDependencies": {
"@playwright/test": "^1.58.2",
"@tailwindcss/postcss": "^4.1.18",
"@types/better-sqlite3": "^7.6.13",
"@types/node": "^25.2.3",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"eslint": "^10",
"eslint-config-next": "16.1.6",
"husky": "^9.1.7",
"lint-staged": "^16.2.7",
"prettier": "^3.8.1",
"tailwindcss": "^4",
"typescript": "^5.9.3"
},
"lint-staged": {
"*.{js,jsx,ts,tsx,mjs}": [
"prettier --write",
"eslint --fix --no-error-on-unmatched-pattern"
],
"*.{json,md,yml,yaml,css}": [
"prettier --write"
]
}
}