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

[refactor] Auth 어노테이션이 메타 어노테이션인 경우에도 대응할 수 있도록 변경(#112) #113

Merged
merged 2 commits into from
Aug 21, 2024

Conversation

blaxsior
Copy link
Collaborator

#️⃣ 연관 이슈

ex) #112

📝 작업 내용

AnnotationUtils 기반으로 Auth 어노테이션 탐색 방식을 변경하여 Auth가 다른 어노테이션에 등록된 상태로 api에 연결되더라도 정상적으로 인증을 요구하도록 개선했습니다. 또한 인증용 어노테이션, swagger 인증 문서화용 어노테이션을 따로 api에 붙이는 대신 둘을 하나의 어노테이션에 등록하여 사용할 수 있게 하여 오류의 소지를 줄였습니다.

@EventUserAuth
    public ResponseEntity<Boolean> createComment(@Parameter(hidden = true) @EventUserAnnotation EventUserInfo userInfo, @PathVariable String eventFrameId, @RequestBody @Valid CreateCommentDto dto) {
        return ResponseEntity.ok(commentService.createComment(userInfo.getUserId(), eventFrameId, dto));
    }

Auth, SecurityRequirement를 더 이상 따로 등록할 필요 없이 EventAuth 어노테이션 하나로 처리가 가능해졌습니다.

@blaxsior blaxsior self-assigned this Aug 20, 2024
@blaxsior blaxsior added the refactor 코드 리팩토링 label Aug 20, 2024
@blaxsior blaxsior changed the title Refactor/112 merge annotation by util [refactor] Auth 어노테이션이 메타 어노테이션인 경우에도 대응할 수 있도록 변경(#112) Aug 20, 2024
Copy link
Collaborator

@win-luck win-luck left a comment

Choose a reason for hiding this comment

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

분리된 어노테이션이 하나도 합쳐진 덕분에 훨씬 가독성이 높아진 것 같습니다!! 고생하셨습니다.

@blaxsior blaxsior merged commit 89e6f96 into dev Aug 21, 2024
1 check passed
@win-luck win-luck deleted the refactor/112-merge-annotation-by-util branch August 23, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor 코드 리팩토링
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[refactor] Auth 어노테이션이 메타 어노테이션인 경우에도 대응할 수 있도록 변경(#112)
2 participants