Nicolas Cantu cfa1f435cb refactor: centralize HTTP proxy helpers and align IA_DEV_ROOT resolution (0.0.6)
Initial state:
- HTTP proxy utilities (Bearer parsing, hop-by-hop headers, body limits, safe path validation) were duplicated between smart-ide-sso-gateway and smart-ide-global-api.
- IA_DEV_ROOT auto-resolution order differed between bash (ensure-ia-dev-project-link.sh) and TypeScript (ia-dev-gateway getIaDevRoot), and could fall back to non-existing paths.

Motivation:
- Reduce duplication and drift across proxy layers.
- Enforce consistent, explicit IA_DEV_ROOT behavior across scripts and services.

Resolution:
- Add package @4nk/smart-ide-http-utils and reuse it from smart-ide-sso-gateway and smart-ide-global-api.
- Align IA_DEV_ROOT resolution to prefer ./services/ia_dev then ./ia_dev; fail fast when missing/misconfigured.

Root cause:
- Cross-service utilities were implemented ad-hoc in each service.
- Historical layout transitions (ia_dev gitlink vs vendored services/ia_dev) left multiple resolvers with different priorities.

Impacted features:
- HTTP proxy chain (SSO gateway -> global API -> upstream services).
- ia-dev-gateway startup/operation when IA_DEV_ROOT is missing or invalid.

Code modified:
- packages/smart-ide-http-utils/**
- services/smart-ide-global-api/src/server.ts
- services/smart-ide-sso-gateway/src/server.ts
- services/ia-dev-gateway/src/paths.ts
- scripts/ensure-ia-dev-project-link.sh

Documentation modified:
- docs/system-architecture.md
- docs/ia_dev-module.md
- docs/repo/README.md

Configurations modified:
- services/smart-ide-global-api/package.json
- services/smart-ide-sso-gateway/package.json

Files in deploy modified:
- None

Files in logs impacted:
- None (runtime logs only)

Databases and other sources modified:
- None

Off-project modifications:
- None

Files in .smartIde modified:
- None

Files in .secrets modified:
- None

New patch version in VERSION:
- 0.0.6

CHANGELOG.md updated:
- yes
2026-04-04 20:34:49 +02:00

98 lines
2.9 KiB
JSON

{
"name": "@4nk/smart-ide-sso-gateway",
"version": "0.1.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@4nk/smart-ide-sso-gateway",
"version": "0.1.0",
"license": "MIT",
"dependencies": {
"@4nk/smart-ide-http-utils": "file:../../packages/smart-ide-http-utils",
"@4nk/smart-ide-upstreams": "file:../../packages/smart-ide-upstreams",
"jose": "^5.9.6"
},
"devDependencies": {
"@types/node": "^20.11.0",
"typescript": "^5.3.3"
},
"engines": {
"node": ">=20"
}
},
"../../packages/smart-ide-http-utils": {
"name": "@4nk/smart-ide-http-utils",
"version": "0.1.0",
"license": "MIT",
"devDependencies": {
"@types/node": "^20.11.0",
"typescript": "^5.3.3"
},
"engines": {
"node": ">=20"
}
},
"../../packages/smart-ide-upstreams": {
"name": "@4nk/smart-ide-upstreams",
"version": "0.1.0",
"license": "MIT",
"devDependencies": {
"@types/node": "^20.11.0",
"typescript": "^5.3.3"
},
"engines": {
"node": ">=20"
}
},
"node_modules/@4nk/smart-ide-http-utils": {
"resolved": "../../packages/smart-ide-http-utils",
"link": true
},
"node_modules/@4nk/smart-ide-upstreams": {
"resolved": "../../packages/smart-ide-upstreams",
"link": true
},
"node_modules/@types/node": {
"version": "20.19.39",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.19.39.tgz",
"integrity": "sha512-orrrD74MBUyK8jOAD/r0+lfa1I2MO6I+vAkmAWzMYbCcgrN4lCrmK52gRFQq/JRxfYPfonkr4b0jcY7Olqdqbw==",
"dev": true,
"license": "MIT",
"dependencies": {
"undici-types": "~6.21.0"
}
},
"node_modules/jose": {
"version": "5.10.0",
"resolved": "https://registry.npmjs.org/jose/-/jose-5.10.0.tgz",
"integrity": "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg==",
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/panva"
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
},
"node_modules/undici-types": {
"version": "6.21.0",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz",
"integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==",
"dev": true,
"license": "MIT"
}
}
}