feat: acquire legacy settings from approved network source
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user