From 5cfa5f85181a2261d94047f357f728df7a9127b9 Mon Sep 17 00:00:00 2001 From: Jericho Date: Tue, 24 Nov 2020 12:07:53 -0500 Subject: [PATCH 1/6] Allow isDefault and customSpf to be selectively updated with invoking UpdateDomainAsync Resolves #353 --- .../StrongGrid/Resources/ISenderAuthentication.cs | 6 ++++-- .../StrongGrid/Resources/SenderAuthentication.cs | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Source/StrongGrid/Resources/ISenderAuthentication.cs b/Source/StrongGrid/Resources/ISenderAuthentication.cs index 5a030642..7f711266 100644 --- a/Source/StrongGrid/Resources/ISenderAuthentication.cs +++ b/Source/StrongGrid/Resources/ISenderAuthentication.cs @@ -1,4 +1,6 @@ -using StrongGrid.Models; +using StrongGrid.Models; +using StrongGrid.Utilities; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -64,7 +66,7 @@ public interface ISenderAuthentication /// /// The . /// - Task UpdateDomainAsync(long domainId, bool isDefault = false, bool customSpf = false, string onBehalfOf = null, CancellationToken cancellationToken = default); + Task UpdateDomainAsync(long domainId, Parameter isDefault = default, Parameter customSpf = default, string onBehalfOf = null, CancellationToken cancellationToken = default); /// /// Delete an authenticated whitelabel. diff --git a/Source/StrongGrid/Resources/SenderAuthentication.cs b/Source/StrongGrid/Resources/SenderAuthentication.cs index f1e78975..724f58f6 100644 --- a/Source/StrongGrid/Resources/SenderAuthentication.cs +++ b/Source/StrongGrid/Resources/SenderAuthentication.cs @@ -1,7 +1,8 @@ -using Newtonsoft.Json.Linq; +using Newtonsoft.Json.Linq; using Pathoschild.Http.Client; using StrongGrid.Models; using StrongGrid.Utilities; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -115,13 +116,12 @@ public Task CreateDomainAsync(string domain, string subdoma /// /// The . /// - public Task UpdateDomainAsync(long domainId, bool isDefault = false, bool customSpf = false, string onBehalfOf = null, CancellationToken cancellationToken = default) + public Task UpdateDomainAsync(long domainId, Parameter isDefault = default, Parameter customSpf = default, string onBehalfOf = null, CancellationToken cancellationToken = default) { - var data = new JObject - { - { "custom_spf", customSpf }, - { "default", isDefault } - }; + var data = new JObject(); + data.AddPropertyIfValue("custom_spf", customSpf); + data.AddPropertyIfValue("default", isDefault); + return _client .PatchAsync($"{_endpoint}/domains/{domainId}") .OnBehalfOf(onBehalfOf) From ec49550d680c24e4fc06bdca543548b5e3c5fd4c Mon Sep 17 00:00:00 2001 From: Jericho Date: Wed, 25 Nov 2020 10:44:47 -0500 Subject: [PATCH 2/6] Add username, ips and customDkimSelector parameters to the CreateDomainAsync method. Also, the subdomain parameter must be optional. Resolves #351 --- .../Tests/SenderAuthentication.cs | 2 +- .../Resources/SenderAuthenticationTests.cs | 6 +++- .../Resources/ISenderAuthentication.cs | 15 ++++++---- .../Resources/SenderAuthentication.cs | 29 ++++++++++++------- 4 files changed, 33 insertions(+), 19 deletions(-) diff --git a/Source/StrongGrid.IntegrationTests/Tests/SenderAuthentication.cs b/Source/StrongGrid.IntegrationTests/Tests/SenderAuthentication.cs index d23dbef2..81e024a9 100644 --- a/Source/StrongGrid.IntegrationTests/Tests/SenderAuthentication.cs +++ b/Source/StrongGrid.IntegrationTests/Tests/SenderAuthentication.cs @@ -27,7 +27,7 @@ public async Task RunAsync(IBaseClient client, TextWriter log, CancellationToken }); await Task.WhenAll(cleanUpTasks).ConfigureAwait(false); - var domain = await client.SenderAuthentication.CreateDomainAsync(fictitiousDomain, "email", false, false, false, null, cancellationToken).ConfigureAwait(false); + var domain = await client.SenderAuthentication.CreateDomainAsync(fictitiousDomain, "email", null, null, false, false, false, null, null, cancellationToken).ConfigureAwait(false); await log.WriteLineAsync($"AuthenticatedSender domain created. Id: {domain.Id}").ConfigureAwait(false); var domainValidation = await client.SenderAuthentication.ValidateDomainAsync(domain.Id, null, cancellationToken).ConfigureAwait(false); diff --git a/Source/StrongGrid.UnitTests/Resources/SenderAuthenticationTests.cs b/Source/StrongGrid.UnitTests/Resources/SenderAuthenticationTests.cs index ab691cb5..63ac2de5 100644 --- a/Source/StrongGrid.UnitTests/Resources/SenderAuthenticationTests.cs +++ b/Source/StrongGrid.UnitTests/Resources/SenderAuthenticationTests.cs @@ -3,6 +3,7 @@ using Shouldly; using StrongGrid.Models; using StrongGrid.Resources; +using System; using System.Net; using System.Net.Http; using System.Threading; @@ -404,9 +405,12 @@ public async Task CreateDomainAsync() // Arrange var domain = ""; var subdomain = ""; + var username = ""; + var ips = Array.Empty(); var automaticSecurity = true; var customSpf = false; var isDefault = true; + var customDkimSelector = ""; var mockHttp = new MockHttpMessageHandler(); mockHttp.Expect(HttpMethod.Post, Utils.GetSendGridApiUri(ENDPOINT, "domains")).Respond("application/json", SINGLE_DOMAIN_JSON); @@ -415,7 +419,7 @@ public async Task CreateDomainAsync() var senderAuthentication = new SenderAuthentication(client); // Act - var result = await senderAuthentication.CreateDomainAsync(domain, subdomain, automaticSecurity, customSpf, isDefault, null, CancellationToken.None).ConfigureAwait(false); + var result = await senderAuthentication.CreateDomainAsync(domain, subdomain, username, ips, automaticSecurity, customSpf, isDefault, customDkimSelector, null, CancellationToken.None).ConfigureAwait(false); // Assert mockHttp.VerifyNoOutstandingExpectation(); diff --git a/Source/StrongGrid/Resources/ISenderAuthentication.cs b/Source/StrongGrid/Resources/ISenderAuthentication.cs index 7f711266..17d3da25 100644 --- a/Source/StrongGrid/Resources/ISenderAuthentication.cs +++ b/Source/StrongGrid/Resources/ISenderAuthentication.cs @@ -43,17 +43,20 @@ public interface ISenderAuthentication /// /// Create a new authenticated domain. /// - /// The domain. - /// The subdomain. - /// if set to true [automatic security]. - /// if set to true [custom SPF]. - /// if set to true [is default]. + /// The domain being authenticated.. + /// The subdomain to use for this authenticated domain. + /// The username associated with this domain. + /// The IP addresses that will be included in the custom SPF record for this authenticated domain. + /// Whether to allow SendGrid to manage your SPF records, DKIM keys, and DKIM key rotation. + /// Specify whether to use a custom SPF or allow SendGrid to manage your SPF. This option is only available to authenticated domains set up for manual security. + /// Whether to use this authenticated domain as the fallback if no authenticated domains match the sender's domain. + /// Add a custom DKIM selector. Accepts three letters or numbers. /// The user to impersonate. /// Cancellation token. /// /// The . /// - Task CreateDomainAsync(string domain, string subdomain, bool automaticSecurity = false, bool customSpf = false, bool isDefault = false, string onBehalfOf = null, CancellationToken cancellationToken = default); + Task CreateDomainAsync(string domain, string subdomain = null, string username = null, IEnumerable ips = null, bool automaticSecurity = false, bool customSpf = false, bool isDefault = false, string customDkimSelector = null, string onBehalfOf = null, CancellationToken cancellationToken = default); /// /// Update an authenticated domain. diff --git a/Source/StrongGrid/Resources/SenderAuthentication.cs b/Source/StrongGrid/Resources/SenderAuthentication.cs index 724f58f6..30b0a7ec 100644 --- a/Source/StrongGrid/Resources/SenderAuthentication.cs +++ b/Source/StrongGrid/Resources/SenderAuthentication.cs @@ -77,26 +77,33 @@ public Task GetDomainAsync(long domainId, string onBehalfOf /// /// Create a new authenticated domain. /// - /// The domain. - /// The subdomain. - /// if set to true [automatic security]. - /// if set to true [custom SPF]. - /// if set to true [is default]. + /// The domain being authenticated.. + /// The subdomain to use for this authenticated domain. + /// The username associated with this domain. + /// The IP addresses that will be included in the custom SPF record for this authenticated domain. + /// Whether to allow SendGrid to manage your SPF records, DKIM keys, and DKIM key rotation. + /// Specify whether to use a custom SPF or allow SendGrid to manage your SPF. This option is only available to authenticated domains set up for manual security. + /// Whether to use this authenticated domain as the fallback if no authenticated domains match the sender's domain. + /// Add a custom DKIM selector. Accepts three letters or numbers. /// The user to impersonate. /// Cancellation token. /// /// The . /// - public Task CreateDomainAsync(string domain, string subdomain, bool automaticSecurity = false, bool customSpf = false, bool isDefault = false, string onBehalfOf = null, CancellationToken cancellationToken = default) + public Task CreateDomainAsync(string domain, string subdomain = null, string username = null, IEnumerable ips = null, bool automaticSecurity = false, bool customSpf = false, bool isDefault = false, string customDkimSelector = null, string onBehalfOf = null, CancellationToken cancellationToken = default) { var data = new JObject { - { "domain", domain }, - { "subdomain", subdomain }, - { "automatic_security", automaticSecurity }, - { "custom_spf", customSpf }, - { "default", isDefault } + {"domain", domain} }; + data.AddPropertyIfValue("subdomain", subdomain); + data.AddPropertyIfValue("username", username); + data.AddPropertyIfValue("ips", ips); + data.AddPropertyIfValue("custom_spf", customSpf); + data.AddPropertyIfValue("default", isDefault); + data.AddPropertyIfValue("automatic_security", automaticSecurity); + data.AddPropertyIfValue("custom_dkim_selector", customDkimSelector); + return _client .PostAsync($"{_endpoint}/domains") .OnBehalfOf(onBehalfOf) From 481941a53aaa421a961d9340452802b02972a7e1 Mon Sep 17 00:00:00 2001 From: Jericho Date: Wed, 25 Nov 2020 12:08:44 -0500 Subject: [PATCH 3/6] Remove constructors that accept username + password Resolves #352 --- .../TestsRunner.cs | 2 +- Source/StrongGrid.UnitTests/ClientTests.cs | 7 +-- Source/StrongGrid/BaseClient.cs | 18 +----- Source/StrongGrid/Client.cs | 63 ++----------------- Source/StrongGrid/LegacyClient.cs | 63 ++----------------- 5 files changed, 13 insertions(+), 140 deletions(-) diff --git a/Source/StrongGrid.IntegrationTests/TestsRunner.cs b/Source/StrongGrid.IntegrationTests/TestsRunner.cs index 1a0add4d..02357be5 100644 --- a/Source/StrongGrid.IntegrationTests/TestsRunner.cs +++ b/Source/StrongGrid.IntegrationTests/TestsRunner.cs @@ -35,7 +35,7 @@ public async Task RunAsync() // ----------------------------------------------------------------------------- // Do you want to proxy requests through Fiddler? Can be useful for debugging. var useFiddler = true; - var fiddlerPort = 8866; // By default Fiddler4 uses port 8888 and Fiddler Everywhere uses port 8866 + var fiddlerPort = 8888; // By default Fiddler4 uses port 8888 and Fiddler Everywhere uses port 8866 // Change the default values in the legacy client. var optionsToCorrectLegacyDefaultValues = new StrongGridClientOptions() diff --git a/Source/StrongGrid.UnitTests/ClientTests.cs b/Source/StrongGrid.UnitTests/ClientTests.cs index 47505a8b..350b38c1 100644 --- a/Source/StrongGrid.UnitTests/ClientTests.cs +++ b/Source/StrongGrid.UnitTests/ClientTests.cs @@ -35,17 +35,12 @@ public void Dispose() } [Fact] - public void Throws_if_apikey_and_username_are_null() + public void Throws_if_apikey_is_null() { string apiKey = null; - string username = null; - string password = "myPassword"; Should.Throw(() => new Client(apiKey)); - Should.Throw(() => new Client(username, password)); - Should.Throw(() => new LegacyClient(apiKey)); - Should.Throw(() => new LegacyClient(username, password)); } } } diff --git a/Source/StrongGrid/BaseClient.cs b/Source/StrongGrid/BaseClient.cs index 80db2c70..c2623d59 100644 --- a/Source/StrongGrid/BaseClient.cs +++ b/Source/StrongGrid/BaseClient.cs @@ -275,7 +275,7 @@ internal Pathoschild.Http.Client.IClient FluentClient /// Indicates if the http client should be dispose when this instance of BaseClient is disposed. /// Options for the SendGrid client. /// Logger. - public BaseClient(Parameter apiKey, Parameter username, Parameter password, HttpClient httpClient, bool disposeClient, StrongGridClientOptions options, ILogger logger = null) + public BaseClient(string apiKey, HttpClient httpClient, bool disposeClient, StrongGridClientOptions options, ILogger logger = null) { _mustDisposeHttpClient = disposeClient; _httpClient = httpClient; @@ -293,20 +293,8 @@ public BaseClient(Parameter apiKey, Parameter username, Paramete _fluentClient.Filters.Add(new DiagnosticHandler(_options.LogLevelSuccessfulCalls, _options.LogLevelFailedCalls, _logger)); _fluentClient.Filters.Add(new SendGridErrorHandler()); - if (apiKey.HasValue) - { - if (string.IsNullOrEmpty(apiKey)) throw new ArgumentNullException(apiKey); - else _fluentClient.SetBearerAuthentication(apiKey); - } - else if (username.HasValue) - { - if (string.IsNullOrEmpty(username)) throw new ArgumentNullException(username); - else _fluentClient.SetBasicAuthentication(username, password); - } - else - { - throw new ArgumentException("You must provide either an API key or a username and a password."); - } + if (string.IsNullOrEmpty(apiKey)) throw new ArgumentNullException(apiKey); + _fluentClient.SetBearerAuthentication(apiKey); AccessManagement = new AccessManagement(FluentClient); Alerts = new Alerts(FluentClient); diff --git a/Source/StrongGrid/Client.cs b/Source/StrongGrid/Client.cs index 3ee069c7..b8465377 100644 --- a/Source/StrongGrid/Client.cs +++ b/Source/StrongGrid/Client.cs @@ -72,7 +72,7 @@ public class Client : BaseClient, IClient /// Options for the SendGrid client. /// Logger. public Client(string apiKey, StrongGridClientOptions options = null, ILogger logger = null) - : base(apiKey, default, default, null, false, options, logger) + : base(apiKey, null, false, options, logger) { Init(); } @@ -85,7 +85,7 @@ public Client(string apiKey, StrongGridClientOptions options = null, ILogger log /// Options for the SendGrid client. /// Logger. public Client(string apiKey, IWebProxy proxy, StrongGridClientOptions options = null, ILogger logger = null) - : base(apiKey, default, default, new HttpClient(new HttpClientHandler { Proxy = proxy, UseProxy = proxy != null }), true, options, logger) + : base(apiKey, new HttpClient(new HttpClientHandler { Proxy = proxy, UseProxy = proxy != null }), true, options, logger) { Init(); } @@ -98,7 +98,7 @@ public Client(string apiKey, IWebProxy proxy, StrongGridClientOptions options = /// Options for the SendGrid client. /// Logger. public Client(string apiKey, HttpMessageHandler handler, StrongGridClientOptions options = null, ILogger logger = null) - : base(apiKey, default, default, new HttpClient(handler), true, options, logger) + : base(apiKey, new HttpClient(handler), true, options, logger) { Init(); } @@ -111,62 +111,7 @@ public Client(string apiKey, HttpMessageHandler handler, StrongGridClientOptions /// Options for the SendGrid client. /// Logger. public Client(string apiKey, HttpClient httpClient, StrongGridClientOptions options = null, ILogger logger = null) - : base(apiKey, default, default, httpClient, false, options, logger) - { - Init(); - } - - /// - /// Initializes a new instance of the class. - /// - /// Your username. - /// Your password. - /// Options for the SendGrid client. - /// Logger. - public Client(string username, string password, StrongGridClientOptions options = null, ILogger logger = null) - : base(default, username, password, null, false, options, logger) - { - Init(); - } - - /// - /// Initializes a new instance of the class. - /// - /// Your username. - /// Your password. - /// Allows you to specify a proxy. - /// Options for the SendGrid client. - /// Logger. - public Client(string username, string password, IWebProxy proxy, StrongGridClientOptions options = null, ILogger logger = null) - : base(default, username, password, new HttpClient(new HttpClientHandler { Proxy = proxy, UseProxy = proxy != null }), true, options, logger) - { - Init(); - } - - /// - /// Initializes a new instance of the class. - /// - /// Your username. - /// Your password. - /// TThe HTTP handler stack to use for sending requests. - /// Options for the SendGrid client. - /// Logger. - public Client(string username, string password, HttpMessageHandler handler, StrongGridClientOptions options = null, ILogger logger = null) - : base(default, username, password, new HttpClient(handler), true, options, logger) - { - Init(); - } - - /// - /// Initializes a new instance of the class. - /// - /// Your username. - /// Your password. - /// Allows you to inject your own HttpClient. This is useful, for example, to setup the HtppClient with a proxy. - /// Options for the SendGrid client. - /// Logger. - public Client(string username, string password, HttpClient httpClient, StrongGridClientOptions options = null, ILogger logger = null) - : base(default, username, password, httpClient, false, options, logger) + : base(apiKey, httpClient, false, options, logger) { Init(); } diff --git a/Source/StrongGrid/LegacyClient.cs b/Source/StrongGrid/LegacyClient.cs index 626e3d58..855e8091 100644 --- a/Source/StrongGrid/LegacyClient.cs +++ b/Source/StrongGrid/LegacyClient.cs @@ -79,7 +79,7 @@ public class LegacyClient : BaseClient, ILegacyClient /// Options for the SendGrid client. /// Logger. public LegacyClient(string apiKey, StrongGridClientOptions options = null, ILogger logger = null) - : base(apiKey, default, default, null, false, options, logger) + : base(apiKey, null, false, options, logger) { Init(); } @@ -92,7 +92,7 @@ public LegacyClient(string apiKey, StrongGridClientOptions options = null, ILogg /// Options for the SendGrid client. /// Logger. public LegacyClient(string apiKey, IWebProxy proxy, StrongGridClientOptions options = null, ILogger logger = null) - : base(apiKey, default, default, new HttpClient(new HttpClientHandler { Proxy = proxy, UseProxy = proxy != null }), true, options, logger) + : base(apiKey, new HttpClient(new HttpClientHandler { Proxy = proxy, UseProxy = proxy != null }), true, options, logger) { Init(); } @@ -105,7 +105,7 @@ public LegacyClient(string apiKey, IWebProxy proxy, StrongGridClientOptions opti /// Options for the SendGrid client. /// Logger. public LegacyClient(string apiKey, HttpMessageHandler handler, StrongGridClientOptions options = null, ILogger logger = null) - : base(apiKey, default, default, new HttpClient(handler), true, options, logger) + : base(apiKey, new HttpClient(handler), true, options, logger) { Init(); } @@ -118,62 +118,7 @@ public LegacyClient(string apiKey, HttpMessageHandler handler, StrongGridClientO /// Options for the SendGrid client. /// Logger. public LegacyClient(string apiKey, HttpClient httpClient, StrongGridClientOptions options = null, ILogger logger = null) - : base(apiKey, default, default, httpClient, false, options, logger) - { - Init(); - } - - /// - /// Initializes a new instance of the class. - /// - /// Your username. - /// Your password. - /// Options for the SendGrid client. - /// Logger. - public LegacyClient(string username, string password, StrongGridClientOptions options = null, ILogger logger = null) - : base(default, username, password, null, false, options, logger) - { - Init(); - } - - /// - /// Initializes a new instance of the class. - /// - /// Your username. - /// Your password. - /// Allows you to specify a proxy. - /// Options for the SendGrid client. - /// Logger. - public LegacyClient(string username, string password, IWebProxy proxy, StrongGridClientOptions options = null, ILogger logger = null) - : base(default, username, password, new HttpClient(new HttpClientHandler { Proxy = proxy, UseProxy = proxy != null }), true, options, logger) - { - Init(); - } - - /// - /// Initializes a new instance of the class. - /// - /// Your username. - /// Your password. - /// TThe HTTP handler stack to use for sending requests. - /// Options for the SendGrid client. - /// Logger. - public LegacyClient(string username, string password, HttpMessageHandler handler, StrongGridClientOptions options = null, ILogger logger = null) - : base(default, username, password, new HttpClient(handler), true, options, logger) - { - Init(); - } - - /// - /// Initializes a new instance of the class. - /// - /// Your username. - /// Your password. - /// Allows you to inject your own HttpClient. This is useful, for example, to setup the HtppClient with a proxy. - /// Options for the SendGrid client. - /// Logger. - public LegacyClient(string username, string password, HttpClient httpClient, StrongGridClientOptions options = null, ILogger logger = null) - : base(default, username, password, httpClient, false, options, logger) + : base(apiKey, httpClient, false, options, logger) { Init(); } From 785919feb82191948762faa7d440829e8f57f98e Mon Sep 17 00:00:00 2001 From: Jericho Date: Wed, 25 Nov 2020 12:14:01 -0500 Subject: [PATCH 4/6] Fix CS1572 XML comment has a param tag for 'password', but there is no parameter by that name --- Source/StrongGrid/BaseClient.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/Source/StrongGrid/BaseClient.cs b/Source/StrongGrid/BaseClient.cs index c2623d59..5e435df9 100644 --- a/Source/StrongGrid/BaseClient.cs +++ b/Source/StrongGrid/BaseClient.cs @@ -269,8 +269,6 @@ internal Pathoschild.Http.Client.IClient FluentClient /// Initializes a new instance of the class. /// /// Your api key. - /// Your username. Ignored if the api key is specified. - /// Your password. Ignored if the api key is specified. /// Allows you to inject your own HttpClient. This is useful, for example, to setup the HtppClient with a proxy. /// Indicates if the http client should be dispose when this instance of BaseClient is disposed. /// Options for the SendGrid client. From f9924d01d8d93c2c2951b88b0ffb513a22538233 Mon Sep 17 00:00:00 2001 From: Jericho Date: Wed, 25 Nov 2020 12:15:23 -0500 Subject: [PATCH 5/6] Fix SA1012 Opening brace should be followed by a space. --- Source/StrongGrid/Resources/SenderAuthentication.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/StrongGrid/Resources/SenderAuthentication.cs b/Source/StrongGrid/Resources/SenderAuthentication.cs index 30b0a7ec..7aa50bcb 100644 --- a/Source/StrongGrid/Resources/SenderAuthentication.cs +++ b/Source/StrongGrid/Resources/SenderAuthentication.cs @@ -94,7 +94,7 @@ public Task CreateDomainAsync(string domain, string subdoma { var data = new JObject { - {"domain", domain} + { "domain", domain } }; data.AddPropertyIfValue("subdomain", subdomain); data.AddPropertyIfValue("username", username); From 8c92f57fc0b612d29598123c8b43154a4dc458d6 Mon Sep 17 00:00:00 2001 From: Jericho Date: Thu, 26 Nov 2020 10:38:38 -0500 Subject: [PATCH 6/6] The outage in Telerik's cloud (they use AWS apparently) has been resolved so I can switch back to the port used by Fiddler Everywhere --- Source/StrongGrid.IntegrationTests/TestsRunner.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/StrongGrid.IntegrationTests/TestsRunner.cs b/Source/StrongGrid.IntegrationTests/TestsRunner.cs index 02357be5..1a0add4d 100644 --- a/Source/StrongGrid.IntegrationTests/TestsRunner.cs +++ b/Source/StrongGrid.IntegrationTests/TestsRunner.cs @@ -35,7 +35,7 @@ public async Task RunAsync() // ----------------------------------------------------------------------------- // Do you want to proxy requests through Fiddler? Can be useful for debugging. var useFiddler = true; - var fiddlerPort = 8888; // By default Fiddler4 uses port 8888 and Fiddler Everywhere uses port 8866 + var fiddlerPort = 8866; // By default Fiddler4 uses port 8888 and Fiddler Everywhere uses port 8866 // Change the default values in the legacy client. var optionsToCorrectLegacyDefaultValues = new StrongGridClientOptions()