From 71dc5e7a1cc3fe7c1b186243322ac1db9fc59df0 Mon Sep 17 00:00:00 2001 From: Michael Render Date: Wed, 27 Nov 2024 16:42:29 -0500 Subject: [PATCH 1/3] [dotnet] Add future-proofing note on `Base64UrlEncoder` --- dotnet/src/webdriver/Internal/Base64UrlEncoder.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs b/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs index 23c2fc5fae5f9..aa2dff86563b9 100644 --- a/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs +++ b/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs @@ -19,8 +19,13 @@ using System; +#nullable enable + namespace OpenQA.Selenium.Internal { + // When we target .NET 9+, we can use the built-in Base64Url type + // https://github.com/SeleniumHQ/selenium/issues/14813 + /// /// Encodes and Decodes strings as Base64Url encoding. /// From 0b2e8dbb00703c40bad43c56aca6e8072841fbbc Mon Sep 17 00:00:00 2001 From: Michael Render Date: Wed, 27 Nov 2024 16:58:59 -0500 Subject: [PATCH 2/3] Improve message --- dotnet/src/webdriver/Internal/Base64UrlEncoder.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs b/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs index aa2dff86563b9..57c2849c6f56a 100644 --- a/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs +++ b/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs @@ -23,8 +23,12 @@ namespace OpenQA.Selenium.Internal { - // When we target .NET 9+, we can use the built-in Base64Url type - // https://github.com/SeleniumHQ/selenium/issues/14813 + /* + * Based on: https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/6.19.0/src/Microsoft.IdentityModel.Tokens/Base64UrlEncoder.cs + * + * Now it is a part of .NET 9+ as System.Buffers.Text.Base64Url + * https://github.com/SeleniumHQ/selenium/issues/14813 + */ /// /// Encodes and Decodes strings as Base64Url encoding. From 4991da7d3cdd346f20b27e60ff73b85a07e9c852 Mon Sep 17 00:00:00 2001 From: Michael Render Date: Wed, 27 Nov 2024 17:16:25 -0500 Subject: [PATCH 3/3] Remove other links to the code source --- dotnet/src/webdriver/Internal/Base64UrlEncoder.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs b/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs index 57c2849c6f56a..87fb7085e86c5 100644 --- a/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs +++ b/dotnet/src/webdriver/Internal/Base64UrlEncoder.cs @@ -54,8 +54,6 @@ public static class Base64UrlEncoder base64UrlCharacter63 }; - // https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/6.19.0/src/Microsoft.IdentityModel.Tokens/Base64UrlEncoder.cs#L85 - /// /// Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation which is encoded with base-64-url digits. /// @@ -124,8 +122,6 @@ public static string Encode(byte[] inArray) return new string(output, 0, j); } - // https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/6.19.0/src/Microsoft.IdentityModel.Tokens/Base64UrlEncoder.cs#L179 - /// /// Converts the specified string, which encodes binary data as base-64-url digits, to an equivalent 8-bit unsigned integer array. /// base64Url encoded string.