Merged
Conversation
- Changed all API endpoint methods from GET to POST in configuration files and updated handler logic to accept parameters via a Pydantic request body model.
- Introduced in-memory session management with secure cookie handling, added authentication dependencies, and implemented secure login/logout endpoints under /api/secure. - Added a /files proxy route for authenticated file access from Moodle, replacing insecure token-in-URL patterns. - Updated CORS handling for dynamic origin reflection - Refactored compose.yaml to use .env - Updated requirements for httpx[http2].
- Introduces an async lifespan context manager that periodically cleans up expired sessions using a background task. - The session cleanup runs every SESSION_MAX_AGE seconds and logs the number of sessions removed or any errors encountered. - The cleanup task is properly cancelled on application shutdown.
- Session management has been refactored to use Redis for storage instead of in-memory dictionaries. This includes async session functions, Redis initialization in app lifespan, and automatic session expiration via Redis. - The .env.example and compose.yaml files were updated to add Redis configuration, and requirements.txt now includes the redis package. - All session-related code and dependencies have been updated to support async Redis operations.
Switches to a multi-stage build using python:3.13-alpine for both build and runtime stages to reduce image size. - Installs build dependencies only in the builder stage and copies only the necessary Python packages and application code to the final image.
- Refactored CORS configuration to use allow_origin_regex for wildcard origins with credentials, exposing 'X-Request-Id' header and setting max_age. - Changed secure authentication route prefix from '/api/secure' to '/secure' for consistency.
Added Postgres service to compose.yaml and updated environment variables in .env.example for database configuration. Improved organization and clarity of environment variables, and ensured all services use a shared network for better connectivity.
Changed the default MOODLE_URL environment variable
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.
Type of Change
Description