Files
btpxpress-frontend/get-client-secret.ps1
dahoud ec38f6a23a feat: Module Devis professionnel avec écrans complets
Création de 2 écrans professionnels pour le module Devis:

1. devis/nouveau.xhtml:
   - 4 sections: Informations générales, Détail du devis, Montants, Conditions
   - Numéro auto-généré avec icône
   - Statut avec 5 valeurs (BROUILLON, ATTENTE, ACCEPTE, REFUSE, EXPIRE)
   - Dates d'émission et validité avec calendriers
   - Client et objet du devis requis
   - Placeholder pour lignes de devis (future développement)
   - Calcul automatique TVA 18% et TTC
   - Récapitulatif visuel HT/TVA/TTC avec composant monétaire
   - Conditions de paiement et remarques (section collapsible)
   - 3 boutons: Annuler, Brouillon, Envoyer

2. devis/details.xhtml:
   - En-tête: numéro, statut, client, objet, dates
   - Actions: Retour, Convertir en chantier, PDF, Modifier
   - 4 KPI cards: Montant HT, TVA, TTC, Statut
   - 6 onglets professionnels:
     * Vue d'ensemble: infos + récap financier + actions rapides
     * Détail des lignes: table lignes (placeholder)
     * Conditions: paiement, délais, garanties
     * Documents: GED associée (placeholder)
     * Suivi: timeline actions
     * Historique: modifications (placeholder)

Corrections:
- Fix navigation /factures/nouvelle -> /factures/nouveau (factures.xhtml)
- Fix menu /factures/nouvelle -> /factures/nouveau (menu.xhtml)

Tous les composants réutilisables utilisés (status-badge, monetary-display).
Validation complète côté client et serveur.
UI/UX professionnel adapté au métier BTP.
2025-11-08 10:49:19 +00:00

109 lines
3.9 KiB
PowerShell

# Script pour recuperer ou generer le secret du client btpxpress-frontend
$KEYCLOAK_URL = "https://security.lions.dev"
$REALM = "btpxpress"
$CLIENT_ID = "btpxpress-frontend"
Write-Host "Recuperation du secret pour $CLIENT_ID..." -ForegroundColor Yellow
# Obtenir le token
$body = @{
grant_type = "password"
client_id = "admin-cli"
username = "admin"
password = "KeycloakAdmin2025!"
}
$tokenResponse = Invoke-RestMethod -Uri "$KEYCLOAK_URL/realms/master/protocol/openid-connect/token" -Method Post -ContentType "application/x-www-form-urlencoded" -Body $body
$token = $tokenResponse.access_token
$headers = @{
Authorization = "Bearer $token"
"Content-Type" = "application/json"
}
# Recuperer le client
$clients = Invoke-RestMethod -Uri "$KEYCLOAK_URL/admin/realms/$REALM/clients" -Method Get -Headers $headers
$client = $clients | Where-Object { $_.clientId -eq $CLIENT_ID }
Write-Host ""
Write-Host "Configuration actuelle:" -ForegroundColor Cyan
Write-Host " Client ID: $($client.clientId)" -ForegroundColor White
Write-Host " Type: $(if ($client.publicClient) { 'Public' } else { 'Confidential' })" -ForegroundColor White
# Verifier si le client est public
if ($client.publicClient) {
Write-Host ""
Write-Host "Le client est actuellement PUBLIC. Conversion en CONFIDENTIAL..." -ForegroundColor Yellow
# Convertir en confidential
$client.publicClient = $false
$client.serviceAccountsEnabled = $true
$body = $client | ConvertTo-Json -Depth 10
try {
Invoke-RestMethod -Uri "$KEYCLOAK_URL/admin/realms/$REALM/clients/$($client.id)" `
-Method Put `
-Headers $headers `
-Body $body | Out-Null
Write-Host "Client converti en CONFIDENTIAL" -ForegroundColor Green
}
catch {
Write-Host "Erreur lors de la conversion: $_" -ForegroundColor Red
exit 1
}
}
# Recuperer le secret du client
Write-Host ""
Write-Host "Recuperation du secret..." -ForegroundColor Yellow
try {
$secretResponse = Invoke-RestMethod -Uri "$KEYCLOAK_URL/admin/realms/$REALM/clients/$($client.id)/client-secret" `
-Method Get `
-Headers $headers
$clientSecret = $secretResponse.value
Write-Host ""
Write-Host "========================================" -ForegroundColor Green
Write-Host "CLIENT SECRET RECUPERE!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Green
Write-Host ""
Write-Host "Client ID: $CLIENT_ID" -ForegroundColor Cyan
Write-Host "Client Secret: $clientSecret" -ForegroundColor Yellow
Write-Host ""
Write-Host "Ajoutez cette ligne dans application.properties:" -ForegroundColor Cyan
Write-Host "quarkus.oidc.credentials.secret=$clientSecret" -ForegroundColor White
Write-Host ""
}
catch {
Write-Host "Erreur lors de la recuperation du secret: $_" -ForegroundColor Red
Write-Host "Le secret n'existe peut-etre pas. Generation d'un nouveau secret..." -ForegroundColor Yellow
try {
$newSecretResponse = Invoke-RestMethod -Uri "$KEYCLOAK_URL/admin/realms/$REALM/clients/$($client.id)/client-secret" `
-Method Post `
-Headers $headers
$clientSecret = $newSecretResponse.value
Write-Host ""
Write-Host "========================================" -ForegroundColor Green
Write-Host "NOUVEAU CLIENT SECRET GENERE!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Green
Write-Host ""
Write-Host "Client ID: $CLIENT_ID" -ForegroundColor Cyan
Write-Host "Client Secret: $clientSecret" -ForegroundColor Yellow
Write-Host ""
Write-Host "Ajoutez cette ligne dans application.properties:" -ForegroundColor Cyan
Write-Host "quarkus.oidc.credentials.secret=$clientSecret" -ForegroundColor White
Write-Host ""
}
catch {
Write-Host "Erreur lors de la generation du secret: $_" -ForegroundColor Red
}
}