Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BE] refactor: 비회원 인증을 Auth에서 하도록 변경 #1081

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

Kimprodp
Copy link
Contributor

@Kimprodp Kimprodp commented Feb 6, 2025


🚀 어떤 기능을 구현했나요 ?

  • 비회원에 대한 인증(GroupAccessCode)을 Auth에서 하도록 변경했습니다.

🔥 어떻게 해결했나요 ?

  • 리뷰 그룹을 찾는 로직은 ReviewGroupService에 존재하는 기능을 그대로 사용하고, 찾은 ReviewGroup에 대한 인증을 확인하는 과정만 Auth에서 진행합니다.
  • (추후 Member의 조회 또는 등록 과정도 이와 비슷하게 변경하면 될 것 같아요.)
  • api 통일성 있게 변경했어요.

📝 어떤 부분에 집중해서 리뷰해야 할까요?

  • 리뷰 그룹 액세스 코드를 통한 리뷰 그룹 확인은 비회원 외에는 사용되지 않고, 이는 자원을 찾기보다는 인증에 더 가까운 기능임으로 통일성을 위해 Auth에서 하는 것이 맞다고 판단했습니다.
  • 세션 기능 또한 Auth에서 처리하고 있으니 동일한 책임이라 생각됩니다.

📚 참고 자료, 할 말

  • 이전의 제가 올린 PR(회원 도입에 따른 스키마 변경)보다 해당 PR을 먼저 머지해서 이후 작업을 하는 것이 좋겠습니다.

Copy link

github-actions bot commented Feb 6, 2025

Test Results

154 tests  +1   151 ✅ +1   4s ⏱️ ±0s
 59 suites +1     3 💤 ±0 
 59 files   +1     0 ❌ ±0 

Results for commit 7da5e59. ± Comparison against base commit 8230f54.

This pull request removes 2 and adds 3 tests. Note that renamed tests count towards both.
reviewme.api.ReviewGroupApiTest ‑ 리뷰_그룹_코드와_액세스_코드로_일치_여부를_판단한다()
reviewme.reviewgroup.service.ReviewGroupServiceTest ‑ 리뷰_요청_코드와_리뷰_확인_코드가_일치하는지_확인한다()
reviewme.api.AuthApiTest ‑ 리뷰_그룹_액세스_코드로_비회원을_인증한다()
reviewme.auth.service.AuthServiceTest$리뷰_그룹의_액세스_코드를_통해_인증한다 ‑ 올바른_액세스_코드라면_예외가_발생하지_않는다()
reviewme.auth.service.AuthServiceTest$리뷰_그룹의_액세스_코드를_통해_인증한다 ‑ 잘못된_액세스_코드라면_예외가_발생한다()

Copy link
Contributor

@nayonsoso nayonsoso left a comment

Choose a reason for hiding this comment

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

리뷰 그룹을 인증하는걸 auth 에서 하니까 제자리를 찾은 기분이네요 ㅎㅎ 👍

Comment on lines +42 to +44
return ResponseEntity.noContent().build();
}

Copy link
Contributor

Choose a reason for hiding this comment

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

noContent 좋네요~ 😙
이번 PR에서 위의 auth/github 응답 코드도 204 로 바꾸는건 어때요?

Comment on lines +39 to +40
@MockBean
private ReviewGroupService reviewGroupService;
Copy link
Contributor

Choose a reason for hiding this comment

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

여기에 MockBean 을 사용해준건 왜인지 궁금해요!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[BE] 비회원의 그룹 인증 api를 Auth로 이동한다.
2 participants