Skip to content

Conversation

@friedemannf
Copy link
Member

@friedemannf friedemannf commented Jan 19, 2026

This adds a JWT field to the Canton output, in order to allow clients to authenticate against localnet


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes introduce JWT authentication for Canton blockchain networks within a testing framework, aiming to enhance security by providing token-based access control to various endpoints. This includes generating JWTs for both the Super Validator and participants, ensuring that each entity within the network can securely authenticate against the provided interfaces. The default port configuration for Canton has also been centralized to improve consistency and maintainability across the codebase.

What

  • framework/.changeset/v0.13.3.md
    • Added a changeset document indicating the addition of Canton JWT authentication.
  • framework/components/blockchain/canton.go
    • Added imports for JWT and time handling.
    • Introduced constants for default Canton port and token expiry duration.
    • Added JWT field to CantonParticipantEndpoints struct.
    • Implemented JWT generation for both the Super Validator and participants using jwt.NewWithClaims.
    • Removed hard-coded port assignment in favor of using a constant.
  • framework/components/blockchain/canton/nginx.go
    • Removed unnecessary port defaulting logic, relying on the central default port definition.
  • framework/components/fake/go.sum
    • Updated module dependencies to include github.com/golang-jwt/jwt/v5.
  • framework/examples/myproject/go.mod
    • Indirect dependency on github.com/golang-jwt/jwt/v5 added due to updates in the main module.
  • framework/examples/myproject/smoke_canton_test.go
    • Removed manual JWT generation for test cases, utilizing the JWTs from the network setup.
  • framework/examples/myproject_cll/go.mod & go.sum
    • Indirect dependency on github.com/golang-jwt/jwt/v5 added due to updates in the main module.
  • framework/go.mod
    • Direct dependency on github.com/golang-jwt/jwt/v5 added to support JWT authentication functionality.

@friedemannf friedemannf marked this pull request as ready for review January 19, 2026 13:14
@friedemannf friedemannf requested a review from a team as a code owner January 19, 2026 13:14
Copilot AI review requested due to automatic review settings January 19, 2026 13:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds JWT authentication support for Canton blockchain participants in the testing framework. JWT tokens are now automatically generated for the Super Validator and all participants during network setup, eliminating the need for test code to manually create tokens.

Changes:

  • Added JWT token generation in the Canton setup function for the Super Validator and all participants
  • Moved the default port handling logic from nginx.go to canton.go
  • Updated test code to use pre-generated JWT tokens from participant endpoints instead of creating tokens manually

Reviewed changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
framework/go.mod Promoted github.com/golang-jwt/jwt/v5 from indirect to direct dependency
framework/examples/myproject_cll/go.mod Added github.com/golang-jwt/jwt/v5 as indirect dependency
framework/examples/myproject/go.mod Changed github.com/golang-jwt/jwt/v5 from direct to indirect dependency
framework/examples/myproject/smoke_canton_test.go Removed manual JWT token generation and switched to using pre-generated tokens from endpoints
framework/components/blockchain/canton/nginx.go Removed default port logic
framework/components/blockchain/canton.go Added JWT token generation for Super Validator and participants, moved default port handling
framework/.changeset/v0.13.3.md Added changelog entry for JWT authentication feature

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

@friedemannf friedemannf requested a review from Tofel January 19, 2026 13:16
@friedemannf friedemannf enabled auto-merge (squash) January 19, 2026 13:16
@friedemannf friedemannf merged commit 8cdc115 into main Jan 19, 2026
72 checks passed
@friedemannf friedemannf deleted the canton-auth branch January 19, 2026 14:04
Sign up for free to 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.

2 participants