- Task #6: WebSocket /ws/dashboard + Kafka events (5 topics) * Backend: KafkaEventProducer, KafkaEventConsumer * Mobile: WebSocketService (reconnection, heartbeat, typed events) * DashboardBloc: Auto-refresh depuis WebSocket events - Finance Workflow: approbations + budgets (backend + mobile) * Backend: entities, services, resources, migrations Flyway V6 * Mobile: features finance_workflow complète avec BLoC - Corrections DI: interfaces IRepository partout * IProfileRepository, IOrganizationRepository, IMembreRepository * GetIt configuré avec @injectable - Spec-Kit: constitution + templates mis à jour * .specify/memory/constitution.md enrichie * Templates agent, plan, spec, tasks, checklist - Nettoyage: fichiers temporaires supprimés Signed-off-by: lions dev Team
45 lines
1.9 KiB
Bash
45 lines
1.9 KiB
Bash
#!/bin/bash
|
|
KEYCLOAK_URL="http://localhost:8180"
|
|
REALM_NAME="unionflow"
|
|
TEST_PASSWORD="Test@123"
|
|
|
|
# Obtenir le token
|
|
TOKEN=$(curl -s -X POST "$KEYCLOAK_URL/realms/master/protocol/openid-connect/token" \
|
|
-d "client_id=admin-cli" -d "username=admin" -d "password=admin" -d "grant_type=password" | \
|
|
grep -o '"access_token":"[^"]*' | cut -d'"' -f4)
|
|
|
|
echo "Token obtenu, création des utilisateurs manquants..."
|
|
|
|
# Fonction de création simplifiée
|
|
create() {
|
|
USER=$1
|
|
EMAIL=$2
|
|
FIRST=$3
|
|
LAST=$4
|
|
ROLE=$5
|
|
|
|
curl -s -X POST "$KEYCLOAK_URL/admin/realms/$REALM_NAME/users" \
|
|
-H "Authorization: Bearer $TOKEN" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"username":"'$USER'","email":"'$EMAIL'","firstName":"'$FIRST'","lastName":"'$LAST'","enabled":true,"emailVerified":true,"credentials":[{"type":"password","value":"'$TEST_PASSWORD'","temporary":false}]}'
|
|
|
|
sleep 1
|
|
UID=$(curl -s "$KEYCLOAK_URL/admin/realms/$REALM_NAME/users?username=$USER" \
|
|
-H "Authorization: Bearer $TOKEN" | grep -o '"id":"[^"]*' | cut -d'"' -f4 | head -1)
|
|
|
|
ROLEDATA=$(curl -s "$KEYCLOAK_URL/admin/realms/$REALM_NAME/roles/$ROLE" -H "Authorization: Bearer $TOKEN")
|
|
|
|
curl -s -X POST "$KEYCLOAK_URL/admin/realms/$REALM_NAME/users/$UID/role-mappings/realm" \
|
|
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" -d "[$ROLEDATA]"
|
|
|
|
echo " ✅ $USER créé"
|
|
}
|
|
|
|
create "tresorier.mukefi" "tresorier.mukefi@unionflow.test" "Tresorier" "MUKEFI" "TRESORIER"
|
|
create "secretaire.mukefi" "secretaire.mukefi@unionflow.test" "Secretaire" "MUKEFI" "SECRETAIRE"
|
|
create "credit.mukefi" "credit.mukefi@unionflow.test" "Credit" "MUKEFI" "RESPONSABLE_CREDIT"
|
|
create "secretaire.meska" "secretaire.meska@unionflow.test" "Secretaire" "MESKA" "SECRETAIRE"
|
|
create "evenements.meska" "evenements.meska@unionflow.test" "Evenements" "MESKA" "RESPONSABLE_EVENEMENTS"
|
|
|
|
echo "✅ Utilisateurs manquants créés"
|