Skip to content

[#7] FEAT: (common)본인 프로필 조회 API, (admin/agency)유저 프로필 조회 API 개발#39

Merged
Hwan0518 merged 3 commits intodevelopfrom
feature/user
Nov 27, 2025
Merged

[#7] FEAT: (common)본인 프로필 조회 API, (admin/agency)유저 프로필 조회 API 개발#39
Hwan0518 merged 3 commits intodevelopfrom
feature/user

Conversation

@Hwan0518
Copy link
Contributor

@Hwan0518 Hwan0518 commented Nov 27, 2025

Issue ✨

변경점 👍

  • (common)본인 프로필 조회 API, (admin/agency)유저 프로필 조회 API 개발
  • 기타 유저 기능 명세 생성
  • gitignore 업데이트 (mcp 관련)

Copilot AI review requested due to automatic review settings November 27, 2025 04:22
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 implements user profile viewing functionality with role-based authorization, allowing users to view their own profiles and admin/agency users to view other users' profiles. It also adds specification stubs for future user management features and validation endpoints for partner registration.

  • Adds authorization validation logic to the Users domain model to enforce access control rules (admin can view all, agency can view non-admin users, regular users/partners can only view themselves)
  • Implements two new service methods: getUserByLoginId for login-based lookup and getUserByUuid for UUID-based lookup with authorization checks
  • Creates profile viewing endpoints: a common endpoint for self-profile viewing and an admin/agency endpoint for viewing other users' profiles

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Users.java Adds new authorization validation method validateUserSearchAuthorizationOfRequestor to verify if a requestor can view a target user; renames existing method for clarity
GetUserDataService.java Implements getUserByLoginId and getUserByUuid service methods with authorization checks
GetUserByUuidInDto.java New DTO for UUID-based user lookup requests containing requestor and target information
GetUserByLoginIdInDto.java New DTO for login-ID-based user lookup requests containing requestor information
UserProfileResponse.java New response DTO containing user profile fields (name, phone, login ID, address, partner options)
GetUserDataController.java Adds two endpoints: /profile/my for self-profile viewing and /profile/{userUuid} for admin/agency to view other users
UserTermsController.java New controller stub with detailed specifications for future terms and consent management features
UserManagementController.java New controller stub with detailed specifications for future profile management, password operations, and account deletion
PartnerAuthController.java Adds validation endpoints for checking login ID and phone number duplicates during partner registration
BaseResponseStatus.java Updates error message to be more generic (removes "타입의" to make it applicable to individual user searches)
.gitignore Adds patterns for mcp and claude-related files

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

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment on lines +131 to +147
public void validateUserSearchAuthorizationOfRequestor(UserType requestorType, UUID requestorUuid) {

// admin -> 모두 조회 가능
if (requestorType == UserType.ADMIN) return; // 명시적 return

// agency -> admin 조회 불가, agency는 본인 및 user, partner만 조회 가능
if (requestorType == UserType.AGENCY && this.userType == UserType.ADMIN) {
throw new BaseException(BaseResponseStatus.NO_AUTHORITY_TO_SEARCH_USER);
}

// user, partner -> 본인만 조회 가능
if (requestorType == UserType.USER || requestorType == UserType.PERSONAL_PARTNER || requestorType == UserType.CORPORATE_PARTNER) {
if (this.userType != requestorType || !this.userUuid.equals(requestorUuid)) {
throw new BaseException(BaseResponseStatus.NO_AUTHORITY_TO_SEARCH_USER);
}
}
}
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

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

The authorization logic has a potential issue. For AGENCY requestors viewing non-ADMIN targets, the method currently allows the request to proceed without any further validation. However, based on the comment on line 136, agencies should only be able to view themselves and USER/PARTNER types. The current implementation doesn't verify that an AGENCY is viewing their own profile or a USER/PARTNER when the target is also AGENCY. This could allow one agency to view another agency's profile. Consider adding validation to ensure AGENCY can only view their own profile when the target type is AGENCY.

Copilot uses AI. Check for mistakes.
@Hwan0518 Hwan0518 merged commit 407ad04 into develop Nov 27, 2025
@Hwan0518 Hwan0518 deleted the feature/user branch November 27, 2025 05:36
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.

1 participant