Skip to content

Conversation

@philipliu
Copy link
Contributor

What

This PR implements the JWT generation and HTTP handler for SEP-45.

Why

SEP-45 implementation

Known limitations

Nonce is still missing, and SEP-45 could be refactored to share some code with SEP-10. I'll address these in a follow-up.

Checklist

  • Title follows SDP-1234: Add new feature or Chore: Refactor package xyz format. The Jira ticket code was included if available.
  • PR has a focused scope and doesn't mix features with refactoring
  • Tests are included (if applicable)
  • CHANGELOG.md is updated (if applicable)
  • CONFIG/SECRETS changes are updated in helmcharts and deployments (if applicable)
  • Preview deployment works as expected
  • Ready for production

@philipliu philipliu temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 1, 2025 16:56 — with GitHub Actions Inactive
@philipliu philipliu temporarily deployed to Internal SEP Tests December 1, 2025 16:56 — with GitHub Actions Inactive
@stellar-jenkins
Copy link

@philipliu philipliu force-pushed the philip/sdp-1863-sep45-handler branch from f8d394c to 4b3b95a Compare December 1, 2025 17:06
@philipliu philipliu temporarily deployed to Internal SEP Tests December 1, 2025 17:06 — with GitHub Actions Inactive
@philipliu philipliu temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 1, 2025 17:06 — with GitHub Actions Inactive
@stellar-jenkins
Copy link

@philipliu philipliu marked this pull request as ready for review December 1, 2025 17:11
Copilot AI review requested due to automatic review settings December 1, 2025 17:11
Copilot finished reviewing on behalf of philipliu December 1, 2025 17: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 implements SEP-45 smart contract authentication by adding JWT generation, HTTP handlers, and service logic for creating and validating authorization challenges for smart contract wallets on the Stellar network.

Key Changes

  • Added SEP-45 JWT claims validation and token generation/parsing to the JWT manager
  • Implemented SEP-45 service with challenge creation and validation using Soroban authorization entries
  • Created HTTP handlers and routes for /sep45/auth endpoints supporting both GET and POST methods

Reviewed changes

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

Show a summary per file
File Description
internal/sepauth/jwt_manager.go Adds Sep45JWTClaims struct and methods for generating/parsing SEP-45 JWT tokens
internal/sepauth/jwt_manager_test.go Comprehensive test coverage for SEP-45 JWT token generation and parsing
internal/services/sep45_service.go Core SEP-45 service implementation with challenge creation and validation logic
internal/services/sep45_service_test.go Test coverage for SEP-45 service including error cases and JWT validation
internal/services/sep45_service_mock.go Auto-generated mock for SEP45Service interface
internal/serve/httphandler/sep45_handler.go HTTP handlers for GET/POST /sep45/auth endpoints with proper error handling
internal/serve/httphandler/sep45_handler_test.go Test coverage for SEP-45 HTTP handlers including various content types
internal/serve/serve.go Integration of SEP-45 service into the server setup and routing
internal/serve/serve_test.go Updates to test configuration to enable SEP-45 and verify unauthenticated endpoints

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

Copy link
Contributor

@JiahuiWho JiahuiWho left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@marwen-abid marwen-abid left a comment

Choose a reason for hiding this comment

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

LGTM

@philipliu philipliu temporarily deployed to Internal SEP Tests December 3, 2025 20:16 — with GitHub Actions Inactive
@philipliu philipliu temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 3, 2025 20:16 — with GitHub Actions Inactive
@stellar-jenkins
Copy link

@philipliu philipliu merged commit b7f0c37 into feature/c-accounts Dec 3, 2025
16 checks passed
@philipliu philipliu deleted the philip/sdp-1863-sep45-handler branch December 3, 2025 20:21
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.

5 participants