champs-libres/persona-user-bundle
auth:verify, Breeze).EventDispatcher, SecurityBundle dependencies).ContainerInterface with Laravel’s Container.SecurityEvent) to Laravel’s Events facade or listeners.UserProvider with Laravel’s UserProvider interface.users table, but Laravel’s default auth expects one. Custom middleware or a lightweight users table (e.g., id, email, verified_at) would be needed.| Risk Area | Severity | Mitigation Strategy |
|---|---|---|
| Symfony-Laravel DI Gap | High | Abstract dependencies via interfaces; use Laravel’s bind() in AppServiceProvider. |
| Event System Mismatch | Medium | Create Laravel event listeners for critical hooks (e.g., login failures). |
| Session Handling | Medium | Leverage Laravel’s Session facade or middleware. |
| Testing Overhead | High | Write integration tests for auth flows (e.g., Persona login → Laravel session). |
| Maintenance Burden | High | Fork the bundle or create a Laravel-specific package to isolate changes. |
Laravel Compatibility Matrix:
| Component | Laravel Equivalent | Notes |
|---|---|---|
Symfony SecurityBundle |
Laravel Auth + Custom Middleware |
Replace Firewalls with Laravel routes. |
| Doctrine ORM | Eloquent ORM | Use Eloquent models for user data. |
| Twig Templates | Blade Templates | Rewrite login templates. |
| EventDispatcher | Laravel Events Facade |
Create listeners for auth events. |
| Session Storage | Laravel Session Facade |
Configure driver (e.g., file, redis). |
Recommended Stack:
Auth facade + custom PersonaAuthService (wrapper for bundle logic).laravel-persona-auth).PersonaAuthService that:
/login).AuthenticationSuccess → Laravel auth.login event).User interface → Laravel’s Illuminate\Contracts\Auth\Authenticatable.INTERACTIVE_LOGIN → auth.attempting).make:auth).PersonaAuthService and integrate with Laravel’s Auth facade.auth.login events).Cache::remember).| Failure Scenario | Impact | Recovery Strategy |
|---|---|---|
| Persona Service Outage | Users unable to log in | Implement fallback auth (email/password). |
| Token Validation Errors | False rejections | Add retry logic or manual review queue. |
| Database Connection Issues | User data loss (if using DB) | Ensure stateless mode; use Redis for sessions. |
| Laravel Session Corruption | Logged-out users | Switch to redis driver for sessions. |
| Dependency Version Conflicts | Deployment failures | Use composer.json overrides or Laravel’s alias feature. |
CONTRIBUTING.md for the Laravel package explaining:
How can I help you explore Laravel packages today?