How openutm/flight-passport works
Main Components
• Django Core – Centered around the flight_passport directory. This contains the Django settings, URL configuration, WSGI/ASGI interfaces, and overall project configuration.
• Authentication & OAuth Apps – Multiple Django apps play a role:
• allauth: Provides templates and views for user authentication and account management.
• authprofiles: Handles adapter logic, migrations, and views related to OAuth profiles, playing a critical role in managing client credentials.
• oauth2_provider_jwt: Implements JWT-specific endpoints, utilities, and authentication flows.
• rolepermissions: Manages roles and permissions for fine-grained access control.
• vault: Contains additional admin commands, JWT utilities, and views that may handle secure storage or additional credential management.
• External Dependencies – Note the use of external libraries such as Authlib and Django OAuth Toolkit that are central to the OAuth and JWT capabilities.
Relationships and Interactions
• Flow from the client interfaces (admin interface, API clients like Postman/Insomnia) to the Django REST endpoints that handle authentication, token issuance, and OIDC flows.
• That the views/templates provided by allauth and vault serve user-facing components (like login pages, error pages, and account management) while the authprofiles and oauth2_provider_jwt apps handle back-end token logic.
• External libraries (Authlib, Django OAuth Toolkit) as shared services used by the OAuth apps to enforce protocol standards, token signing, and validation.
Architectural Patterns and Design Principles
• Separation of concerns typical in a full-stack Django application. Each Django app is responsible for a specific part of the authentication process.
• Use of MVC-like patterns where models (in apps like authprofiles and vault) interact with views (allauth templates, oauth2_provider_jwt views) and controllers (Django’s URL routing and middleware).
• Details about migrations, management commands (in rolepermissions and vault), and static/template resources, showing how they enable extendibility and maintenance.
Detail and Granularity
• Don’t shy away from splitting the architecture into as many components as possible. For example, separate out the JWT processing logic, the OAuth validation, admin operations, and role/permission management.