Repository navigation
Production readiness, security hardening, and refresh token rotation - #1
Merged
Merged
Conversation
…obal error responses
…and docker healthcheck
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 of Changes
This pull request addresses critical security vulnerabilities, implements token renewal mechanisms, improves production observability, and establishes open-source governance standards for the Spring Boot & React E-Learning/CBT platform.
Security Hardening
FileStorageService): Added path normalization and directory boundary validation to ensure stored, retrieved, or deleted files cannot escape the base upload root directory. Returns HTTP403 Forbiddenon unauthorized file traversal attempts.GlobalExceptionHandler): Removed generic exception leak (ex.getMessage()) to prevent internal database queries, table names, or connection credentials from leaking to clients. Exceptions are now logged to the server while returning a safe client message.docker-compose.yml(JWT_SECRETandAPP_JWT_SECRET) to ensure proper 256-bit Base64 parsing matchingJwtProvider.Authentication & UX Enhancements
/api/v1/auth/refresh): Implemented endpoint allowing clients to exchange valid refresh tokens for new access and refresh tokens without interrupting user sessions.frontend/src/api/client.tsto automatically detect HTTP401 Unauthorized, queue concurrent requests, obtain a new access token via/api/v1/auth/refresh, and replay original requests seamlessly. This prevents students from being prematurely logged out during lengthy CBT exams.DevOps & Observability
spring-boot-starter-actuatorwith health probes exposed under/actuator/healthand/actuator/info.backendservice and updated thefrontendcontainer to wait until the backend is healthy before serving traffic.backend_storagevolume mount (/app/storage/uploads) indocker-compose.ymlto prevent loss of uploaded assignments and learning materials across container restarts./actuator/routing support infrontend/nginx.conf.Open Source Governance & Documentation
LICENSE): Officially licensed the project under the MIT License as indicated by the README badge.CONTRIBUTING.md: Created detailed onboarding guidelines covering local prerequisites, Docker setup, coding conventions, testing procedures, and security reporting.README.mdandREADME.id.mdwith instructions on how to seed realistic demo data (seed_demo_data.sql) into PostgreSQL via Docker.Testing & Verification
FileStorageService(testing traversal attacks) andJwtProvider(testing token rotation and invalid signatures).