Nicolas Cantu 940cf59178 Share upstream definitions in @4nk/smart-ide-upstreams, systemd user units
- Add packages/smart-ide-upstreams (versioned dist) for resolveUpstream + listUpstreamKeys
- Wire smart-ide-global-api and smart-ide-sso-gateway via file: dependency
- Add systemd user unit templates and install-smart-ide-gateway-systemd-user.sh (SSO After/Requires global API)
- Update docs and VERSION 0.0.3
2026-04-04 15:37:58 +02:00

33 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# smart-ide-global-api
Couche HTTP **interne** : agrège les appels vers les micro-services `smart_ide` avec les **jetons techniques** par service. **Pas dOIDC** : seul `smart-ide-sso-gateway` appelle cette API, avec `Authorization: Bearer` égal à `GLOBAL_API_INTERNAL_TOKEN`.
Les micro-services nexposent pas le SSO ; ils restent sur **127.0.0.1** avec Bearer (ou clé API pour local-office).
## Run
Démarrer **avant** la passerelle SSO.
```bash
cd services/smart-ide-global-api
cp .env.example .env
# définir GLOBAL_API_INTERNAL_TOKEN et les jetons des services
set -a && source .env && set +a
npm ci
npm run build
npm start
```
Écoute par défaut : `http://127.0.0.1:37149`.
**Amonts** : module **`@4nk/smart-ide-upstreams`** (`../../packages/smart-ide-upstreams/`). Après modification des clés ou des variables denvironnement mappées, reconstruire ce paquet et committer son `dist/`.
## Journaux
Une ligne JSON par requête (hors `GET /health`) dans **`.logs/global-api/access.log`** (répertoire `.logs/` à la racine du monorepo, créé au besoin).
## Documentation
- API : [`docs/API/global-api.md`](../../docs/API/global-api.md)
- Passerelle SSO : [`docs/features/sso-gateway-service.md`](../../docs/features/sso-gateway-service.md)