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

인증객체 ,ArgumentResolver추가 #18

Merged
merged 1 commit into from
Aug 26, 2024
Merged

인증객체 ,ArgumentResolver추가 #18

merged 1 commit into from
Aug 26, 2024

Conversation

youngreal
Copy link
Member

What is this PR? 🔍

  • spring security에 비해 익숙하고 간단한 ArgumentResolver로 구현

Screenshot 📷

image

위와같이 컨트롤러 parameter에 resolver에 등록한 객체(AuthenticationMember)가 있는경우 해당 메서드 실행전에 resolver가 실행되고 Member에대한 정보를 컨트롤러로 반환

* spring security에 비해 익숙하고 간단한 ArgumentResolver로 구현
@youngreal youngreal requested a review from min-0 August 23, 2024 07:38
@youngreal youngreal self-assigned this Aug 23, 2024
@youngreal youngreal linked an issue Aug 23, 2024 that may be closed by this pull request
@youngreal youngreal added the enhancement New feature or request label Aug 26, 2024
Comment on lines +25 to +28
@Override
public boolean supportsParameter(MethodParameter parameter) {
return parameter.getParameterType().equals(AuthenticationMember.class);
}
Copy link
Member

Choose a reason for hiding this comment

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

이 메소드는 해당 파라미터가 컨트롤러에서 처리할 수 있는 파라미터 타입인지 확인하는 거 맞나요 ?!

Copy link
Member Author

Choose a reason for hiding this comment

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

넵 맞습니다 ㅎㅎ

Copy link
Member

Choose a reason for hiding this comment

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

이 클래스는 어디서 사용되나요 ?!

Copy link
Member Author

Choose a reason for hiding this comment

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

pr 스크린샷에 명시해뒀습니다

Comment on lines +21 to +24
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
resolvers.add(new AuthResolver(memberRepository, jwtProvider));
}
Copy link
Member

Choose a reason for hiding this comment

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

이 메소드는 어떤 일을 하는건가용
AuthResolver를 생성하면서 memberRepository와 jwtProvider를 주입하게 되면 어떻게 되는지 궁금합니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

단순하게 생성자 주입이라고 생각하시면 될것같습니다 AuthResolver에서 memberRepository와 jwtProvider를 사용할수있게됩니다~~~

@min-0
Copy link
Member

min-0 commented Aug 26, 2024

고생하셨숩니다 ~결국 spring security 안쓰시는 방향으로 하셨군요!

@youngreal
Copy link
Member Author

일정때문에 빨리 선택하게되었어요 나중에 경험으로 개선포인트 욕심이 있긴합니다~~

@youngreal youngreal merged commit c404612 into main Aug 26, 2024
1 check passed
@youngreal youngreal deleted the feat/#17 branch August 28, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JWT 토큰 검증 로직 추가
2 participants