feat: acquire legacy settings from approved network source

This commit is contained in:
codex
2026-08-06 13:56:54 +03:00
parent 0213b229a9
commit 97fbc1d746
6 changed files with 153 additions and 13 deletions
@@ -21,7 +21,8 @@ namespace Launcher.Next.App;
/// </summary>
internal sealed record LocalParityLaunchProfile(
int SchemaVersion, string Name, string Root, string SettingsPath, string DownloadListPath,
string OverlayPath, string CatalogRoot, string PatternName, string EvidenceRoot);
string OverlayPath, string CatalogRoot, string PatternName, string EvidenceRoot, string? NetworkSettingsEndpoint = null,
LegacySettingsSnapshot? SettingsSnapshot = null);
internal sealed record LocalParityPrepared(LocalParityLaunchProfile Profile, PackageRequirement Requirement,
PackageManifest Manifest, ImmutableLocalPackage Package, PackageActivationResult Activation,
@@ -41,7 +42,13 @@ internal sealed class LocalParityLaunchService
if (profile.SchemaVersion != 1 || string.IsNullOrWhiteSpace(profile.Name) || string.IsNullOrWhiteSpace(profile.PatternName))
throw new InvalidOperationException("LOCAL_PARITY_PROFILE_INVALID");
ValidateProfile(profile);
return profile with { Root = Path.GetFullPath(profile.Root) };
profile = profile with { Root = Path.GetFullPath(profile.Root) };
if (!string.IsNullOrWhiteSpace(profile.NetworkSettingsEndpoint))
{
var snapshot = LegacyNetworkConfiguration.AcquireApprovedSnapshot(profile.NetworkSettingsEndpoint, profile.Root);
profile = profile with { SettingsPath = snapshot.LocalSnapshotPath, SettingsSnapshot = snapshot };
}
return profile;
}
public async Task<LocalParityPrepared> PrepareAsync(LocalParityLaunchProfile profile, CancellationToken ct)