feat(demo): upgrade /demo to picker + click-login + agent profile page#18
Merged
feat(demo): upgrade /demo to picker + click-login + agent profile page#18
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Upgrades the placeholder
/demopage (merged in #14) to a full end-to-end flow that exercises the whole package stack: Spring Boot host → Hibernate → Postgres → JPA repositories.DemoControllerseeds 2 departments + 3 AgentProfiles on first boot/demorenders an HTML picker, one form per seeded agentPOST /demo/login/{id}302-redirects to/demo/agent/{id}/demo/agent/{id}readsAgentProfileviaJpaRepositoryand renders it — round-trips DB + ORM + repo wiring end-to-endDemoSecurityConfigadds 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@EnableWebSecurityis on)spring-boot-starter-security(required since the package'sEscalatedSecurityConfigpulls inspring.security.webtypes)Verification (curl)
Scope note
This deliberately does NOT plumb an ApiToken through to hit
/escalated/api/agent/tickets. That endpoint is gated by the package'sApiTokenAuthenticationFilter, 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.