feat!: pre-handshake knock on the agent TCP ports; probes get the agent certificate public key [CI]
ci/woodpecker/push/main-amd64-build Pipeline was successful

This commit is contained in:
justme committed 2026-10-07 18:56:40 +08:00
1 parent f03988d68b
commit b99b95c738
31 files changed
+539 -61

No files matched your search

@@ -1,4 +1,7 @@
using System.Net;
using Microsoft.Extensions.DependencyInjection;
using MoShiro.Backend.Application;
using MoShiro.Protocol;
using System.Text.Json.Nodes;
using MoShiro.TestSupport;
@@ -87,4 +90,14 @@ public sealed class AddressTests
await agent.HelloAsync();
await BackendFixture.EventuallyAsync(async () => (await AgentAsync(id))["public_host"]!.GetValue<string>() == "1.0.0.1");
}
[Fact]
public async Task ProbeAgentList_CarriesTheCertificatePublicKeyTheAgentReported_ForPinningAndKnocking()
{
await using AgentSimulator agent = await _backend.ConnectAgentAsync();
AgentService service = _backend.Services.GetRequiredService<AgentService>();
ProbeAgentList list = await service.ProbeAgentsAsync(_backend.DefaultProbeId, default);
AgentEndpoint endpoint = Assert.Single(list.Agents, a => a.AgentId == agent.NodeId);
Assert.Equal(Convert.ToBase64String(agent.TlsPublicKey), endpoint.PublicKey);
}
}