smart_ide/docs/features/sso-docv-enso.md
Nicolas Cantu 7f1cee487c Cursor ia-dev bridge, versioned project confs, docv and ecosystem docs
- Add .cursor agents ia-dev-* and smart-ide-ia-dev-bridge rule
- Track ia_dev project conf under projects/smart_ide; link script for ia_dev/projects
- Document docv AI integration and ecosystem architecture/sync strategy
- Update README, platform-target, system-architecture, submodule doc
2026-04-03 16:30:42 +02:00

56 lines
2.3 KiB
Markdown
Raw 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.

# SSO — front plateforme et docv (filière Enso)
## Objectif
Permettre au **front web** de la plateforme `smart_ide` (déployé par environnement : test, pprod, prod) de déléguer lauthentification à **docv** via **OpenID Connect (OIDC)** , sans coupler le monorepo au code du dépôt Enso tant que celui-ci nest pas disponible sur la machine de documentation.
## Rôles
| Composant | Rôle |
|-----------|------|
| **Navigateur utilisateur** | Redirection vers docv (authorization endpoint) |
| **docv / IdP Enso** | Émet `id_token` / `access_token`, expose JWKS |
| **Front SPA** | Échange code OAuth (PKCE recommandé), stocke session |
| **Backend API** (orchestrateur ou BFF) | Valide JWT (signature JWKS, `iss`, `aud`, `exp`), mappe rôles → droits policy |
## Flux (authorization code + PKCE)
```mermaid
sequenceDiagram
participant Browser
participant Front as Front_SPA
participant Docv as docv_IdP
participant API as smart_ide_API
Browser->>Front: open app
Front->>Docv: redirect authorize
Docv->>Browser: login consent
Browser->>Front: callback code
Front->>Docv: token endpoint
Docv->>Front: access_token id_token
Front->>API: API calls Authorization Bearer
API->>API: validate JWT JWKS
```
Intégrations **IA** côté backend docv (services smart_ide, clones, AnythingLLM) : [docv-ai-integration.md](./docv-ai-integration.md).
## Paramètres à fixer avec le dépôt Enso
- `issuer` (URL stable par env)
- `client_id` / `client_secret` ou client public + PKCE
- Scopes : au minimum `openid`, `profile`, `email` ; scopes métier docv si besoin
- **Audience** (`aud`) attendue par lAPI `smart_ide`
- Mapping **rôles / groupes** → profils OpenShell (lecture seule, deploy pprod, etc.)
## Environnements
Un **client OAuth par env** (test / pprod / prod) ou un seul client avec **claims** denvironnement — à trancher avec la sécurité Enso. Les URLs de callback du front diffèrent par déploiement.
## Références internes
- [platform-target.md](../platform-target.md) — matrice test / pprod / prod
- [deployment-target.md](../deployment-target.md) — TLS, pas de HTTP de contournement
## Suite
Lorsque le dépôt Enso (ex. `/home/desk/code/enso/`) est accessible, compléter ce document avec les **chemins dendpoints** réels et captures décran des écrans docv concernés.