Skip to content

feat(identity): setup base entities, DTOs, and JWT security config#2

Draft
IsraaXx wants to merge 3 commits intodevelopfrom
feature/authentication
Draft

feat(identity): setup base entities, DTOs, and JWT security config#2
IsraaXx wants to merge 3 commits intodevelopfrom
feature/authentication

Conversation

@IsraaXx
Copy link
Member

@IsraaXx IsraaXx commented Feb 20, 2026

  • Added User, EmailVerification and RefreshToken entities with schema definitions.
  • Created request/response DTOs for authentication.
  • Implemented UserMapper extension functions.
  • Configured Spring Security (stateless session, public endpoints).
  • Added JwtUtil and JwtFilter for token generation and validation.
  • Created CustomUserDetailsService to link DB with Spring Security.
  • Implemented Authentication endpoints (Sign Up, Login, Refresh Token, Logout).
  • Added Refresh Token logic (save, validate, and delete tokens in the database).

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR establishes the foundational authentication and identity management infrastructure for the Spendoo application. It introduces JWT-based stateless authentication, user management entities with email verification support, and Spring Security configuration. The implementation uses Spring Boot 4.0.1 with Kotlin, PostgreSQL for persistence, and JJWT for token management.

Changes:

  • Added User and EmailVerification JPA entities with PostgreSQL schema definitions
  • Implemented Spring Security configuration with JWT-based stateless authentication and custom user details service
  • Created authentication DTOs (RegisterRequest, LoginRequest, AuthResponse, etc.) and user mapper extension functions
  • Configured application properties for database, JWT, and email services
  • Added required dependencies including Spring Security, JPA, PostgreSQL driver, and JJWT libraries

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 28 comments.

Show a summary per file
File Description
identity/src/main/kotlin/org/spendoo/identity/entity/User.kt Defines the User entity with email, password, profile fields, and email verification relationship
identity/src/main/kotlin/org/spendoo/identity/entity/EmailVerification.kt Defines the EmailVerification entity for OTP-based email verification with expiry logic
identity/src/main/kotlin/org/spendoo/identity/security/SecurityConfig.kt Configures Spring Security with stateless JWT authentication and public endpoints
identity/src/main/kotlin/org/spendoo/identity/security/JwtUtil.kt Implements JWT token generation, validation, and username extraction
identity/src/main/kotlin/org/spendoo/identity/security/JwtFilter.kt Filter to intercept requests and validate JWT tokens in Authorization headers
identity/src/main/kotlin/org/spendoo/identity/security/CustomUserDetailsService.kt Bridges the User entity with Spring Security's authentication framework
identity/src/main/kotlin/org/spendoo/identity/mapper/UserMapper.kt Extension function to convert RegisterRequest DTO to User entity
identity/src/main/kotlin/org/spendoo/identity/dto/*.kt Request/response DTOs for authentication operations (register, login, OTP verification, password reset)
identity/build.gradle.kts Added dependencies for Spring Security, JPA, JJWT, validation, and email
app/build.gradle.kts Added JPA and PostgreSQL dependencies to the main application module
app/src/main/kotlin/org/spendoo/app/SpendooApplication.kt Enabled JPA repositories and entity scanning for multi-module architecture
app/src/main/resources/application.properties Configured database connection, JPA settings, email service, and JWT secret

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 20, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 21, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 22, 2026
@SpendooApp SpendooApp deleted a comment from Copilot AI Feb 22, 2026
@IsraaXx IsraaXx self-assigned this Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants