Authenticate CultMesh authority routes and replay operations
This commit is contained in:
parent
6835ea4c10
commit
f622ee1b24
30 changed files with 1432 additions and 142 deletions
|
|
@ -201,7 +201,8 @@ static async Task<StateResult> MeasureCultMeshQuicStateAsync(int payloadBytes, i
|
|||
[new CultMeshQuicRealtimeTransportConnector(new CultMeshQuicRealtimeConnectorOptions
|
||||
{
|
||||
ValidateProviderCertificate = (_, _, _, _) => true
|
||||
})]);
|
||||
})],
|
||||
LocalDevelopmentSessions());
|
||||
var session = await sessions.ConnectRealtimeAsync(
|
||||
new CultMeshSessionTarget("parity", "service:parity.provider"));
|
||||
var deadline = DateTime.UtcNow.AddSeconds(5);
|
||||
|
|
@ -363,7 +364,8 @@ static async Task<Result> MeasureCultMeshRudpAsync(byte[] payload)
|
|||
discovery,
|
||||
Array.Empty<ICultMeshTransportConnector>(),
|
||||
[new CultMeshLegacyRudpContentTransportConnector(
|
||||
new CultMeshLegacyRudpContentTransportOptions { ResponseTimeout = TimeSpan.FromMinutes(2) })]);
|
||||
new CultMeshLegacyRudpContentTransportOptions { ResponseTimeout = TimeSpan.FromMinutes(2) })],
|
||||
LocalDevelopmentSessions());
|
||||
var provider = new CultMeshSessionContentProvider(
|
||||
"parity.provider", sessions, new CultMeshSessionTarget("parity", "service:parity.provider"));
|
||||
var directory = Path.Combine(Path.GetTempPath(), "cultmesh-transport-parity", Guid.NewGuid().ToString("N"));
|
||||
|
|
@ -411,7 +413,8 @@ static async Task<Result> MeasureCultMeshTcpAsync(byte[] payload)
|
|||
using var sessions = new CultMeshSessionManager(
|
||||
discovery,
|
||||
Array.Empty<ICultMeshTransportConnector>(),
|
||||
[new CultMeshTcpContentTransportConnector()]);
|
||||
[new CultMeshTcpContentTransportConnector()],
|
||||
LocalDevelopmentSessions());
|
||||
var provider = new CultMeshSessionContentProvider(
|
||||
"parity.provider", sessions, new CultMeshSessionTarget("parity", "service:parity.provider"));
|
||||
var directory = Path.Combine(Path.GetTempPath(), "cultmesh-transport-parity", Guid.NewGuid().ToString("N"));
|
||||
|
|
@ -456,6 +459,11 @@ static X509Certificate2 CreateCertificate()
|
|||
static string TempPath(string plane) =>
|
||||
Path.Combine(Path.GetTempPath(), $"cultmesh-parity-{plane}-{Guid.NewGuid():N}.body");
|
||||
|
||||
static CultMeshSessionManagerOptions LocalDevelopmentSessions() => new()
|
||||
{
|
||||
Trust = new CultMeshAuthorityTrustPolicy(CultMeshAuthorityTrustMode.LocalDevelopment)
|
||||
};
|
||||
|
||||
static Socket BindUdpSocket()
|
||||
{
|
||||
var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
|
||||
|
|
|
|||
Loading…
Reference in a new issue