Skip to content

Rebuild the example as a Spring Boot app on castle-java 3.0.0#8

Draft
bartes wants to merge 4 commits into
mainfrom
feat/castle-java-3.0.0
Draft

Rebuild the example as a Spring Boot app on castle-java 3.0.0#8
bartes wants to merge 4 commits into
mainfrom
feat/castle-java-3.0.0

Conversation

@bartes

@bartes bartes commented Jun 11, 2026

Copy link
Copy Markdown

Rebuilds the demo as a Spring Boot 3 (Thymeleaf) application on castle-java 3.0.0.

What's demonstrated

Every action mints a fresh Castle.createRequestToken() in the browser and forwards it to the backend, which calls Castle and acts on the verdict.

  • Sign up / login / account / password reset via the filter, risk and log endpoints
  • Lists — the typed Lists API (createList, listAllLists)
  • Privacy — request and delete user data
  • Events — fetch the event schema and query events (eventsSchema, queryEvents)
  • Webhooks — incoming webhooks are signature-verified with verifyWebhookSignature against the X-Castle-Signature header, and recent payloads are listed

Changes

  • Replace the JSP/servlet app (and its authenticate + track login flow) with server-rendered Thymeleaf pages and Spring MVC JSON endpoints
  • Migrate to jakarta.servlet (Spring Boot 3)
  • Pin castle-java 3.0.0 and use the typed Lists models (ListRequest / ListResponse)
  • Add a SpringBootTest/MockMvc suite (context startup, home page, webhook signature accept/reject)
  • CI runs on a JDK 17 / 21 / 25 matrix; the SDK is built from source until 3.0.0 is published to Maven Central

bartes added 4 commits June 10, 2026 23:30
Add demo endpoints exercising the SDK directly: /lists-demo (Lists and list
items lifecycle), /events-demo (event schema and query), /privacy-demo
(privacy data request) and /webhooks (verifies the X-Castle-Signature header
against the raw request body). Link them from the home page.

Bump the castle-java dependency to 2.2.0 and the app version to 1.5.0.
Replace the JSP/servlet authenticate + track app with a Thymeleaf Spring
Boot 3 app demonstrating the modern Castle surface: the filter/risk/log
lifecycle (sign up, login, account, password reset), the typed Lists API,
privacy request/delete, and webhook signature verification. Target the
castle-java 3.0.0 SDK on jakarta.servlet and run CI on a JDK 17/21/25
matrix, building the SDK from source until 3.0.0 is published.
Add a SpringBootTest/MockMvc suite covering context startup, the home
page, and webhook signature verification (accepts a valid X-Castle-Signature,
rejects an invalid one). A test castle_api_secret is injected through the
surefire environment so the Castle singleton initialises during tests.
Add an /events workflow that calls eventsSchema and queryEvents and renders
both responses, registered in the demo catalog and reachable from the home
page alongside the lists, privacy and webhooks demos.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant