Uh oh!
There was an error while loading. Please reload this page.
Creating example for new TokenProvider plugin - #153
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new extensibility sample demonstrating how to plug in Temporal Server’s auth.TokenProvider to attach bearer tokens to outbound cross-cluster (replication) RPCs, along with dependency updates needed to consume the (pre-release) Temporal Server changes that introduced TokenProvider.
Changes:
- Add a new
extensibility/tokenprovidersample (provider implementation + standalone server wiring + tests + test config). - Update the extensibility index README to link the new TokenProvider sample.
- Update
extensibility/go.mod/go.sumto pin Temporal Server/API versions that include the new TokenProvider support, and adjust the authorizer claim-mapper TLS subject handling.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds a link to the new Token Provider sample. |
| extensibility/tokenprovider/README.md | Documents the TokenProvider sample, caching behavior, and required config knobs. |
| extensibility/tokenprovider/myTokenProvider.go | Implements a file-backed TokenProvider with expiry-aware caching via oauth2.ReuseTokenSource. |
| extensibility/tokenprovider/myTokenProvider_test.go | Unit tests for file token reading, caching behavior, and JWT exp parsing. |
| extensibility/tokenprovider/server/main.go | Wires temporal.WithTokenProvider(...) into a sample server. |
| extensibility/tokenprovider/server/main_test.go | Boots the sample server and validates it becomes reachable with TokenProvider required. |
| extensibility/tokenprovider/server/testdata/config.yaml | Minimal server config for tests, including remoteClusterAuth+TLS stub. |
| extensibility/go.mod | Pins Temporal dependencies (incl. TokenProvider commit) and updates module requirements. |
| extensibility/go.sum | Updates dependency checksums to match the new module graph. |
| extensibility/authorizer/myClaimMapper.go | Switches TLS-based claim extraction to use TLSSubject when present (mTLS). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
TODO: Before merging, need to update go.mod to the actual release that TokenProvider is included with.
What was changed
Added samples for using JWT to auth replication/internode traffic
Why?
TokenProvider was added to OSS in temporalio/temporal@74a7108 and will soon be released. Prepping a sample for reference in setting up a server using the plugin.
Checklist
How was this tested:
Used samples to create local servers and ran validation against those servers.
Any docs updates needed?
Doc changes are already approved.