From 89a80bd73e26365c8a0cbf223d95188112804d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Go=C5=82=C4=99biowski?= Date: Fri, 27 Sep 2024 11:12:29 +0200 Subject: [PATCH 1/2] Accept non-trusted certificates option --- .../Settings/IUserSettingsService.cs | 3 ++ src/Cody.Core/Settings/UserSettingsService.cs | 10 ++++++ .../Options/GeneralOptionsControl.xaml | 14 +++++++- .../Options/GeneralOptionsControl.xaml.cs | 1 + .../ViewModels/GeneralOptionsViewModel.cs | 13 ++++++++ .../Client/AgentClientOptions.cs | 3 ++ .../Client/AgentProcessConnector.cs | 4 +++ src/Cody.VisualStudio/CodyPackage.cs | 33 +++++++++++++++++++ .../Options/GeneralOptionsPage.cs | 5 +++ 9 files changed, 85 insertions(+), 1 deletion(-) diff --git a/src/Cody.Core/Settings/IUserSettingsService.cs b/src/Cody.Core/Settings/IUserSettingsService.cs index b24d0cf..56ad2ef 100644 --- a/src/Cody.Core/Settings/IUserSettingsService.cs +++ b/src/Cody.Core/Settings/IUserSettingsService.cs @@ -9,6 +9,9 @@ public interface IUserSettingsService string AccessToken { get; set; } string ServerEndpoint { get; set; } string CodySettings { get; set; } + bool AcceptNonTrustedCert { get; set; } + + event EventHandler AuthorizationDetailsChanged; } } diff --git a/src/Cody.Core/Settings/UserSettingsService.cs b/src/Cody.Core/Settings/UserSettingsService.cs index 49c109a..a87c5cc 100644 --- a/src/Cody.Core/Settings/UserSettingsService.cs +++ b/src/Cody.Core/Settings/UserSettingsService.cs @@ -101,5 +101,15 @@ public string CodySettings get => GetOrDefault(nameof(CodySettings), string.Empty); set => Set(nameof(CodySettings), value); } + + public bool AcceptNonTrustedCert + { + get + { + var value = GetOrDefault(nameof(AcceptNonTrustedCert), false.ToString()); + return bool.Parse(value); + } + set => Set(nameof(AcceptNonTrustedCert), value.ToString()); + } } } diff --git a/src/Cody.UI/Controls/Options/GeneralOptionsControl.xaml b/src/Cody.UI/Controls/Options/GeneralOptionsControl.xaml index c4b50a3..ff160a4 100644 --- a/src/Cody.UI/Controls/Options/GeneralOptionsControl.xaml +++ b/src/Cody.UI/Controls/Options/GeneralOptionsControl.xaml @@ -16,6 +16,7 @@ + @@ -42,10 +43,19 @@ Name="ConfigurationsTextBox" /> + +