feat(rgpd): compléter documentation RGPD avec 12 nouvelles sections

Règles RGPD (docs/domains/_shared/rules/rgpd.md):
- Ajouter sections 13.11-13.22 (droits utilisateurs, mineurs, sécurité)
- Droit de rectification, opposition, limitation du traitement
- Gestion des mineurs: 13 ans minimum + consentement parental 13-15 ans
- Protection renforcée: RoadWave Kids pour < 13 ans
- Sécurité: chiffrement multi-niveaux, procédure breach 72h CNIL
- Politique de confidentialité avec versioning
- Sous-traitants, DPIA, délais de réponse

Entités (6 nouvelles):
- PARENTAL_CONSENTS + PARENTAL_CONTROLS (workflow 13-15 ans)
- PRIVACY_POLICY_VERSIONS + USER_POLICY_ACCEPTANCES
- ACCOUNT_DELETIONS (grace period 30j)
- BREACH_INCIDENTS + BREACH_AFFECTED_USERS
- USER_PROFILE_HISTORY (audit trail rectification)
- DATA_RETENTION_LOGS (purge 5 ans)

Diagrammes séquences (5 nouveaux):
- Consentement parental avec validation email
- Anonymisation GPS automatique après 24h
- Notification breach CNIL (procédure 72h)
- Export données asynchrone
- Suppression compte avec grace period

Cycles de vie (3 nouveaux + 1 enrichi):
- parental-consent-lifecycle.md
- breach-incident-lifecycle.md
- account-deletion-lifecycle.md
- user-account-lifecycle.md (ajout états mineurs, frozen)

Features BDD (4 nouvelles, 195 scénarios RGPD):
- minors-protection.feature (9 scénarios)
- data-security.feature (12 scénarios)
- privacy-policy.feature (8 scénarios)
- user-rights.feature (8 scénarios)

Infrastructure:
- Réorganiser docs générées: docs/bdd + output → generated/bdd + generated/pdf
- Mettre à jour mkdocs.yml, Makefile, scripts Python
- Ajouter /generated/ au .gitignore
This commit is contained in:
jpgiannetti
2026-02-08 17:49:12 +01:00
parent 1896c249dd
commit b52ffb8db9
29 changed files with 1498 additions and 80703 deletions

View File

@@ -0,0 +1,40 @@
# Account Deletions
📖 Suppressions de compte avec grace period 30 jours (Article 17 RGPD)
## Diagramme
```mermaid
erDiagram
USERS ||--o| ACCOUNT_DELETIONS : "demande"
ACCOUNT_DELETIONS {
uuid id PK
uuid user_id FK
string status
string cancellation_token
timestamp requested_at
timestamp effective_at "requested_at + 30j"
timestamp cancelled_at
timestamp deleted_at
string deletion_reason
json deleted_data_summary
}
```
## Légende
**Statuts** :
- `pending`: Grace period actif (30j), compte désactivé, annulation possible
- `cancelled`: Utilisateur a annulé via lien email
- `completed`: Suppression effective réalisée après 30j
**Processus** :
1. Demande → compte désactivé, contenus cachés
2. Email avec `cancellation_token` (valide 30j)
3. Si annulation → `status = cancelled`, compte réactivé
4. Si 30j écoulés → job cron supprime données, anonymise contenus
**Données supprimées** :
- Profil utilisateur, historique GPS/écoute, sessions
- Contenus créés : anonymisés (`créateur = "Utilisateur supprimé"`)

View File

@@ -0,0 +1,51 @@
# Breach Incidents
📖 Registre violations de données (Article 33 RGPD)
## Diagramme
```mermaid
erDiagram
BREACH_INCIDENTS ||--o{ BREACH_AFFECTED_USERS : "impacte"
USERS ||--o{ BREACH_AFFECTED_USERS : "est impacté"
BREACH_INCIDENTS {
uuid id PK
string severity "low/medium/high/critical"
text description
json data_categories_affected
int estimated_users_count
timestamp detected_at
timestamp contained_at
timestamp cnil_notified_at
timestamp users_notified_at
text mitigation_actions
boolean cnil_notification_required
boolean user_notification_required
}
BREACH_AFFECTED_USERS {
uuid id PK
uuid breach_id FK
uuid user_id FK
timestamp notified_at
string notification_channel "email/push/sms"
}
```
## Légende
**Sévérité** :
- `low`: Pas de notification requise (mesures techniques suffisantes)
- `medium`: Notification CNIL uniquement
- `high`: Notification CNIL + utilisateurs
- `critical`: Notification immédiate tous canaux + SMS fondateur
**Timeline 72h** :
- H+0 : Détection, confinement
- H+24 : Évaluation gravité
- H+48 : Notification CNIL si requis
- H+72 : Notification utilisateurs si risque élevé
**Catégories de données** :
- `data_categories_affected`: JSON `["gps", "email", "listening_history"]`

View File

@@ -0,0 +1,44 @@
# Data Retention Logs
📖 Logs purges automatiques inactivité (Article 5 RGPD - Minimisation)
## Diagramme
```mermaid
erDiagram
DATA_RETENTION_LOGS {
uuid id PK
string action_type
int users_processed
int users_warned
int users_deleted
json details
timestamp executed_at
bigint execution_duration_ms
}
```
## Légende
**Action types** :
- `check_inactive`: Vérification quotidienne comptes inactifs > 5 ans
- `send_warnings`: Envoi notifications (90j/30j/7j avant suppression)
- `delete_accounts`: Suppression effective comptes inactifs
**Règles de conservation** :
- Auditeur : 5 ans inactivité → suppression
- Créateur actif : jamais (tant que contenus écoutés)
- Créateur inactif : 5 ans + 2 ans sans écoute → suppression
**Details JSON** :
```json
{
"threshold_date": "2021-02-08",
"user_ids_deleted": ["uuid1", "uuid2"],
"notifications_sent": {
"90_days": 15,
"30_days": 8,
"7_days": 3
}
}
```

View File

@@ -16,6 +16,15 @@ erDiagram
USERS ||--o{ INTEREST_GAUGES : "possède"
USERS ||--o{ REPORTS : "signale"
USERS ||--o{ DATA_EXPORTS : "demande"
USERS ||--o{ PARENTAL_CONSENTS : "a"
USERS ||--o{ ACCOUNT_DELETIONS : "demande"
USERS ||--o{ USER_PROFILE_HISTORY : "modifie"
PARENTAL_CONSENTS ||--|| PARENTAL_CONTROLS : "configure"
PRIVACY_POLICY_VERSIONS ||--o{ USER_POLICY_ACCEPTANCES : "acceptée par"
USERS ||--o{ USER_POLICY_ACCEPTANCES : "accepte"
BREACH_INCIDENTS ||--o{ BREACH_AFFECTED_USERS : "impacte"
USERS ||--o{ BREACH_AFFECTED_USERS : "est impacté"
CONTENTS ||--o{ LISTENING_HISTORY : "écouté"
CONTENTS }o--|| USERS : "créé par"
@@ -161,6 +170,80 @@ erDiagram
timestamp generated_at
timestamp expires_at
}
PARENTAL_CONSENTS {
uuid id PK
uuid user_id FK
string parent_email
boolean validated
timestamp validated_at
timestamp revoked_at
}
PARENTAL_CONTROLS {
uuid id PK
uuid parental_consent_id FK
boolean gps_enabled
boolean messaging_enabled
boolean content_16plus_enabled
}
PRIVACY_POLICY_VERSIONS {
uuid id PK
string version
boolean major_change
timestamp effective_date
}
USER_POLICY_ACCEPTANCES {
uuid id PK
uuid user_id FK
uuid policy_version_id FK
boolean accepted
timestamp accepted_at
}
ACCOUNT_DELETIONS {
uuid id PK
uuid user_id FK
string status
timestamp requested_at
timestamp effective_at
timestamp deleted_at
}
BREACH_INCIDENTS {
uuid id PK
string severity
int estimated_users_count
timestamp detected_at
timestamp cnil_notified_at
boolean user_notification_required
}
BREACH_AFFECTED_USERS {
uuid id PK
uuid breach_id FK
uuid user_id FK
timestamp notified_at
}
USER_PROFILE_HISTORY {
uuid id PK
uuid user_id FK
string field_name
text old_value
text new_value
timestamp changed_at
}
DATA_RETENTION_LOGS {
uuid id PK
string action_type
int users_processed
int users_deleted
timestamp executed_at
}
```
## Légende
@@ -205,6 +288,27 @@ erDiagram
- **DATA_EXPORTS** : Exports de données utilisateur ([détails](exports.md))
- Portabilité RGPD Article 20, délai 48h max
- **PARENTAL_CONSENTS** : Consentements parentaux 13-15 ans ([détails](parental-consents.md))
- Workflow validation email parent, token expire 7j
- **PARENTAL_CONTROLS** : Paramètres contrôle parental ([détails](parental-consents.md))
- GPS, messagerie, contenus +16 configurables par parent
- **PRIVACY_POLICY_VERSIONS** : Versioning politique confidentialité ([détails](privacy-policy-versions.md))
- Popup si changement majeur, historique acceptations
- **ACCOUNT_DELETIONS** : Suppressions avec grace period 30j ([détails](account-deletions.md))
- Annulation possible, suppression effective automatique
- **BREACH_INCIDENTS** : Registre violations de données ([détails](breach-incidents.md))
- Procédure 72h CNIL, notification utilisateurs si risque élevé
- **USER_PROFILE_HISTORY** : Audit trail modifications profil ([détails](user-profile-history.md))
- Droit rectification Article 16, preuve légale
- **DATA_RETENTION_LOGS** : Logs purges automatiques ([détails](data-retention-logs.md))
- Inactivité 5 ans, notifications 90j/30j/7j
**Entités recommandation & modération** :
- **INTEREST_GAUGES** : Jauges de centres d'intérêt ([détails](interest-gauges.md))

View File

@@ -0,0 +1,49 @@
# Parental Consents
📖 Consentements parentaux pour utilisateurs 13-15 ans (Article 8 RGPD)
## Diagramme
```mermaid
erDiagram
USERS ||--o{ PARENTAL_CONSENTS : "a"
PARENTAL_CONSENTS ||--|| PARENTAL_CONTROLS : "configure"
PARENTAL_CONSENTS {
uuid id PK
uuid user_id FK "Ado 13-15 ans"
string parent_email
string validation_token
boolean validated
timestamp token_expires_at
timestamp validated_at
inet parent_ip
string parent_user_agent
timestamp revoked_at
string revocation_reason
}
PARENTAL_CONTROLS {
uuid id PK
uuid parental_consent_id FK
boolean gps_enabled
boolean messaging_enabled
boolean content_16plus_enabled
json weekly_digest_config
timestamp updated_at
}
```
## Légende
**Workflow** :
1. Ado saisit email parent → `validation_token` généré (expire 7j)
2. Parent clique lien → `validated = true`
3. Parent configure `PARENTAL_CONTROLS`
4. Révocation possible → `revoked_at` renseigné
**Restrictions par défaut (13-15 ans)** :
- `gps_enabled`: `false` (GeoIP uniquement)
- `messaging_enabled`: `false`
- `content_16plus_enabled`: `false`
- Dashboard parent : notifications hebdomadaires activité

View File

@@ -0,0 +1,41 @@
# Privacy Policy Versions
📖 Versioning politique de confidentialité (Articles 13-14 RGPD)
## Diagramme
```mermaid
erDiagram
PRIVACY_POLICY_VERSIONS ||--o{ USER_POLICY_ACCEPTANCES : "acceptée par"
USERS ||--o{ USER_POLICY_ACCEPTANCES : "accepte"
PRIVACY_POLICY_VERSIONS {
uuid id PK
string version "v1.0, v2.0, etc."
text content_markdown
boolean major_change
text changelog
timestamp effective_date
timestamp created_at
}
USER_POLICY_ACCEPTANCES {
uuid id PK
uuid user_id FK
uuid policy_version_id FK
boolean accepted
timestamp accepted_at
inet ip_address
}
```
## Légende
**Versioning** :
- `major_change`: `true` → popup obligatoire pour tous les utilisateurs
- `major_change`: `false` → notification simple
- Fichier source : `docs/legal/politique-confidentialite.md` (versionné Git)
**Popup si changement majeur** :
- Utilisateur doit accepter nouvelle version pour continuer
- Refus → compte gelé (lecture seule)

View File

@@ -0,0 +1,38 @@
# User Profile History
📖 Audit trail modifications profil (Article 16 RGPD - Droit de rectification)
## Diagramme
```mermaid
erDiagram
USERS ||--o{ USER_PROFILE_HISTORY : "modifie"
USER_PROFILE_HISTORY {
uuid id PK
uuid user_id FK
string field_name "email/username/bio/etc."
text old_value
text new_value
string change_reason "user_edit/admin_correction/gdpr_request"
inet ip_address
timestamp changed_at
}
```
## Légende
**Champs trackés** :
- `email`: Re-vérification requise
- `username`: Limite 1 changement/30j
- `bio`, `avatar_url`, `date_of_birth`
**Change reasons** :
- `user_edit`: Modification self-service utilisateur
- `admin_correction`: Correction par admin
- `gdpr_request`: Suite demande RGPD formelle
**Audit** :
- Historique complet conservé (preuve légale)
- Accessible utilisateur : "Historique de mes modifications"
- Accessible DPO : investigations