Skip to content

Creating example for new TokenProvider plugin - #153

Open
stuart-wells wants to merge 4 commits into
mainfrom
stuartwells/tokenproviderexample
Open

Creating example for new TokenProvider plugin#153
stuart-wells wants to merge 4 commits into
mainfrom
stuartwells/tokenproviderexample

Conversation

@stuart-wells

Copy link
Copy Markdown

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

  1. How was this tested:
    Used samples to create local servers and ran validation against those servers.

  2. Any docs updates needed?
    Doc changes are already approved.

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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/tokenprovider sample (provider implementation + standalone server wiring + tests + test config).
  • Update the extensibility index README to link the new TokenProvider sample.
  • Update extensibility/go.mod/go.sum to 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
FileDescription
README.mdAdds a link to the new Token Provider sample.
extensibility/tokenprovider/README.mdDocuments the TokenProvider sample, caching behavior, and required config knobs.
extensibility/tokenprovider/myTokenProvider.goImplements a file-backed TokenProvider with expiry-aware caching via oauth2.ReuseTokenSource.
extensibility/tokenprovider/myTokenProvider_test.goUnit tests for file token reading, caching behavior, and JWT exp parsing.
extensibility/tokenprovider/server/main.goWires temporal.WithTokenProvider(...) into a sample server.
extensibility/tokenprovider/server/main_test.goBoots the sample server and validates it becomes reachable with TokenProvider required.
extensibility/tokenprovider/server/testdata/config.yamlMinimal server config for tests, including remoteClusterAuth+TLS stub.
extensibility/go.modPins Temporal dependencies (incl. TokenProvider commit) and updates module requirements.
extensibility/go.sumUpdates dependency checksums to match the new module graph.
extensibility/authorizer/myClaimMapper.goSwitches TLS-based claim extraction to use TLSSubject when present (mTLS).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadextensibility/tokenprovider/server/main.go
Comment threadextensibility/go.mod
Comment threadextensibility/tokenprovider/fileTokenProvider.go
Sign up for freeto 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.

3 participants

@stuart-wells@yux0