chore: auto-commit 2026-08-11 22:57 [Heimdall] src/Heimdall.Agent/Services/NetworkCameraScanner.cs, src/Heimdall.Application/DTOs/SiteCredentialDto.cs, src/Heimdall.Application/Services/ICameraDiscoveryService.cs, src/Heimdall.Infrastructure/Services/Discovery/CameraDiscoveryService.cs, src/Heimdall.Infrastructure/Services/Discovery/StreamTesterService.cs…

This commit is contained in:
Arnaud Dartois committed 2026-08-11 22:57:42 +02:00
1 parent ac1871e8d9
commit 6df44cb9e0
6 files changed
+444 -9

No files matched your search

@@ -32,10 +32,12 @@ namespace Heimdall.Api.Controllers;
public class DiscoveryController : ControllerBase
{
private readonly IMediator _mediator;
private readonly ICameraDiscoveryService _discovery;
public DiscoveryController(IMediator mediator)
public DiscoveryController(IMediator mediator, ICameraDiscoveryService discovery)
{
_mediator = mediator;
_discovery = discovery;
}
/// <summary>Probe a single IP address for camera services.</summary>
@@ -130,6 +132,22 @@ public class DiscoveryController : ControllerBase
return File(result.Data, "image/jpeg");
}
/// <summary>
/// Get the agent-captured screenshot of a pending discovery result
/// (in-memory only, TTL 10 min).
/// </summary>
[Authorize(AuthenticationSchemes = "JwtBearer,Cookies", Policy = AppPermissions.CameraRead)]
[HttpGet("results/{resultId:guid}/screenshot")]
[ProducesResponseType(typeof(byte[]), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(void), StatusCodes.Status404NotFound)]
public IActionResult GetDiscoveryScreenshot(Guid resultId)
{
var bytes = _discovery.GetDiscoveryScreenshot(resultId);
if (bytes is null or { Length: 0 })
return NotFound(new { error = "Screenshot not available" });
return File(bytes, "image/jpeg");
}
/// <summary>Cancel a running stream test session.</summary>
[Authorize(AuthenticationSchemes = "JwtBearer,Cookies", Policy = AppPermissions.CameraWrite)]
[HttpPost("test/{sessionId:guid}/cancel")]