chore: auto-commit 2026-08-12 20:05 [Heimdall] src/Heimdall.Agent/Services/AgentRegistrationService.cs, src/Heimdall.Agent/Services/SnapshotPipelineService.cs, src/Heimdall.Application/DTOs/SettingDto.cs, src/Heimdall.Domain/Entities/UserNotificationConfig.cs, src/Heimdall.Infrastructure/BackgroundJobs/DependencyInjection.cs…

This commit is contained in:
Arnaud Dartois committed 2026-08-12 20:05:12 +02:00
1 parent 0ab266e0bf
commit 566aa84bc7
9 files changed
+51 -43

No files matched your search

@@ -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);
@@ -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(
+25 -25
View File
@@ -6,25 +6,25 @@ namespace Heimdall.Application.DTOs;
/// A global application setting visible to all agents unless overridden.
/// </summary>
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
);
/// <summary>
/// Per-agent setting override.
/// </summary>
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.
/// </summary>
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
);
/// <summary>
/// Request to update an existing global setting value.
/// </summary>
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
);
/// <summary>
/// Request to set a per-agent setting override.
/// </summary>
public sealed record SetAgentSettingRequest(
[property: JsonPropertyName("key")] string Key,
[property: JsonPropertyName("key")] string Key,
[property: JsonPropertyName("value")] string Value
);
@@ -5,7 +5,7 @@ namespace Heimdall.Domain.Entities;
/// <summary>
/// Per-user notification preferences including channel configuration,
/// language, digest schedule, and subscribed event types.
/// language, digest schedule, and subscribed event types.
/// </summary>
public class UserNotificationConfig : Entity<Guid>, IAuditableEntity
{
@@ -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 =>
@@ -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);
}
@@ -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)."
});
}
/// <summary>
+2 -1
View File
@@ -74,7 +74,8 @@ internal sealed record SignInRequest(
// Partial class declaration so WebApplicationFactory<Program>
// 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()
{
@@ -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
);