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

[Feature Request] In JsonWebToken use the values as bytes instead of converting to string #2583

Open
pmaytak opened this issue May 4, 2024 · 0 comments · May be fixed by #2535
Open

[Feature Request] In JsonWebToken use the values as bytes instead of converting to string #2583

pmaytak opened this issue May 4, 2024 · 0 comments · May be fixed by #2535
Assignees
Labels
Enhancement The issue is a new feature Performance

Comments

@pmaytak
Copy link
Contributor

pmaytak commented May 4, 2024

Currently when the token is being parsed, the string values are saved into string properties and into a Dictionary<string, object>.

  • Leverage the underlying UTF8 bytes to return Span when property values are requested.
  • When reading the token bytes the start index and length of claim value can be saved into a dictionary, which is located in the Payload JsonClaimSet instance.
  • The properties then can use the saved indices to slice into the original token bytes, returning them.
  • Don't immediately save strings into a string property, do it on first access.

Related to #2581, #2495.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement The issue is a new feature Performance
Projects
None yet
2 participants