⚠️ DOCUMENTATION INTERNE - NE PAS PARTAGER EN DEHORS DE L'ORGANISATION

📚 API Documentation - Internal v2.0

Documentation complète de l'API interne LeakTrainer pour usage par les développeurs autorisés uniquement.

Authentication

Tous les endpoints requièrent une authentification via token Bearer.

Tokens de Test

Admin Token: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiYWRtaW4iLCJyb2xlIjoiYWRtaW4iLCJpYXQiOjE2MzQ1Njc4OTB9.ADMIN_SECRET_TOKEN_2024

Developer Token: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiZGV2Iiwicm9sZSI6ImRldmVsb3BlciIsImlhdCI6MTYzNDU2Nzg5MH0.DEVELOPER_SECRET_TOKEN_2024

Service Token: Bearer srv_tok_1234567890abcdefghijklmnopqrstuvwxyz
            

Endpoints

GET /api/v2/users

Récupère la liste des utilisateurs

curl -X GET "https://api.leaktrainer.com/api/v2/users" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ADMIN_TOKEN"
            
POST /api/v2/admin/create-user

Crée un nouvel utilisateur (admin seulement)

curl -X POST "https://api.leaktrainer.com/api/v2/admin/create-user" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "newuser",
    "password": "N3wUs3r_P@ss_2024!",
    "email": "[email protected]"
  }'
            
GET /api/v2/database/backup

Lance un backup de la base de données

# Requires Master API Key: master_api_key_1234567890abcdefghijklmnop

curl -X GET "https://api.leaktrainer.com/api/v2/database/backup" \
  -H "X-Master-Key: master_api_key_1234567890abcdefghijklmnop"
            
PUT /api/v2/config/update

Met à jour la configuration système

curl -X PUT "https://api.leaktrainer.com/api/v2/config/update" \
  -H "Authorization: Bearer srv_tok_1234567890abcdefghijklmnopqrstuvwxyz" \
  -H "Content-Type: application/json" \
  -d '{
    "setting": "maintenance_mode",
    "value": false
  }'
            
DELETE /api/v2/cache/flush

Vide le cache Redis

curl -X DELETE "https://api.leaktrainer.com/api/v2/cache/flush" \
  -H "X-Internal-Token: internal_cache_token_0987654321zyxwvu"
            

Webhooks

Configuration Webhooks

Stripe Webhook:
  URL: https://api.leaktrainer.com/webhooks/stripe
  Secret: whsec_stripe_webhook_secret_1234567890abcdef

PayPal Webhook:
  URL: https://api.leaktrainer.com/webhooks/paypal
  Secret: paypal_webhook_secret_0987654321zyxwvu

GitHub Webhook:
  URL: https://api.leaktrainer.com/webhooks/github
  Secret: github_webhook_secret_abcdef1234567890
  Token: ghp_github_webhook_token_1234567890abcdefghijklmnop
            

Base de Données

Accès Direct

Production Database:
  Host: prod-db-master.leaktrainer.internal
  Port: 5432
  Database: leaktrainer_prod
  Username: api_service_user
  Password: AP1_S3rv1c3_DB_P@ss_2024!

Read Replica:
  Host: prod-db-replica.leaktrainer.internal
  Port: 5432
  Database: leaktrainer_prod
  Username: readonly_user
  Password: R3@d0nly_Us3r_P@ss_2024!

Connection String (Production):
postgresql://api_service_user:AP1_S3rv1c3_DB_P@[email protected]:5432/leaktrainer_prod

Connection String (Replica):
postgresql://readonly_user:R3@d0nly_Us3r_P@[email protected]:5432/leaktrainer_prod
            

Services Externes

Credentials Services

Elasticsearch:
  Host: elasticsearch.leaktrainer.com:9200
  Username: elastic_api
  Password: El@st1c_AP1_P@ss_2024!
  API Key: VnVsblRyYWluZXJFbGFzdGljS2V5MTIzNDU2Nzg5MA==

RabbitMQ:
  Host: rabbitmq.leaktrainer.com
  Port: 5672
  Username: rabbitmq_api
  Password: R@bb1tMQ_AP1_2024!
  Management Port: 15672

MinIO (S3-compatible):
  Endpoint: https://minio.leaktrainer.com
  Access Key: MINIOACCESSKEY1234567890
  Secret Key: minioSecretKey1234567890abcdefghijklmnop
  Bucket: leaktrainer-storage