-
Notifications
You must be signed in to change notification settings - Fork 632
Add bindings for csharp modules to use JWT claims #3414
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
Merged
Merged
+246
−3
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rekhoff
reviewed
Oct 20, 2025
rekhoff
approved these changes
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes/additions are clear and well commented; no objections. If we can get the comments addressed and the tests passing, that would be ideal, but I'll still mark my approval now.
gefjon
reviewed
Oct 21, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Changes
This exposes JWT claims for csharp modules, similar to how they are exposed to rust modules in #3288.
This adds the new types
AuthCtxandJwtClaims, and adds anAuthCtxto theReducerContext.AuthCtxrepresents the credentials associated with the request, andJwtClaimsrepresents a jwt token.One difference from the rust version is that I didn't create helpers to build an
AuthCtxfrom a jwt payload. The reason is that we would need to be able to compute the identity from the payload claims, which requires a blake3 hash implementation. The first two c# libraries I found had issues at runtime (Blake3 is wrapping a rust implementation, and HashifyNet seems to be broken by our trimming because it uses reflection heavily). I can look into taking the implementation fromHashifyNet, since it is MIT licensed, but I don't think we need to block merging on that.API and ABI breaking changes
This adds the new types
AuthCtxandJwtClaims, and adds anAuthCtxto theReducerContext.This also adds a csharp wrapper for the get_jwt ABI function added in #3288.
Expected complexity level and risk
Testing
This has a very minimal unit test of JwtClaims.
I manually tested using this locally with the csharp quickstart, and I was able to print jwt tokens inside the module.