Skip to content

Conversation

@bianbbc87
Copy link
Collaborator

@bianbbc87 bianbbc87 commented Jan 31, 2025

이슈번호

요약(개요)

유저 서버 시큐리티, 회원가입, 이메일 인증, 로그인 구현

작업 내용

  • security filterchain 구현
  • security global logging 구현
  • memberId annotation 구현 (@memberid 로 member id get)
  • redis를 이용한 임시 회원가입
  • 이메일 인증번호 발송 (랜덤 6자리)
  • 이메일 인증번호 인증 및 회원가입
  • 로그인 및 access token 발급

집중해서 리뷰해야 하는 부분

  • service, serviceImpl 대신 usecase bean을 따로 생성해서 주입하는 방식으로 구현했습니다 !
  • 최대한 코드 템플릿 참고하되 기존에 작성하던 부분이 유지했습니다.
  • security 폴더만 넣으면 자동으로 jwt 받고 로그 찍히는걸로 하려고 했는데 준형님도 따로 만드셔서 각자 사용해도 좋을 것 같습니당
  • 임시 회원가입으로 redis에 유저 정보 저장 -> 이메일 코드 전송 -> 이메일 코드로 이메일과 함께 인증 완료 후 유저 생성 (entity 생성)
  • util이 많아질 것 같아서 기존 response가 있던 support 폴더에 utility, response, annotation 담아놨습니다 !

기타 전달 사항 및 참고 자료(선택)

  • 추가 작업 예정

Copy link
Collaborator

@toychip toychip left a comment

Choose a reason for hiding this comment

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

은지님 시큐리티 관련 작업 고생 많으셨습니다.
제 의견 달아봤는데 확인하시고 참고 부탁드립니다!


jpa:
hibernate:
ddl-auto: update
Copy link
Collaborator

Choose a reason for hiding this comment

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

테스트할때 update로 두고 배포환경에서는 none 이나 validate가 좋을 것 같아요

@bianbbc87
Copy link
Collaborator Author

bianbbc87 commented Feb 1, 2025

추가 작업 내용

리뷰 반영 (반영된 comment들 다 닫아놈)

  • controller, service, usecase 인자 final로 변경
  • base entity, base time entity 분리
  • 이메일 중복 검사 메서드 구현
  • global logal, exception filter 제거, support/logging에 AOP logging 추가 (코드 참고함)
  • cors 추가 (현재는 front web vite에 대한 cors 처리)
  • util, domain 메서드 이름 간결하게 변경 (createN -> create, validateN -> validate 등등..)
  • discord용 템플릿으로 변경
  • failtype 40x, 50x 구분
  • 비밀번호 중복 검사
  • BCryptPasswordEncoder 빈 등록 방식 변경 (PasswordEncoder로 BCryptPasswordEncoder를 호출)
  • CustomPrincipal override 제거
  • user details default 메서드들 오버라이딩 제거
  • user details simple authority 추가
  • id generater 생성 어노테이션 제거

추가 작업

  • test code 작성 (intelliJ http 기능)
  • redis crud repository 역할 분리
  • 낙관적 락 이슈 해결 (단순 버그였음. 다음날 다시 실행하니까 해결..)
  • response body 씹히는 이슈 해결 (jsonproperty 정의로 해결)
  • 유저 프로필 수정 (이름, 닉네임, 프로필 이미지) 메서드 구현
  • 회원탈퇴 메서드 구현
  • fail response용 global exception handler 정의 (filter 제외 failresponse 출력)
  • @memberid 파싱용 WebMvc config, resolver 추가
  • JwtFilter 암호화 512byte -> 256 byte로 변경
  • super user 생성 (나중에 필요하면 생성)

집중해서 리뷰해야 하는 부분

  • fail response 출력이 안 되어서, security/handler에 global exception handler 정의했습니다 ! (filter 단 제외)
  • httpStatus만 출력되는 문제가 있었는데, success, fail response type에 json property를 확실하게 명시하는 것으로 해결하였습니다.
  • 테스트용 http 파일 추가하였습니다. (env 파일은 서버 yml 넣는 곳에 넣어놨습니다.)

…credentials non expried, is enabled 오버라이딩 제거 (#10)

Signed-off-by: EunJiJung <[email protected]>
Copy link
Collaborator

@toychip toychip left a comment

Choose a reason for hiding this comment

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

고생하셨습니다.

@bianbbc87 bianbbc87 merged commit 8359eb8 into main Feb 3, 2025
1 check passed
onegood07 pushed a commit that referenced this pull request Feb 28, 2025
[BE] feat: user security, 회원가입, 이메일 인증, 로그인
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BE] feat: 회원가입, 로그인, 인증번호 전송 및 인증

3 participants