Skip to content

Conversation

@philipliu
Copy link
Contributor

@philipliu philipliu commented Jan 18, 2026

Description

This protects the /event and /events endpoint behind JWT auth. It also adds customer ID <-> account verification to the customer integration.

Context

These endpoints were previously unauthenticated, allowing attackers to post arbitrary events.

Testing

  • ./gradlew test

Documentation

N/A

Known limitations

N/A

@philipliu philipliu changed the title Protect event endpoints behind auth [ANCHOR-1151] Protect event endpoints behind auth Jan 18, 2026
@philipliu philipliu force-pushed the philip/anchor-1151-ref-server branch 2 times, most recently from 2ce3894 to a699142 Compare January 18, 2026 14:20
@philipliu philipliu force-pushed the philip/anchor-1151-ref-server branch from a699142 to 6637661 Compare January 18, 2026 14:31
@philipliu philipliu marked this pull request as ready for review January 21, 2026 16:01
Copilot AI review requested due to automatic review settings January 21, 2026 16:01
Copy link

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 enhances security by protecting event endpoints with authentication and adding customer ID-to-account verification in the customer integration service.

Changes:

  • Wraps /event and test endpoints (/events, /events/latest) behind JWT authentication
  • Adds validation to ensure customer IDs can only be accessed by the matching authenticated account
  • Modifies account injection logic in Sep12Service to include account information even when customer ID is provided

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
kotlin-reference-server/src/main/kotlin/org/stellar/reference/event/EventRoute.kt Wraps all event endpoints in authentication block and conditionally enables test endpoints based on configuration flag
kotlin-reference-server/src/main/kotlin/org/stellar/reference/di/ReferenceServerContainer.kt Passes enableTestEndpoints flag (from config.appSettings.isTest) to event route initialization
kotlin-reference-server/src/main/kotlin/org/stellar/reference/callbacks/customer/CustomerService.kt Adds assertCustomerMatchesRequest validation to prevent unauthorized access to customer data by ID
helm-charts/reference-server/values.yaml Adds auth.type configuration option with default value NONE
helm-charts/reference-server/templates/configmap.yaml Templates auth.type from values file instead of hardcoding
core/src/main/java/org/stellar/anchor/sep12/Sep12Service.java Removes condition preventing account injection when customer ID is present, enabling security validation
core/src/test/kotlin/org/stellar/anchor/sep12/Sep12ServiceTest.kt Adds tests verifying account injection for GET and PUT requests with customer ID

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

@philipliu philipliu merged commit f57e8be into develop Jan 22, 2026
11 checks passed
@philipliu philipliu deleted the philip/anchor-1151-ref-server branch January 22, 2026 19:25
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.

3 participants