Skip to content

feat(demo): upgrade /demo to picker + click-login + agent profile page#18

Merged
mpge merged 1 commit intomainfrom
feat/demo-end-to-end
Apr 19, 2026
Merged

feat(demo): upgrade /demo to picker + click-login + agent profile page#18
mpge merged 1 commit intomainfrom
feat/demo-end-to-end

Conversation

@mpge
Copy link
Copy Markdown
Member

@mpge mpge commented Apr 19, 2026

Summary

Upgrades the placeholder /demo page (merged in #14) to a full end-to-end flow that exercises the whole package stack: Spring Boot host → Hibernate → Postgres → JPA repositories.

  • DemoController seeds 2 departments + 3 AgentProfiles on first boot
  • /demo renders an HTML picker, one form per seeded agent
  • POST /demo/login/{id} 302-redirects to /demo/agent/{id}
  • /demo/agent/{id} reads AgentProfile via JpaRepository and renders it — round-trips DB + ORM + repo wiring end-to-end
  • DemoSecurityConfig adds an Order(0) filter chain that permits /demo/** (otherwise the package's Order(2) chain catches it under /escalated/** auth — wait, it actually only catches /escalated/**, but Spring Security's default-deny still kicks in for unmatched paths when @EnableWebSecurity is on)
  • Host build adds spring-boot-starter-security (required since the package's EscalatedSecurityConfig pulls in spring.security.web types)

Verification (curl)

GET  /demo               -> 200
POST /demo/login/1       -> 302 (Location: /demo/agent/1)
GET  /demo/agent/1       -> 200 (renders Alice (Admin) profile + dept count)

Scope note

This deliberately does NOT plumb an ApiToken through to hit /escalated/api/agent/tickets. That endpoint is gated by the package's ApiTokenAuthenticationFilter, and seeding/threading a valid token to the click-login flow is enough complexity to belong in its own follow-up PR. The current upgrade proves the host + JPA + package entities all work; full API exercise is deferred.

Replaces the placeholder /demo page with an end-to-end flow matching
the laravel/filament/symfony pattern, scoped to what works without
having to plumb an ApiToken through Spring Security:

- DemoController seeds 2 departments + 3 AgentProfiles on first boot
  (idempotent — checks agents.count() before seeding)
- /demo renders an HTML picker, one form per agent
- POST /demo/login/{id} 302-redirects to /demo/agent/{id}
- /demo/agent/{id} reads AgentProfile via JpaRepository and renders
  the profile, proving the host can round-trip the package's JPA
  entities end-to-end (DB connection + Hibernate mapping + repo
  injection all verified)
- DemoSecurityConfig adds an Order(0) filter chain that permits
  /demo/** so it doesn't get caught by the package's
  /escalated/** authentication chain
- Adds spring-boot-starter-security to host build (required because
  the package's EscalatedSecurityConfig pulls in spring.security.web)

Verified e2e:
  curl /demo            -> 200
  curl -X POST /demo/login/1 -> 302 -> /demo/agent/1
  curl /demo/agent/1    -> 200 (renders Alice (Admin) profile)
@mpge mpge merged commit 10a9af1 into main Apr 19, 2026
2 checks passed
@mpge mpge deleted the feat/demo-end-to-end branch April 19, 2026 03:30
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.

1 participant