feat: Integrazione completa gestione credenziali per database e REST API con supporto SAP B1 e Salesforce
NUOVE FUNZIONALITÀ: - Aggiunto modulo CredentialManager per gestione centralizzata credenziali - Implementata UI Blazor per gestione credenziali (CredentialManagement.razor) - Supporto completo per credenziali database (SQL Server, MySQL, PostgreSQL, Oracle, SQLite, DB2, SAP HANA) - Gestione unificata REST API con supporto specifico per SAP B1 Service Layer e Salesforce - Test reali di connessione per database, SAP B1 e Salesforce OAuth2 - Selezione dinamica tipo servizio REST (Generico, SAP B1, Salesforce) con campi specifici - Persistenza sicura di credenziali con crittografia password e campi sensibili COMPONENTI AGGIUNTI: - CredentialManager/Models/: CredentialEntity, CredentialModels (DatabaseCredential, RestApiCredential, SapB1ServiceLayerCredential, SalesforceCredential) - CredentialManager/Services/: CredentialService, EncryptionService, DatabaseInitializer - CredentialManager/Data/: CredentialDbContext con Entity Framework - DataConnection/CredentialManagement/: Interfacce e servizi di integrazione - Data_Coupler/Pages/CredentialManagement.razor: UI completa per gestione credenziali MIGLIORAMENTI UI: - Form dinamica per REST API con campi specifici per tipo servizio - Validazione campi obbligatori per Salesforce (ClientId, ClientSecret, SecurityToken) - Test connessione in tempo reale dalla modale di inserimento/modifica - Rimozione sezioni separate per SAP B1 e Salesforce (ora unificate in REST API) - Gestione stato loading durante operazioni async PERSISTENZA AVANZATA: - Campo RestServiceType aggiunto a CredentialEntity con migrazione automatica - Serializzazione campi specifici Salesforce/SAP B1 in AdditionalParameters JSON - Mapping bidirezionale tra entità database e modelli business - Gestione nullability e conversioni tipo sicure SICUREZZA: - Crittografia AES-256 per password e token sensibili - Gestione sicura ConnectionString database - Validazione input e sanitizzazione dati TESTING E CONNETTIVITÀ: - Test autenticazione reale SAP B1 Service Layer - Test OAuth2 Salesforce con supporto Connected App - Test connettività database multi-provider - Logging dettagliato per debugging e monitoraggio CONFIGURAZIONE: - Dependency injection per tutti i servizi - Configurazione Entity Framework con SQLite - Tasks VS Code per build e run - Gestione connection string centralizzata CORREZIONI: - Risolti errori nullability in CredentialService - Aggiunto using Microsoft.JSInterop per IJSRuntime - Fix compilazione e warning Files modificati: 35+ file tra nuovi e aggiornati
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace CredentialManager.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Entità per memorizzare le credenziali nel database
|
||||
/// </summary>
|
||||
public class CredentialEntity
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
[MaxLength(100)]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[MaxLength(50)]
|
||||
public string Type { get; set; } = string.Empty; // Database, REST, etc.
|
||||
|
||||
[MaxLength(50)]
|
||||
public string? DatabaseType { get; set; } // SqlServer, MySql, etc.
|
||||
|
||||
[MaxLength(500)]
|
||||
public string? ConnectionString { get; set; }
|
||||
|
||||
[MaxLength(200)]
|
||||
public string? Host { get; set; }
|
||||
|
||||
public int? Port { get; set; }
|
||||
|
||||
[MaxLength(100)]
|
||||
public string? DatabaseName { get; set; }
|
||||
|
||||
[MaxLength(100)]
|
||||
public string? Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Password criptata
|
||||
/// </summary>
|
||||
public string? EncryptedPassword { get; set; }
|
||||
|
||||
[MaxLength(500)]
|
||||
public string? EncryptedApiKey { get; set; }
|
||||
|
||||
[MaxLength(500)]
|
||||
public string? EncryptedAuthToken { get; set; }
|
||||
|
||||
public int CommandTimeout { get; set; } = 30;
|
||||
|
||||
public int TimeoutSeconds { get; set; } = 100;
|
||||
|
||||
public bool IgnoreSslErrors { get; set; } = false;
|
||||
|
||||
[MaxLength(50)]
|
||||
public string? RestServiceType { get; set; } // Generic, SapB1ServiceLayer, Salesforce
|
||||
|
||||
[MaxLength(2000)]
|
||||
public string? Headers { get; set; } // JSON serialized headers
|
||||
|
||||
[MaxLength(2000)]
|
||||
public string? AdditionalParameters { get; set; } // JSON per parametri aggiuntivi
|
||||
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
|
||||
[MaxLength(100)]
|
||||
public string? CreatedBy { get; set; }
|
||||
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
Reference in New Issue
Block a user