Files
Heimdall/src/Heimdall.Application/DTOs/SiteCredentialDto.cs
T
Arnaud Dartois d24a288684
Heimdall Gitea / Build and scan server image (pull_request) Canceled after 0s
Heimdall Gitea / Build and scan agent image (pull_request) Canceled after 0s
Heimdall Gitea / Publish Docker Hub latest tags (pull_request) Canceled after 0s
Heimdall Gitea / Publish versioned release (pull_request) Canceled after 0s
Heimdall Gitea / Build and tests (pull_request) Canceled after 6m26s
fix(discovery): use agent for HomeKit mDNS
2026-10-24 23:23:16 +02:00

111 lines
4.3 KiB
C#

namespace Heimdall.Application.DTOs;
// ────────────────────────────────────────────────────────────────────
// Site credentials (pool of login/password pairs for camera discovery)
// ────────────────────────────────────────────────────────────────────
/// <summary>Credential pair declared for a site. Password is write-only: never returned by the API.</summary>
public record SiteCredentialResponse(
Guid Id,
Guid SiteId,
string Label,
string Username,
DateTime CreatedAt,
DateTime? LastUsedAt);
/// <summary>Add a credential pair to a site.</summary>
public record AddSiteCredentialRequest(
string Label,
string Username,
string Password);
/// <summary>
/// A credential pair shipped inside the agent config envelope. The password is
/// only ever present inside the encrypted envelope — never in plain settings.
/// </summary>
public record AgentCameraCredential(
string Label,
string Username,
string Password);
// ────────────────────────────────────────────────────────────────────
// Agent-submitted discovery results
// ────────────────────────────────────────────────────────────────────
/// <summary>
/// A single device detected by an agent's network scan. The agent performs
/// the probes (ports, HTTP header, ONVIF WS-Discovery, HomeKit mDNS, ARP) and
/// reports devices already identified — ONVIF manufacturer/model are filled
/// in by the agent when authentication with a pool credential succeeded. The
/// Central only persists the results.
/// </summary>
public record AgentDiscoveredDevice(
string Ip,
bool IsReachable,
int[] OpenPorts,
string? MacAddress,
string? Vendor,
string? Hostname,
string? HttpServerHeader,
int? HttpStatusCode,
int? HttpPort,
string? OnvifDeviceServiceUrl,
string? OnvifName,
string? OnvifHardware,
int? OnvifPort,
string? HomeKitName,
string? HomeKitDeviceId,
string? HomeKitModel,
string? CredentialLabel = null,
string[]? StreamUrls = null,
string? ScreenshotBase64 = null,
int? HomeKitCategory = null,
bool? HomeKitIsPaired = null,
int? HomeKitPort = null);
/// <summary>Response to an agent's discovery submission.</summary>
public record AgentDiscoverySubmitResponse(
int Received,
int New,
int Updated);
// ────────────────────────────────────────────────────────────────────
// Pending discovery results (UI)
// ────────────────────────────────────────────────────────────────────
/// <summary>A persisted discovery result exposed to the UI for confirmation.</summary>
public record PendingDiscoveryResponse(
Guid Id,
Guid SiteId,
string IpAddress,
string? MacAddress,
string? Vendor,
string? Hostname,
bool IsReachable,
string DetectedType,
string DiscoveryMethod,
int[] OpenPorts,
string? OnvifDeviceServiceUrl,
string? OnvifName,
string? OnvifHardware,
int? OnvifPort,
string? HttpServerHeader,
int? HttpStatusCode,
int? HttpPort,
DateTime ProbedAt,
bool IsProcessed,
string[] StreamUrls,
bool HasScreenshot = false,
string? HomeKitName = null,
string? HomeKitDeviceId = null,
string? HomeKitModel = null,
int? HomeKitCategory = null,
bool? HomeKitIsPaired = null,
int? HomeKitPort = null);
/// <summary>Request to reject (ignore) a pending discovery result.</summary>
public record RejectDiscoveryRequest(Guid ResultId);
/// <summary>Result of a scan-now request broadcast to site agents.</summary>
public record ScanNowResponse(int AgentsNotified);