Commit Graph

25 Commits

Author SHA1 Message Date
Kshitij 2379d95759 Add refresh token support with /api/auth/refresh endpoint
- RefreshToken entity added with 1-token-per-user logic.
- JWT can be renewed without full login using refresh token.
2025-07-03 03:15:31 +05:30
Kshitij 178a32f908 Removed obsolete files. Refactored certain files to use newer ones. 2025-07-03 03:10:51 +05:30
Kshitij 218ccb720f Implement token blacklist for JWT logout support
- TokenBlacklistService tracks invalidated tokens using Caffeine cache.
- AuthController adds tokens to blacklist on logout.
- JwtAuthenticationFilter blocks blacklisted tokens during authentication.
2025-07-03 02:57:29 +05:30
Kshitij dd52421392 Add brute-force protection with rate limiting on login
- Caffeine cache used to allow max 5 login attempts per minute.
- Login endpoint blocks IPs exceeding rate, returns 429 status.
- Failed attempts are reset after successful login or after 1 minute.
2025-07-03 02:47:19 +05:30
Kshitij aaf5d2dbd8 Add JWT authentication filter to secure protected routes
- Intercepts all requests and checks for Bearer token.
- Validates token signature and expiry using JwtService.
- Loads user from DB and sets authentication context.
- Sends 401 Unauthorized if token is missing, invalid, or expired.
2025-07-03 02:43:56 +05:30
Kshitij 4b21828510 Add JWT-based login and logout endpoints
- POST /api/auth/login authenticates user and returns JWT token.
- POST /api/auth/logout is a placeholder (client deletes token).
- JwtService handles token creation and expiry validation.
2025-07-03 02:38:55 +05:30
Kshitij e14f27830e Add HTTP to HTTPS redirect configuration using embedded Tomcat
- HTTP connector on port 8080 redirects to HTTPS (8443).
- Ensures users accessing http:// are forwarded to https://
- No need for external proxy (e.g., Nginx) for redirection.
2025-07-03 02:37:13 +05:30
Kshitij 04f291910f Harden Spring Security configuration and enforce HTTPS
- All requests now require HTTPS.
- Stateless sessions enabled for JWT-based auth.
- XSS, HSTS, and Frame-Options headers added.
- /api/auth/** is public, all other routes require authentication.
- CSRF disabled (assumes token-based auth).
2025-07-03 02:35:25 +05:30
Kshitij c88cb5ac0e Add secure file upload and download with per-user AES encryption
- FileController encrypts uploads using AES-GCM with salt and IV.
- Downloads are decrypted on-the-fly using user-supplied password.
- File metadata (salt, IV, username, path) stored in DB.
2025-07-03 02:32:42 +05:30
Kshitij c133617990 Move UserService to correct 'services' package and update related imports 2025-07-03 02:30:20 +05:30
Kshitij 91e0d50c0a Implement AES-GCM file encryption per user
- EncryptionService uses PBKDF2 to derive a key from user password and salt.
- AES-GCM encryption with 128-bit tag and 12-byte IV.
- Ready for streaming encryption to/from HDFS without temp files.
2025-07-03 02:26:46 +05:30
Kshitij 39aa31625d Add username validation and password breach check to signup
- Enforced alphanumeric-only usernames using regex validation.
- Passwords must be >= 8 chars and checked against haveibeenpwned.com.
- Improved SignupRequest DTO with validation annotations.
- Implemented UserService to handle password validation and encoding.
2025-07-03 02:26:30 +05:30
Kshitij 8ae2ced645 Harden ApplicationConfiguration with stronger BCrypt, cleanup, and security improvements
- Increased BCrypt password encoder strength to 12 for better hashing security.
- Switched to PasswordEncoder interface for flexibility (e.g., Argon2 support).
- Removed unused import (java.security.AuthProvider).
- Made all @Bean methods explicitly public.
- Added JavaDoc comments for better readability and maintainability.
- Improved exception message in UserDetailsService for clarity.
2025-07-03 02:01:05 +05:30
Kshitij 18876f2780 Changed hdfs IP to docker container's hostname. 2025-04-20 20:51:01 +05:30
vedang29 3b5736dc8e Retrieve Username by Email 2025-04-18 16:54:42 +05:30
SonaliChaudhari 03bdb5d898 Implemented Encryption and Decryption Needed to be as saved Response 2025-04-18 00:28:45 +05:30
SonaliChaudhari 5cd396951d MAIN CODE PUSHED ON MASTER BRANCH - NEED TO WORK ON ENCRYPTION AND DECRYPTION 2025-04-17 22:28:47 +05:30
Kshitij 45b4ac7208 Changed download file API part. Now it downloads the file in server and fetches it to client slide. 2025-04-15 21:22:53 +05:30
vedang29 89e6df1c4b Changed CORS code & Alloed All origins 2025-04-15 02:49:46 +05:30
vedang29 293b73cf2a Removed deprecated CORS errors 2025-04-15 02:41:21 +05:30
vedang29 bf6c93efd5 Changed CORS 2025-04-15 02:35:58 +05:30
LalitH 3bc5cf3e62 Added Signup and JWT Login 2025-04-14 22:27:39 +05:30
vedang29 72bfd2eb0c REST API for file management completed (without JWT) 2025-04-14 17:47:12 +05:30
vedang29 2b8c4491f5 Finally Its done quick quick quick 2025-04-14 03:40:31 +05:30
vedang29 3cd77346f7 Set up spring app with menu driven HDFS 2025-04-14 00:22:24 +05:30