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

fix-be: web mvc 설정 변경 #684

Merged
merged 5 commits into from
Sep 23, 2024
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 22, 2024

Original issue description

목적

현재 저희 MvcConfig의 설정은 아래와 같습니다.

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AuthenticationInterceptor(authService, cookieManager))
                .addPathPatterns("/**")
                .excludePathPatterns("/**/signup")
                .excludePathPatterns("/**/login")
                .excludePathPatterns("/**/applyform/**")
                .excludePathPatterns("/**/posts/**")
                .excludePathPatterns("/");
    }

위 설정의 문제는 다음 두 가지입니다.

  1. .excludePathPatterns("/**/posts/**"): posts와 관련된 api는 없습니다.
  2. .excludePathPatterns("/**/applyform/**"): applyform 조회를 위해 로그인 인터셉터에서 제외했지만, get post patch 모든 사람에게 열려 있습니다.

작업 세부사항

  • .excludePathPatterns("/**/posts/**") 설정을 삭제한다.
  • GET /v1/applyform/{applyformId}와 POST /v1/applyform/{applyformId}/submit 요청만 로그인 인터셉터를 안거치게 수정한다.
  • 쿼리 관측을 위해 dev 환경 show-sql 설정 변경

참고 사항

  • MVC Config에서는 API의 메서드 레벨로 설정하는게 불가능하여 AuthenticationInterceptor 내부에서 설정을 변경할 예정입니다.

아래의 별표줄 밑에 요구사항 ID만 작성해주세요. Prefix 금지!


MEMBER_LOGIN_03

closes #683

@github-actions github-actions bot added backend 백엔드 fix 버그 수정 labels Sep 22, 2024
@Chocochip101 Chocochip101 marked this pull request as ready for review September 22, 2024 06:42
Copy link
Contributor Author

1726987391.515579

Copy link
Contributor Author

1726987394.855449

Copy link
Contributor Author

1726987397.014289

Copy link
Contributor Author

📌 Test Coverage Report

Overall Project 78.49%
Files changed 100% 🍏

File Coverage
WebMvcConfig.java 100% 🍏
AuthenticationInterceptor.java 92.75% 🍏

Copy link
Contributor

@xogns1514 xogns1514 left a comment

Choose a reason for hiding this comment

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

생각하지 못한 부분인데. 잘 짚어주셔서 감사합니닷!

Copy link
Contributor

@HyungHoKim00 HyungHoKim00 left a comment

Choose a reason for hiding this comment

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

질문 하나만 남겨놓았습니다.

@@ -59,7 +59,7 @@ spring:
enabled: true
baseline-on-migrate: true
jpa:
show-sql: false
show-sql: true
Copy link
Contributor

@HyungHoKim00 HyungHoKim00 Sep 22, 2024

Choose a reason for hiding this comment

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

dev 환경에서의 쿼리 관측이 필요한 이유가 뭔가요?

Copy link
Member

Choose a reason for hiding this comment

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

다른 환경(dev, prod)에서 토큰이 없을 경우 applyform 변경이 가능한지 테스트하다가, dev 환경에서 쿼리가 없어서 불편함을 느껴서 추가했습니다.

dev 에는 디버깅 용으로 쿼리 출력을 해놔도 괜찮을거라고 생각했습니다.

@Chocochip101 Chocochip101 merged commit cf480c3 into be/develop Sep 23, 2024
35 checks passed
@Chocochip101 Chocochip101 deleted the be-683-MEMBER_LOGIN_03 branch September 23, 2024 04:14
@Chocochip101 Chocochip101 restored the be-683-MEMBER_LOGIN_03 branch September 23, 2024 04:21
Chocochip101 added a commit that referenced this pull request Sep 24, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kwoun Ki Ho <fingercut3822@gmail.com>
@Dobby-Kim Dobby-Kim deleted the be-683-MEMBER_LOGIN_03 branch September 24, 2024 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend 백엔드 fix 버그 수정
Projects
Status: 완료
Development

Successfully merging this pull request may close these issues.

3 participants