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

Use new Base64Url API #2817

Merged
merged 7 commits into from
Jan 6, 2025
Merged

Use new Base64Url API #2817

merged 7 commits into from
Jan 6, 2025

Conversation

msbw2
Copy link
Contributor

@msbw2 msbw2 commented Sep 6, 2024

Use the new Base64Url API.

@msbw2 msbw2 requested a review from a team as a code owner September 6, 2024 19:24
@msbw2 msbw2 linked an issue Sep 6, 2024 that may be closed by this pull request
@keegan-caruso
Copy link
Contributor

@msbw2 Can you post a before / after of this benchmark as well here: JsonWebTokenHandler_ValidateTokenAsyncWithTVP ?

Would be good to see the difference at that level.

@pmaytak
Copy link
Contributor

pmaytak commented Sep 20, 2024

@msbw2 Can you post a before / after of this benchmark as well here: JsonWebTokenHandler_ValidateTokenAsyncWithTVP ?

Would be good to see the difference at that level.

Benchmarks are here: #2828 (comment)

@msbw2 msbw2 force-pushed the brettwhite/base64url branch from 9b9b583 to 615df8a Compare September 20, 2024 22:41
NuGet.Config Outdated Show resolved Hide resolved
@msbw2 msbw2 force-pushed the brettwhite/base64url branch 2 times, most recently from 9e2ff23 to b1d4eed Compare September 20, 2024 22:49
@msbw2 msbw2 force-pushed the brettwhite/base64url branch 2 times, most recently from 168bfe8 to 08c0f25 Compare September 21, 2024 05:50
@msbw2 msbw2 changed the title Use .NET 9.0 Base64Url API Use new Base64Url API Sep 21, 2024
@msbw2 msbw2 force-pushed the brettwhite/base64url branch 6 times, most recently from 73666d5 to 55946bb Compare September 23, 2024 17:26
Copy link
Collaborator

@jennyf19 jennyf19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@msbw2 msbw2 force-pushed the brettwhite/base64url branch from 55946bb to 4ddc291 Compare September 23, 2024 21:53
@jennyf19 jennyf19 modified the milestones: 8.2.0, 8.2.1 Nov 2, 2024
@msbw2 msbw2 force-pushed the brettwhite/base64url branch 3 times, most recently from 6ad7e88 to 6a7db22 Compare November 13, 2024 02:44
@msbw2 msbw2 changed the title [merge after .NET 9 GA] Use new Base64Url API Use new Base64Url API Nov 13, 2024
@pmaytak
Copy link
Contributor

pmaytak commented Nov 13, 2024

Coverage is good

Base64UrlEncoder at 89% Base64UrlEncoding at 82%

https://identitydivision.visualstudio.com/IDDP/_build/results?buildId=1366079&view=codecoverage-tab

Should the test coverage be 100%? Curious what's not covered.

@msbw2 msbw2 force-pushed the brettwhite/base64url branch from 00f7d29 to ad14384 Compare December 4, 2024 21:17
@jennyf19 jennyf19 modified the milestones: 8.3.0, 8.3.1 Dec 4, 2024
@pmaytak pmaytak requested a review from Copilot December 19, 2024 05:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 10 changed files in this pull request and generated 1 comment.

Files not reviewed (5)
  • build/dependencies.props: Language not supported
  • src/Microsoft.IdentityModel.Tokens/InternalAPI.Unshipped.txt: Language not supported
  • src/Microsoft.IdentityModel.Tokens/Microsoft.IdentityModel.Tokens.csproj: Language not supported
  • src/Microsoft.IdentityModel.Tokens/LogMessages.cs: Evaluated as low risk
  • src/Microsoft.IdentityModel.Tokens/Base64UrlEncoding.cs: Evaluated as low risk
Comments suppressed due to low confidence (3)

test/Microsoft.IdentityModel.Tokens.Tests/Base64UrlEncodingTests.cs:37

  • [nitpick] The variable name 'randomPadding' is misleading as it is a constant string. Consider renaming it to 'paddingString'.
const string randomPadding = "RANDOMPADDING";

benchmark/Microsoft.IdentityModel.Benchmarks/Base64UrlEncoderTests.cs:20

  • [nitpick] The variable name base64NoSpecialCharsEncodedString is quite long and could be confusing. Consider renaming it to something shorter and more descriptive.
private static readonly string base64NoSpecialCharsEncodedString = base64UrlEncodedString.Replace('-', 'A').Replace('_', 'B') + "ab";

benchmark/Microsoft.IdentityModel.Benchmarks/Base64UrlEncoderTests.cs:22

  • [nitpick] The variable name base64NoSpecialCharsExceptPaddingEncodedString is quite long and could be confusing. Consider renaming it to something shorter and more descriptive.
private static readonly string base64NoSpecialCharsExceptPaddingEncodedString = base64UrlEncodedString.Replace('-', 'A').Replace('_', 'B') + "==";

Copy link

github-actions bot commented Jan 6, 2025

Summary

Summary
Generated on: 1/6/2025 - 7:53:42 PM
Coverage date: 1/6/2025 - 7:44:34 PM - 1/6/2025 - 7:53:13 PM
Parser: MultiReport (60x Cobertura)
Assemblies: 1
Classes: 7
Files: 2
Line coverage: 80.3% (620 of 772)
Covered lines: 620
Uncovered lines: 152
Coverable lines: 772
Total lines: 483
Branch coverage: 67.8% (228 of 336)
Covered branches: 228
Total branches: 336
Method coverage: Feature is only available for sponsors

Coverage

Microsoft.IdentityModel.JsonWebTokens - 80.3%
Name Line Branch
Microsoft.IdentityModel.JsonWebTokens 80.3% 67.8%
Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities 100%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated 80.3% 67.8%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F12A1AEDDDFE32BA
DF4DBFF323AF1BCB48B9F9721B7CD3E05F5E034CF225E3DF8__CreateJwsRegex_0
81.4% 67.6%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJweRegex_1
79.2% 68%
System.Text.RegularExpressions.Generated.<RegexGenerator_g>F334844C618E00D3
CEC5D3FE0D00CF0141BBEE98635313BB2CB8D3921464CE05A__CreateJwsRegex_0
81.4% 67.6%

@pmaytak pmaytak merged commit c0eb23c into dev Jan 6, 2025
5 checks passed
@pmaytak pmaytak deleted the brettwhite/base64url branch January 6, 2025 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

M.IM8 leverages the .NET 9 Base64Url implementation
5 participants