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

Add SecurityTokenClaimsIdentity #2858

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft

Conversation

pmaytak
Copy link
Contributor

@pmaytak pmaytak commented Oct 1, 2024

#2531

Performance results: #2858 (comment)

@pmaytak pmaytak changed the title Add JsonWebTokenClaimsIdentity Add NewClaimsIdentity Oct 10, 2024
@pmaytak
Copy link
Contributor Author

pmaytak commented Oct 14, 2024

BenchmarkDotNet v0.13.12, Windows 11 (10.0.26100.2033) (Hyper-V)
Intel Xeon Platinum 8370C CPU 2.80GHz, 1 CPU, 16 logical and 8 physical cores
.NET SDK 8.0.403
[Host] : .NET 8.0.10 (8.0.1024.46610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
MediumRun : .NET 8.0.10 (8.0.1024.46610), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI

Job=MediumRun MaxAbsoluteError=10.0000 ms IterationCount=15
LaunchCount=4 WarmupCount=10

Method Mean Error StdDev P90 P95 P100 Ratio Gen0 Allocated Alloc Ratio
ClaimsIdentity_FindAll 265.57 ns 0.732 ns 1.591 ns 267.64 ns 268.29 ns 269.61 ns 1.00 0.0110 280 B 1.00
NewClaimsIdentity_FindAll 261.72 ns 0.813 ns 1.766 ns 264.42 ns 264.73 ns 265.06 ns 0.99 0.0119 304 B 1.09
ClaimsIdentity_FindFirst 153.93 ns 0.744 ns 1.664 ns 155.76 ns 155.96 ns 156.54 ns 1.00 0.0050 128 B 1.00
NewClaimsIdentity_FindFirst 50.06 ns 0.670 ns 1.498 ns 51.71 ns 51.88 ns 51.99 ns 0.33 0.0032 80 B 0.62
ClaimsIdentity_HasClaim 168.23 ns 0.437 ns 0.951 ns 169.63 ns 169.88 ns 170.89 ns 1.00 0.0052 136 B 1.00
NewClaimsIdentity_HasClaim 58.17 ns 0.585 ns 1.260 ns 59.48 ns 59.64 ns 59.86 ns 0.35 0.0031 80 B 0.59

@pmaytak pmaytak changed the title Add NewClaimsIdentity Add SecurityTokenClaimsIdentity Oct 14, 2024
/// <param name="type"></param>
/// <param name="value"></param>
/// <returns></returns>
public virtual bool HasPayloadClaim(string type, string value) => false;
Copy link
Member

Choose a reason for hiding this comment

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

This naming makes sense for JWT, but not for SAML

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The naming is sort of temporary for now. We have similarly named methods that perform old logic; so tried to make these stand out for the ease of refactoring for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants