Bind CultMesh authority identity to physical routes
This commit is contained in:
parent
21163d83fa
commit
6c848bd6c0
45 changed files with 1671 additions and 194 deletions
|
|
@ -339,6 +339,12 @@ static async Task<Result> MeasureCultMeshRudpAsync(byte[] payload)
|
|||
MaxPendingReliablePackets = 8192
|
||||
});
|
||||
using var contentServer = new CultMeshLegacyRudpContentServer(wireServer, providerCache);
|
||||
using var identityServer = new CultMeshSessionIdentityServer(
|
||||
wireServer,
|
||||
"service:parity.provider",
|
||||
["parity"],
|
||||
[CultMeshProtocols.Content.Value],
|
||||
["parity-route-1"]);
|
||||
using var pumpCancellation = new CancellationTokenSource();
|
||||
var pump = Task.Run(async () =>
|
||||
{
|
||||
|
|
@ -359,7 +365,7 @@ static async Task<Result> MeasureCultMeshRudpAsync(byte[] payload)
|
|||
[new CultMeshLegacyRudpContentTransportConnector(
|
||||
new CultMeshLegacyRudpContentTransportOptions { ResponseTimeout = TimeSpan.FromMinutes(2) })]);
|
||||
var provider = new CultMeshSessionContentProvider(
|
||||
"parity.provider", sessions, CultMeshEndpointId.Parse("service:parity.provider"));
|
||||
"parity.provider", sessions, new CultMeshSessionTarget("parity", "service:parity.provider"));
|
||||
var directory = Path.Combine(Path.GetTempPath(), "cultmesh-transport-parity", Guid.NewGuid().ToString("N"));
|
||||
using var transferState = new CultCache(CultMesh.CreateCultCacheDocumentRegistry(
|
||||
typeof(CultMeshContentTransferStateDocument)));
|
||||
|
|
@ -392,7 +398,14 @@ static async Task<Result> MeasureCultMeshTcpAsync(byte[] payload)
|
|||
await CultMeshCdn.PublishAsync(providerCache, artifact);
|
||||
|
||||
using var contentServer = new CultMeshTcpContentServer(
|
||||
new TcpListener(IPAddress.Loopback, 0), providerCache);
|
||||
new TcpListener(IPAddress.Loopback, 0),
|
||||
providerCache,
|
||||
new CultMeshTcpContentServerOptions
|
||||
{
|
||||
VerseId = "parity",
|
||||
AuthorityRuntimeId = "service:parity.provider",
|
||||
RouteGeneration = "parity-route-1"
|
||||
});
|
||||
var endpoint = $"{CultMeshTcpContentTransportConnector.Scheme}://127.0.0.1:{contentServer.LocalEndPoint.Port}";
|
||||
using var discovery = new CultMeshDiscoveryService([new RouteSource(endpoint)]);
|
||||
using var sessions = new CultMeshSessionManager(
|
||||
|
|
@ -400,7 +413,7 @@ static async Task<Result> MeasureCultMeshTcpAsync(byte[] payload)
|
|||
Array.Empty<ICultMeshTransportConnector>(),
|
||||
[new CultMeshTcpContentTransportConnector()]);
|
||||
var provider = new CultMeshSessionContentProvider(
|
||||
"parity.provider", sessions, CultMeshEndpointId.Parse("service:parity.provider"));
|
||||
"parity.provider", sessions, new CultMeshSessionTarget("parity", "service:parity.provider"));
|
||||
var directory = Path.Combine(Path.GetTempPath(), "cultmesh-transport-parity", Guid.NewGuid().ToString("N"));
|
||||
using var transferState = new CultCache(CultMesh.CreateCultCacheDocumentRegistry(
|
||||
typeof(CultMeshContentTransferStateDocument)));
|
||||
|
|
@ -479,8 +492,14 @@ internal sealed class RouteSource(string endpoint) : ICultMeshLookupSource
|
|||
new(
|
||||
new CultMeshVerseDescriptor(
|
||||
"parity", "Transport parity", CultMeshVerseAuthorityModel.OperatorCluster,
|
||||
new CultMeshVerseCompatibility("cultmesh.v1", "parity"), [endpoint],
|
||||
["service:parity.provider"]),
|
||||
new CultMeshVerseCompatibility("cultmesh.v1", "parity"),
|
||||
authorityRoutes:
|
||||
[
|
||||
new CultMeshAuthorityRoute(
|
||||
"service:parity.provider",
|
||||
endpoint,
|
||||
generation: "parity-route-1")
|
||||
]),
|
||||
SourceId, now, now.AddMinutes(1), CultMeshDiscoveryTrust.Signed)
|
||||
];
|
||||
return Task.FromResult(observations);
|
||||
|
|
|
|||
Loading…
Reference in a new issue