Feat/#1#2
Open
jhlarry1109 wants to merge 15 commits into
Open
Conversation
Hyun731
reviewed
May 5, 2026
Hyun731
reviewed
May 5, 2026
Hyun731
reviewed
May 28, 2026
There was a problem hiding this comment.
Pull request overview
Adds a new Spring Boot “User” service implementing basic user CRUD plus internal authentication endpoints, backed by PostgreSQL/JPA and secured with a JWT filter.
Changes:
- Implemented
Userdomain (entity/role), repository, services, and REST controllers for signup + “me” profile/update/delete. - Added internal auth endpoints (email/password + Google OAuth payload handling) and JWT-based Security configuration.
- Added runtime/build configuration (application config, Dockerfile, and Gradle dependencies).
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/resources/application.yml | Adds server, datasource, JPA, and JWT configuration |
| src/main/resources/application.yaml | Removes duplicate/old minimal Spring config |
| src/main/java/com/example/user/service/UserService.java | User signup/profile/update/delete service logic |
| src/main/java/com/example/user/service/InternalUserService.java | Internal authentication logic (password + Google) |
| src/main/java/com/example/user/repository/UserRepository.java | JPA repository and lookup helpers |
| src/main/java/com/example/user/global/util/ResponseUtil.java | API response wrapper helper |
| src/main/java/com/example/user/global/security/UserPrincipal.java | Custom principal stored in SecurityContext |
| src/main/java/com/example/user/global/security/JwtProvider.java | JWT parsing/validation helpers |
| src/main/java/com/example/user/global/security/JwtFilter.java | Extracts JWT from Authorization header and authenticates request |
| src/main/java/com/example/user/global/dto/ApiResponse.java | Generic API response record |
| src/main/java/com/example/user/global/config/SecurityConfig.java | Configures stateless security + JWT filter |
| src/main/java/com/example/user/global/config/PasswordEncoderConfig.java | BCrypt PasswordEncoder bean |
| src/main/java/com/example/user/entity/User.java | User entity with soft-delete and factory methods |
| src/main/java/com/example/user/entity/Role.java | Role enum |
| src/main/java/com/example/user/dto/response/UserSearchResponse.java | “My profile” response DTO |
| src/main/java/com/example/user/dto/response/UserAuthResponse.java | Auth response DTO |
| src/main/java/com/example/user/dto/response/SignUpResponse.java | Signup response DTO |
| src/main/java/com/example/user/dto/request/UserUpdateRequest.java | Patch/update request DTO |
| src/main/java/com/example/user/dto/request/UserGoogleOauthRequest.java | Google OAuth request DTO |
| src/main/java/com/example/user/dto/request/SignUpRequest.java | Signup request DTO with validation |
| src/main/java/com/example/user/dto/request/SignInRequest.java | Sign-in request DTO |
| src/main/java/com/example/user/controller/UserController.java | Public user endpoints (/users/**) |
| src/main/java/com/example/user/controller/InternalUserController.java | Internal auth endpoints (/internal/users/**) |
| Dockerfile | Container build/run flow for the service |
| build.gradle | Adds web/validation/security/jjwt dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+29
to
+33
| .authorizeHttpRequests(auth -> auth | ||
| .requestMatchers("/users/signup").permitAll() | ||
| .requestMatchers("/users/me").authenticated() | ||
| .anyRequest().permitAll() | ||
| ) |
Comment on lines
+23
to
+26
| public SignUpResponse signup(SignUpRequest request) { | ||
| if (userRepository.existsByEmail(request.email())) { | ||
| throw new IllegalArgumentException("이미 존재하는 이메일"); | ||
| } |
Comment on lines
+23
to
+36
| public SignUpResponse signup(SignUpRequest request) { | ||
| if (userRepository.existsByEmail(request.email())) { | ||
| throw new IllegalArgumentException("이미 존재하는 이메일"); | ||
| } | ||
|
|
||
| String encodedPassword = passwordEncoder.encode(request.password()); | ||
|
|
||
| User user = User.create( | ||
| request.email(), | ||
| encodedPassword, | ||
| request.name() | ||
| ); | ||
| userRepository.save(user); | ||
|
|
Comment on lines
+21
to
+35
| @PostMapping("/authenticate") | ||
| public ResponseEntity<UserAuthResponse> authenticate( | ||
| @RequestBody SignInRequest request | ||
| ) { | ||
| UserAuthResponse response = internalUserService.authenticate(request); | ||
|
|
||
| return ResponseEntity.ok(response); | ||
| } | ||
|
|
||
| @PostMapping("/oauth/google") | ||
| public ResponseEntity<UserAuthResponse> authenticateGoogle( | ||
| @RequestBody UserGoogleOauthRequest request | ||
| ) { | ||
| return ResponseEntity.ok(internalUserService.authenticateGoogle(request)); | ||
| } |
Comment on lines
+30
to
+35
| @PostMapping("/oauth/google") | ||
| public ResponseEntity<UserAuthResponse> authenticateGoogle( | ||
| @RequestBody UserGoogleOauthRequest request | ||
| ) { | ||
| return ResponseEntity.ok(internalUserService.authenticateGoogle(request)); | ||
| } |
Comment on lines
+19
to
+20
| jwt: | ||
| secret: "${JWT_SECRET:momentlit-user-service-jwt-secret-key-for-local-test-1234567890}" |
Comment on lines
+6
to
+10
| RUN ./gradlew dependencies --no-daemon | ||
|
|
||
| COPY src ./src | ||
| RUN ./gradlew bootJar -x test --no-daemon | ||
|
|
Comment on lines
+2
to
+7
|
|
||
| public record SignInRequest( | ||
| String email, | ||
| String password | ||
| ) { | ||
| } |
Comment on lines
+3
to
+19
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
|
||
| public record UserGoogleOauthRequest( | ||
| @JsonProperty("provider_id") | ||
| String providerId, | ||
|
|
||
| String email, | ||
|
|
||
| @JsonProperty("email_verified") | ||
| Boolean emailVerified, | ||
|
|
||
| String name, | ||
|
|
||
| @JsonProperty("image_url") | ||
| String imageUrl | ||
| ) { | ||
| } |
Comment on lines
+16
to
+18
| import java.io.IOException; | ||
| import java.util.Collections; | ||
| import java.util.List; |
Hyun731
previously approved these changes
May 28, 2026
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.
#️⃣ 연관된 이슈
📝 작업 내용
💬 리뷰 요청 사항 (선택)