- 6 docs racine (README, HANDOVER, ARCHITECTURE, DECISIONS, INSTALL, OPERATIONS) - 9 docs thématiques dans docs/ - 10 templates docker-compose dans configs/ - 7 scripts Python/Shell d'import Furious vers Zitadel - 2 matrices RBAC Etat infra au 5 juin 2026 : - 88 users Furious importes dans Zitadel - 8 roles RBAC crees et attribues - Intranet filtre les cartes selon role (Approche A) - 7 outils SSO operationnels
50 lines
1.7 KiB
Bash
Executable File
50 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# ============================================================================
|
|
# read-all-users.sh — Récupère la liste des users depuis l'API Furious Squad.
|
|
# ============================================================================
|
|
# Output : furious-users-raw.json
|
|
# ============================================================================
|
|
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
ENV_FILE="$SCRIPT_DIR/.env"
|
|
OUTPUT="$SCRIPT_DIR/furious-users-raw.json"
|
|
|
|
if [ ! -f "$ENV_FILE" ]; then
|
|
echo "❌ Fichier .env manquant"
|
|
exit 1
|
|
fi
|
|
|
|
source "$ENV_FILE"
|
|
|
|
if [ -z "$FURIOUS_USERNAME" ] || [ -z "$FURIOUS_PASSWORD" ] || [ -z "$FURIOUS_API_URL" ]; then
|
|
echo "❌ Variables manquantes dans .env"
|
|
exit 1
|
|
fi
|
|
|
|
echo "🔄 Récupération des users Furious..."
|
|
|
|
# Appel API : User > Search (retourne tous les users actifs et inactifs)
|
|
curl -s -u "$FURIOUS_USERNAME:$FURIOUS_PASSWORD" \
|
|
-X POST "$FURIOUS_API_URL" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{
|
|
"User": {
|
|
"Search": {
|
|
"fields": ["id", "first_name", "last_name", "email", "pseudo", "job_title", "bu_name", "manager_pseudo", "status", "arrival_date", "departure_date", "entity_name"],
|
|
"limit": 200
|
|
}
|
|
}
|
|
}' > "$OUTPUT"
|
|
|
|
# Vérifier qu'on a bien des données
|
|
TOTAL=$(python3 -c "import json; data=json.load(open('$OUTPUT')); print(len(data.get('data', {}).get('User', [])))")
|
|
ACTIFS=$(python3 -c "import json; data=json.load(open('$OUTPUT')); print(sum(1 for u in data.get('data', {}).get('User', []) if u.get('departure_date') == '0000-00-00'))")
|
|
|
|
echo "✅ Fichier généré : $OUTPUT"
|
|
echo " Total : $TOTAL users"
|
|
echo " Actifs : $ACTIFS users"
|
|
|
|
chmod 600 "$OUTPUT"
|