Skip to content

Conversation

jsdt
Copy link
Contributor

@jsdt jsdt commented Oct 16, 2025

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 AuthCtx and JwtClaims, and adds an AuthCtx to the ReducerContext.

AuthCtx represents the credentials associated with the request, and JwtClaims represents a jwt token.

One difference from the rust version is that I didn't create helpers to build an AuthCtx from 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 from HashifyNet, 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 AuthCtx and JwtClaims, and adds an AuthCtx to the ReducerContext.

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.

@jsdt jsdt requested a review from rekhoff October 17, 2025 16:48
@bfops bfops added the release-any To be landed in any release window label Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-any To be landed in any release window

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants