diff --git a/src/Heimdall.Agent/Services/AgentRegistrationService.cs b/src/Heimdall.Agent/Services/AgentRegistrationService.cs index aca1d7e..7580322 100644 --- a/src/Heimdall.Agent/Services/AgentRegistrationService.cs +++ b/src/Heimdall.Agent/Services/AgentRegistrationService.cs @@ -215,9 +215,9 @@ internal sealed record RegisterResponse( [property: JsonPropertyName("apiKeyPrefix")] string ApiKeyPrefix); internal sealed record HeartbeatRequest( - [property: JsonPropertyName("publicIp")] string? PublicIp, - [property: JsonPropertyName("isOffline")] bool IsOffline = false, - [property: JsonPropertyName("cpuUsagePercent")] double? CpuUsagePercent = null, - [property: JsonPropertyName("memoryUsageBytes")] long? MemoryUsageBytes = null, - [property: JsonPropertyName("diskUsagePercent")] double? DiskUsagePercent = null, - [property: JsonPropertyName("uptimeSeconds")] long? UptimeSeconds = null); + [property: JsonPropertyName("publicIp")] string? PublicIp, + [property: JsonPropertyName("isOffline")] bool IsOffline = false, + [property: JsonPropertyName("cpuUsagePercent")] double? CpuUsagePercent = null, + [property: JsonPropertyName("memoryUsageBytes")] long? MemoryUsageBytes = null, + [property: JsonPropertyName("diskUsagePercent")] double? DiskUsagePercent = null, + [property: JsonPropertyName("uptimeSeconds")] long? UptimeSeconds = null); diff --git a/src/Heimdall.Agent/Services/SnapshotPipelineService.cs b/src/Heimdall.Agent/Services/SnapshotPipelineService.cs index 12f6dd3..e8beed2 100644 --- a/src/Heimdall.Agent/Services/SnapshotPipelineService.cs +++ b/src/Heimdall.Agent/Services/SnapshotPipelineService.cs @@ -229,7 +229,10 @@ public sealed class SnapshotPipelineService : BackgroundService { detection.Label, detection.Confidence, - detection.X, detection.Y, detection.Width, detection.Height, + detection.X, + detection.Y, + detection.Width, + detection.Height, }); await _detectionReporter.ReportAsync( diff --git a/src/Heimdall.Application/DTOs/SettingDto.cs b/src/Heimdall.Application/DTOs/SettingDto.cs index 850281a..ee23680 100644 --- a/src/Heimdall.Application/DTOs/SettingDto.cs +++ b/src/Heimdall.Application/DTOs/SettingDto.cs @@ -6,25 +6,25 @@ namespace Heimdall.Application.DTOs; /// A global application setting visible to all agents unless overridden. /// public sealed record AppSettingDto( - [property: JsonPropertyName("id")] Guid Id, - [property: JsonPropertyName("key")] string Key, - [property: JsonPropertyName("value")] string Value, - [property: JsonPropertyName("description")] string? Description, - [property: JsonPropertyName("category")] string Category, - [property: JsonPropertyName("valueType")] string ValueType, - [property: JsonPropertyName("allowedValues")] string? AllowedValues, - [property: JsonPropertyName("updatedAt")] DateTime UpdatedAt, - [property: JsonPropertyName("agentScoped")] bool AgentScoped = true + [property: JsonPropertyName("id")] Guid Id, + [property: JsonPropertyName("key")] string Key, + [property: JsonPropertyName("value")] string Value, + [property: JsonPropertyName("description")] string? Description, + [property: JsonPropertyName("category")] string Category, + [property: JsonPropertyName("valueType")] string ValueType, + [property: JsonPropertyName("allowedValues")] string? AllowedValues, + [property: JsonPropertyName("updatedAt")] DateTime UpdatedAt, + [property: JsonPropertyName("agentScoped")] bool AgentScoped = true ); /// /// Per-agent setting override. /// public sealed record AgentSettingDto( - [property: JsonPropertyName("id")] Guid Id, - [property: JsonPropertyName("agentId")] Guid AgentId, - [property: JsonPropertyName("key")] string Key, - [property: JsonPropertyName("value")] string Value, + [property: JsonPropertyName("id")] Guid Id, + [property: JsonPropertyName("agentId")] Guid AgentId, + [property: JsonPropertyName("key")] string Key, + [property: JsonPropertyName("value")] string Value, [property: JsonPropertyName("updatedAt")] DateTime UpdatedAt ); @@ -32,31 +32,31 @@ public sealed record AgentSettingDto( /// Request to create a new global setting. /// public sealed record CreateAppSettingRequest( - [property: JsonPropertyName("key")] string Key, - [property: JsonPropertyName("value")] string Value, - [property: JsonPropertyName("category")] string Category = "General", - [property: JsonPropertyName("description")] string? Description = null, - [property: JsonPropertyName("valueType")] string ValueType = "string", + [property: JsonPropertyName("key")] string Key, + [property: JsonPropertyName("value")] string Value, + [property: JsonPropertyName("category")] string Category = "General", + [property: JsonPropertyName("description")] string? Description = null, + [property: JsonPropertyName("valueType")] string ValueType = "string", [property: JsonPropertyName("allowedValues")] string? AllowedValues = null, - [property: JsonPropertyName("agentScoped")] bool AgentScoped = true + [property: JsonPropertyName("agentScoped")] bool AgentScoped = true ); /// /// Request to update an existing global setting value. /// public sealed record UpdateAppSettingRequest( - [property: JsonPropertyName("value")] string Value, - [property: JsonPropertyName("description")] string? Description = null, - [property: JsonPropertyName("category")] string? Category = null, - [property: JsonPropertyName("valueType")] string? ValueType = null, + [property: JsonPropertyName("value")] string Value, + [property: JsonPropertyName("description")] string? Description = null, + [property: JsonPropertyName("category")] string? Category = null, + [property: JsonPropertyName("valueType")] string? ValueType = null, [property: JsonPropertyName("allowedValues")] string? AllowedValues = null, - [property: JsonPropertyName("agentScoped")] bool? AgentScoped = null + [property: JsonPropertyName("agentScoped")] bool? AgentScoped = null ); /// /// Request to set a per-agent setting override. /// public sealed record SetAgentSettingRequest( - [property: JsonPropertyName("key")] string Key, + [property: JsonPropertyName("key")] string Key, [property: JsonPropertyName("value")] string Value ); diff --git a/src/Heimdall.Domain/Entities/UserNotificationConfig.cs b/src/Heimdall.Domain/Entities/UserNotificationConfig.cs index 46850dc..694c1b9 100644 --- a/src/Heimdall.Domain/Entities/UserNotificationConfig.cs +++ b/src/Heimdall.Domain/Entities/UserNotificationConfig.cs @@ -5,7 +5,7 @@ namespace Heimdall.Domain.Entities; /// /// Per-user notification preferences including channel configuration, - /// language, digest schedule, and subscribed event types. +/// language, digest schedule, and subscribed event types. /// public class UserNotificationConfig : Entity, IAuditableEntity { diff --git a/src/Heimdall.Infrastructure/BackgroundJobs/DependencyInjection.cs b/src/Heimdall.Infrastructure/BackgroundJobs/DependencyInjection.cs index 5d6adde..e1530ab 100644 --- a/src/Heimdall.Infrastructure/BackgroundJobs/DependencyInjection.cs +++ b/src/Heimdall.Infrastructure/BackgroundJobs/DependencyInjection.cs @@ -18,7 +18,7 @@ public static class DependencyInjection if (string.IsNullOrEmpty(connectionString)) return services; -// CS0618: UsePostgreSqlStorage is marked obsolete in Hangfire.PostgreSql 1.20.x. + // CS0618: UsePostgreSqlStorage is marked obsolete in Hangfire.PostgreSql 1.20.x. // Upgrade to Hangfire.PostgreSql 2.x when available which uses SCHEMA-based storage. // Track: https://github.com/HangfireStorage/Hangfire.PostgreSql/issues services.AddHangfire(config => diff --git a/src/Heimdall.Infrastructure/Services/Discovery/ArpProbeService.cs b/src/Heimdall.Infrastructure/Services/Discovery/ArpProbeService.cs index 947cd57..378971a 100644 --- a/src/Heimdall.Infrastructure/Services/Discovery/ArpProbeService.cs +++ b/src/Heimdall.Infrastructure/Services/Discovery/ArpProbeService.cs @@ -105,7 +105,7 @@ public sealed partial class ArpProbeService : IArpProbeService var mac = match.Groups[2].Value; var vendor = ResolveVendor(mac); - _logger.LogDebug("ARP entry found for {Ip}: MAC={Mac}, Vendor={Vendor}", ipAddress, mac, vendor); + _logger.LogDebug("ARP entry found for {Ip}: MAC={Mac}, Vendor={Vendor}", ipAddress, mac, vendor); return new ArpEntry(mac, vendor); } diff --git a/src/Heimdall.Web/Controllers/SettingsController.cs b/src/Heimdall.Web/Controllers/SettingsController.cs index 899caa4..0e42025 100644 --- a/src/Heimdall.Web/Controllers/SettingsController.cs +++ b/src/Heimdall.Web/Controllers/SettingsController.cs @@ -294,9 +294,13 @@ public class SettingsController : ControllerBase var topic = string.IsNullOrWhiteSpace(request?.Topic) ? "heimdall-test" : request.Topic; var ok = await ntfyService.SendTestAsync(topic, "Heimdall — test de configuration", "✅ Notification ntfy reçue : le serveur est joignable et le token est accepté.", ct); - return Ok(new { success = ok, message = ok + return Ok(new + { + success = ok, + message = ok ? $"Notification test envoyée sur le topic « {topic} »" - : "Échec de l'envoi ntfy (serveur injoignable ou rejet — voir les logs)." }); + : "Échec de l'envoi ntfy (serveur injoignable ou rejet — voir les logs)." + }); } /// diff --git a/src/Heimdall.Web/Program.cs b/src/Heimdall.Web/Program.cs index 7655764..b0c6e83 100644 --- a/src/Heimdall.Web/Program.cs +++ b/src/Heimdall.Web/Program.cs @@ -74,7 +74,8 @@ internal sealed record SignInRequest( // Partial class declaration so WebApplicationFactory // works in integration tests. -public partial class Program { +public partial class Program +{ // Shared JWT validation parameters — single source of truth for auth. internal static TokenValidationParameters GetJwtValidationParameters(string key, string issuer, string audience) => new() { diff --git a/src/Heimdall.Web/Services/HeimdallApiClient.cs b/src/Heimdall.Web/Services/HeimdallApiClient.cs index f4747a0..55d0df2 100644 --- a/src/Heimdall.Web/Services/HeimdallApiClient.cs +++ b/src/Heimdall.Web/Services/HeimdallApiClient.cs @@ -779,15 +779,15 @@ public record UpdateAppSettingRequest( // ─── Agent Settings DTOs ─────────────────────────────────────────── public record AgentSettingItem( - [property: JsonPropertyName("id")] Guid Id, - [property: JsonPropertyName("agentId")] Guid AgentId, - [property: JsonPropertyName("key")] string Key, - [property: JsonPropertyName("value")] string Value, + [property: JsonPropertyName("id")] Guid Id, + [property: JsonPropertyName("agentId")] Guid AgentId, + [property: JsonPropertyName("key")] string Key, + [property: JsonPropertyName("value")] string Value, [property: JsonPropertyName("updatedAt")] DateTime UpdatedAt ); public record SetAgentSettingRequest( - [property: JsonPropertyName("key")] string Key, + [property: JsonPropertyName("key")] string Key, [property: JsonPropertyName("value")] string Value );