Commit Graph

10 Commits

Author SHA1 Message Date
Kshitij f06dbd84ad Add user registration endpoint and HDFS directory creation
- Implemented a new registration endpoint in AuthController to handle user sign-ups.
- Integrated AuthenticationService to save the user and create a corresponding HDFS directory for the user upon registration.
- Updated User entity to return the username instead of email in getUsername method.
2025-07-03 14:24:04 +05:30
Kshitij 12355f25c7 Refactor Auth and HDFS controllers, fix User model, and improve HDFS config
- Rewrote AuthController to inject all dependencies via constructor
- Fixed token refresh/login logic and added rate limiter and blacklist support
- Implemented getters in LoginRequest DTO
- Updated User model to implement UserDetails and extend entity.User
- Switched HDFScontroller to use entity.User instead of models.User
- Rewrote HDFSConfig to include static getHDFS() method and secure config via env vars
- Simplified JwtService, added overload for entity.User, and fixed key handling
2025-07-03 03:47:08 +05:30
Kshitij 9cb9c67b09 Revoke refresh token on logout for enhanced session security 2025-07-03 03:21:53 +05:30
Kshitij 31f13b980b Update login response to return both access and refresh tokens 2025-07-03 03:19:15 +05:30
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 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
LalitH 3bc5cf3e62 Added Signup and JWT Login 2025-04-14 22:27:39 +05:30