Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dotnet] Add future-proofing note on Base64UrlEncoder #14821

Merged
merged 3 commits into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions dotnet/src/webdriver/Internal/Base64UrlEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@

using System;

#nullable enable

namespace OpenQA.Selenium.Internal
{
/*
* 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
*/

/// <summary>
/// Encodes and Decodes strings as Base64Url encoding.
/// </summary>
Expand All @@ -45,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

/// <summary>
/// Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation which is encoded with base-64-url digits.
/// </summary>
Expand Down Expand Up @@ -115,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

/// <summary>
/// Converts the specified string, which encodes binary data as base-64-url digits, to an equivalent 8-bit unsigned integer array.</summary>
/// <param name="str">base64Url encoded string.</param>
Expand Down