Repository navigation
[Feat/#313] 특정 학번 소속 검사 예외 허용 - #314
Merged
Merged
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
github-actions
Bot
requested review from
leegain1,
sangrae2325,
tnals0924 and
xeoxxn
November 16, 2026 01:53
tnals0924
reviewed
Nov 16, 2026
| public class OAuthLoginUseCase { | ||
|
|
||
| // 소속 검사 예외 학번에 넣어 주는 전공. 학부는 SW로 저장된다 | ||
| private static final String BYPASS_MAJOR = "소프트웨어전공"; |
Member
There was a problem hiding this comment.
[a] 리뷰 포인트 주신 전공 문자열 우회 방식에 대한 의견이에요. 지금 범위에서는 괜찮아 보여요.
Department.fromMajor는MemberServiceImpl의register·applyProfile에서만 불리고, 그 입구인updateProfile·registerOrUpdateByStudentId를 부르는 곳은 이 UseCase뿐이에요. 다른 경로로 예외가 새거나 빠지는 곳은 없습니다.- 회원에는 전공 원문이 아니라
Department만 저장돼서(Member.create·Member.updateProfile) 바꾼 문자열이 DB에 남지도 않아요.
다만 "소프트웨어전공"이 Department.SW의 majorName(Department.java:17)을 옮겨 적은 값이라 매칭 규칙이 두 곳에 생겨요. 예를 들어
- KConnect 소속 표기가 바뀌어
SW의majorName을 고치면 - 이 상수는 그대로 남아 예외 학번도
DEPARTMENT_NOT_ALLOWED로 막히는데, 컴파일에서는 드러나지 않아요.
Department에서 값을 꺼내 쓰면 한 곳만 고치면 됩니다.
// Department
@Getter
private final String majorName;
// OAuthLoginUseCase.findOrRegister
String major = isDepartmentCheckBypassed(userInfo.studentId()) ? Department.SW.majorName() : userInfo.major();
Collaborator
Author
There was a problem hiding this comment.
예외 학번에 대해서만 일어나는 일이라서 department 코드 자체를 수정하기보다, 말씀해주신 상황이 생겼을 때는 직접 확인 후 수정하는 방향이 더 적절하다고 생각해서 반영하지 않았습니다!
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.
#️⃣연관된 이슈
🎯 해결하려는 문제가 무엇인가요?
소프트웨어융합대학 소속이 아닌 팀원이 앱에 로그인하지 못한다. KConnect 인증은 통과하지만, 우리 서버가 회원을 만들거나 프로필을 갱신할 때
Department.fromMajor가 전공 문자열에인공지능전공·소프트웨어전공이 없으면DEPARTMENT_NOT_ALLOWED(403)로 막는다. 가입할 때뿐 아니라 로그인할 때마다 검사하므로 DB에 회원 행을 직접 넣어도 우회되지 않는다.❓ 왜 해결해야 하나요?
팀원이 dev에서 실제 KConnect 로그인 흐름으로 앱을 테스트할 수 있어야 한다.
⭐ 어떻게 해결했나요?
MemberConfigKeys.DEPARTMENT_BYPASS_STUDENT_IDS(MEMBER_DEPARTMENT_BYPASS_STUDENT_IDS) 키를 추가했다. 기존admin_config_values설정값 패턴을 따른다.OAuthLoginUseCase가 KConnect 학번이 이 설정값(콤마 구분) 목록에 있으면 전공을소프트웨어전공으로 바꿔 프로필을 만든다. 이후 기존Department.fromMajor가 SW로 변환한다.Department,MemberServiceImpl,MemberProfileCommand)과 스키마는 바꾸지 않았다.dev 적용 방법 (배포 후 dev DB에서만 실행):
🧩 이 PR의 한계 & 트레이드오프
./gradlew build는 통과.⛓️ 기존 기능에 미치는 영향
admin_config_values조회가 한 번 늘어난다.🔀 Edge Case & 실패 시나리오
20231234, 20235678도 동작).DEPARTMENT_NOT_ALLOWED로 막힌다.📋 검토한 대안과 선택 이유
@ConfigurationProperties: 설정 클래스·yml·bootstrap import·.env.example·배포 환경 변수가 추가로 필요하고, 학번을 바꿀 때마다 재배포해야 한다.MemberProfileCommand·MemberServiceImpl·Department까지 바뀐다.💬 리뷰 포인트