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] feat: 인증 ArgumentResolver 구현 및 API 문서화 #167

Merged
merged 7 commits into from
Jul 22, 2024

Conversation

J-I-H-O
Copy link
Contributor

@J-I-H-O J-I-H-O commented Jul 22, 2024

이슈

개발 사항

  • Authorization 헤더에서 memberId를 읽어와 인자로 넣어주는 ArgumentResolver 구현
  • 회원 및 반려견 도메인 API 문서화

전달 사항

  • 토큰 관련 정보 없이 임시로 구현한 ArgumentResolver입니다.
  • 컨트롤러 메서드 파라미터에 @Auth 어노테이션 걸어주시면 ArgumentResolver가 Authorization 헤더에서 값 꺼내서 넣어줍니다.
  • swgger 인증 설정 추가했습니다. (build.gradle 변경 있음) 아래 버튼 눌러서 Authorization 헤더에 값 넣어줄 수 있습니다. 로그인 필요한 API의 경우, 항상 해당 헤더에 값 넣어야 정상 동작합니다.

image

@J-I-H-O J-I-H-O added 🧦 chore chore 📝 docs docs 🖥 backend backend ✨ feat 기능 개발 labels Jul 22, 2024
@J-I-H-O J-I-H-O self-assigned this Jul 22, 2024
Copy link

Unit Test Results

82 tests   82 ✔️  4s ⏱️
19 suites    0 💤
19 files      0

Results for commit de7c79d.

Copy link
Member

@jimi567 jimi567 left a comment

Choose a reason for hiding this comment

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

Controller 테스트까지 꼼꼼하게 잘 작성하셨네요 굿굿
고생하셧슴당

Comment on lines +75 to +78
//tasks.withType(GenerateSwaggerUI) {
// dependsOn 'openapi3'
//}

Copy link
Member

@jimi567 jimi567 Jul 22, 2024

Choose a reason for hiding this comment

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

필요없는건 지워도 될 것 같아욥

Comment on lines +33 to +35
if (authorizationValue == null) {
throw new FriendoglyException("로그인 후에 사용할 수 있습니다.");
}
Copy link
Member

Choose a reason for hiding this comment

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

인증 관련된 예외는 따로 만들어도 좋을 것 같아요. 401

@@ -29,8 +31,11 @@ public PetController(PetQueryService petQueryService, PetCommandService petComma
}

@PostMapping
public ResponseEntity<SavePetResponse> savePet(@RequestBody @Valid SavePetRequest savePetRequest) {
SavePetResponse response = petCommandService.savePet(savePetRequest);
public ResponseEntity<SavePetResponse> savePet(
Copy link
Member

Choose a reason for hiding this comment

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

image
사소하긴한데 그래도 정했으니 지키면 좋을 것 같아요.

Copy link
Contributor

Choose a reason for hiding this comment

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

이거 해커톤때 내가 했던건뎅 크크

Copy link
Contributor

@ehtjsv2 ehtjsv2 left a comment

Choose a reason for hiding this comment

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

ArgumentReslover랑 헤더문서에 적용한 거 좋네요~!

@@ -29,8 +31,11 @@ public PetController(PetQueryService petQueryService, PetCommandService petComma
}

@PostMapping
public ResponseEntity<SavePetResponse> savePet(@RequestBody @Valid SavePetRequest savePetRequest) {
SavePetResponse response = petCommandService.savePet(savePetRequest);
public ResponseEntity<SavePetResponse> savePet(
Copy link
Contributor

Choose a reason for hiding this comment

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

이거 해커톤때 내가 했던건뎅 크크

Copy link
Contributor

@takoyakimchi takoyakimchi left a comment

Choose a reason for hiding this comment

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

깔끔하게 잘 구현하셨네요~!!!
다른 크루가 리뷰 잘 남겨주어서 바로 approve할게요~

@J-I-H-O J-I-H-O merged commit efae6fb into develop Jul 22, 2024
3 checks passed
@J-I-H-O J-I-H-O deleted the feature/authorization-argumentResolve branch July 22, 2024 11:33
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.

회원 및 반려견 도메인 API 문서화 Authorization ArgumentResolver 구현
4 participants