From 0107a0f29a7b34b371e4413019ae213628003003 Mon Sep 17 00:00:00 2001 From: Stiefel Jackal <20023996+stiefeljackal@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:09:49 -0500 Subject: [PATCH] fix: update System.Text.Json and others for vulnerabilities (#7) --- AccountDownloader/AccountDownloader.csproj | 43 ++++++++++--------- .../Authentication/LoginViewModel.cs | 2 + .../MultiFactorAuthViewModel.cs | 2 + .../Views/DownloadSelectionView.axaml.cs | 2 +- .../Views/Windows/MainWindowView.axaml.cs | 12 +++--- .../AccountDownloaderLibrary.Mime.csproj | 4 +- .../AccountDownloaderLibrary.NeosFetch.csproj | 4 +- .../NeosFetcher.cs | 2 + .../AccountDownloaderLibrary.Test.csproj | 18 ++++---- .../AccountDownloaderLibrary.csproj | 12 +++--- 10 files changed, 54 insertions(+), 47 deletions(-) diff --git a/AccountDownloader/AccountDownloader.csproj b/AccountDownloader/AccountDownloader.csproj index 8d5cf13..c6421fb 100644 --- a/AccountDownloader/AccountDownloader.csproj +++ b/AccountDownloader/AccountDownloader.csproj @@ -50,35 +50,36 @@ - - + + - - + + - - + + - + - - - + + + + - + - - - + + + - - - + + + @@ -114,11 +115,11 @@ - - - + + + - + diff --git a/AccountDownloader/ViewModels/Authentication/LoginViewModel.cs b/AccountDownloader/ViewModels/Authentication/LoginViewModel.cs index f28c112..7abcbde 100644 --- a/AccountDownloader/ViewModels/Authentication/LoginViewModel.cs +++ b/AccountDownloader/ViewModels/Authentication/LoginViewModel.cs @@ -25,6 +25,8 @@ public class LoginViewModel : ViewModelBase, IValidatableViewModel public ReactiveCommand Login { get; set; } + IValidationContext IValidatableViewModel.ValidationContext => ValidationContext; + private readonly IAppCloudService CloudService; public LoginViewModel() { diff --git a/AccountDownloader/ViewModels/Authentication/MultiFactorAuthViewModel.cs b/AccountDownloader/ViewModels/Authentication/MultiFactorAuthViewModel.cs index fa3a67c..7ddf130 100644 --- a/AccountDownloader/ViewModels/Authentication/MultiFactorAuthViewModel.cs +++ b/AccountDownloader/ViewModels/Authentication/MultiFactorAuthViewModel.cs @@ -26,6 +26,8 @@ public class MultiFactorAuthViewModel : ViewModelBase, IValidatableViewModel public Interaction ShowError { get; } + IValidationContext IValidatableViewModel.ValidationContext => ValidationContext; + public MultiFactorAuthViewModel() { CloudService = Locator.Current.GetService() ?? throw new ArgumentNullException("Cannot login without an app service"); diff --git a/AccountDownloader/Views/DownloadSelectionView.axaml.cs b/AccountDownloader/Views/DownloadSelectionView.axaml.cs index 7c19b65..799aaab 100644 --- a/AccountDownloader/Views/DownloadSelectionView.axaml.cs +++ b/AccountDownloader/Views/DownloadSelectionView.axaml.cs @@ -31,7 +31,7 @@ private void InitializeComponent() AvaloniaXamlLoader.Load(this); } - private async Task ShowOpenFolderDialog(InteractionContext> interaction) + private async Task ShowOpenFolderDialog(IInteractionContext> interaction) { Window? w = null; diff --git a/AccountDownloader/Views/Windows/MainWindowView.axaml.cs b/AccountDownloader/Views/Windows/MainWindowView.axaml.cs index d6248b0..24870f7 100644 --- a/AccountDownloader/Views/Windows/MainWindowView.axaml.cs +++ b/AccountDownloader/Views/Windows/MainWindowView.axaml.cs @@ -54,7 +54,7 @@ public MainWindowView() this.Closing += MainWindow_Closing; } - private async Task OpenFolderLocation(InteractionContext obj) + private async Task OpenFolderLocation(IInteractionContext obj) { obj.SetOutput(Unit.Default); var res = IOService.OpenFolderDialog(obj.Input); @@ -101,16 +101,16 @@ private void SafelyCloseWindow() this.Close(); } - private async Task ShowInfoBox(InteractionContext message) + private async Task ShowInfoBox(IInteractionContext message) { await ShowBox(message, BoxType.Info); } - private async Task ShowErrorBox(InteractionContext message) + private async Task ShowErrorBox(IInteractionContext message) { await ShowBox(message, BoxType.Error); } - private async Task ShowBox(InteractionContext message, BoxType type) + private async Task ShowBox(IInteractionContext message, BoxType type) { // Always, set the output before we show the box. message.SetOutput(Unit.Default); @@ -135,7 +135,7 @@ private async Task ShowBox(InteractionContext message, await box.ShowWindowDialogAsync(this); } - private async Task ShowYesNoBox(InteractionContext> message) + private async Task ShowYesNoBox(IInteractionContext> message) { var messageBoxStandardWindow = MessageBoxManager.GetMessageBoxCustom(new MessageBoxCustomParams() { @@ -159,7 +159,7 @@ private async Task ShowYesNoBox(InteractionContext.WithResult(res)); } - public async Task ShowAboutWindow(InteractionContext obj) + public async Task ShowAboutWindow(IInteractionContext obj) { obj.SetOutput(Unit.Default); diff --git a/AccountDownloaderLibrary.Mime/AccountDownloaderLibrary.Mime.csproj b/AccountDownloaderLibrary.Mime/AccountDownloaderLibrary.Mime.csproj index 5d105f0..9dc3798 100644 --- a/AccountDownloaderLibrary.Mime/AccountDownloaderLibrary.Mime.csproj +++ b/AccountDownloaderLibrary.Mime/AccountDownloaderLibrary.Mime.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/AccountDownloaderLibrary.NeosFetch/AccountDownloaderLibrary.NeosFetch.csproj b/AccountDownloaderLibrary.NeosFetch/AccountDownloaderLibrary.NeosFetch.csproj index 1ddc863..172b25e 100644 --- a/AccountDownloaderLibrary.NeosFetch/AccountDownloaderLibrary.NeosFetch.csproj +++ b/AccountDownloaderLibrary.NeosFetch/AccountDownloaderLibrary.NeosFetch.csproj @@ -1,4 +1,4 @@ - + net7.0 @@ -7,7 +7,7 @@ - + diff --git a/AccountDownloaderLibrary.NeosFetch/NeosFetcher.cs b/AccountDownloaderLibrary.NeosFetch/NeosFetcher.cs index 1e47ba0..066c105 100644 --- a/AccountDownloaderLibrary.NeosFetch/NeosFetcher.cs +++ b/AccountDownloaderLibrary.NeosFetch/NeosFetcher.cs @@ -53,6 +53,8 @@ public static async Task EnsureNeosAssemblies() foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory)) { var key = entry.Key; + if (key == null) { continue; } + var matches = DATA_MANAGED_ASSEMBLY_REGEX.Matches(key); if (matches.Count <= 0) { continue; } diff --git a/AccountDownloaderLibrary.Test/AccountDownloaderLibrary.Test.csproj b/AccountDownloaderLibrary.Test/AccountDownloaderLibrary.Test.csproj index 9853a0f..23e73e6 100644 --- a/AccountDownloaderLibrary.Test/AccountDownloaderLibrary.Test.csproj +++ b/AccountDownloaderLibrary.Test/AccountDownloaderLibrary.Test.csproj @@ -24,18 +24,18 @@ - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - - - - + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/AccountDownloaderLibrary/AccountDownloaderLibrary.csproj b/AccountDownloaderLibrary/AccountDownloaderLibrary.csproj index a4fe06c..32767f0 100644 --- a/AccountDownloaderLibrary/AccountDownloaderLibrary.csproj +++ b/AccountDownloaderLibrary/AccountDownloaderLibrary.csproj @@ -28,10 +28,10 @@ - + - + @@ -44,10 +44,10 @@ ..\ExternalLibraries\CloudX.Shared.dll - - - - + + + +