# smart-ide-sso-gateway HTTP gateway that validates **user** access tokens from the docv / Enso OIDC issuer, then proxies requests to internal `smart_ide` micro-services using each service’s **technical** credentials (Bearer or `X-API-Key`). ## Responsibilities - Verify `Authorization: Bearer ` with JWKS (`OIDC_ISSUER`, optional `OIDC_AUDIENCE`, optional `OIDC_JWKS_URI`). - Expose `GET /health` without auth. - Expose `GET /v1/token/verify` and `GET /v1/upstreams` with user Bearer. - Proxy `ANY /proxy//` to the configured upstream, replacing the user token with the service token and adding `X-OIDC-Sub` / `X-OIDC-Email` when present in the JWT. ## Run ```bash cd services/smart-ide-sso-gateway cp .env.example .env # edit OIDC_ISSUER and service tokens set -a && source .env && set +a npm ci npm run build npm start ``` Default listen: `http://127.0.0.1:37148`. Upstream URLs and tokens reuse the same environment variables as the rest of the monorepo (`ORCHESTRATOR_*`, `TOOLS_BRIDGE_*`, `LOCAL_OFFICE_URL` / `LOCAL_OFFICE_API_KEY`, etc.). See `src/upstreams.ts`. ## Documentation - Feature: [`docs/features/sso-gateway-service.md`](../../docs/features/sso-gateway-service.md) - API: [`docs/API/sso-gateway-api.md`](../../docs/API/sso-gateway-api.md)