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]: TokenValidator와 TokenGenerator 추가로 TokenService 가독성 증대 및 패키지 경로 수정 #109

Merged
merged 4 commits into from
Aug 24, 2024

Conversation

sejineer
Copy link
Contributor

📄 Summary

  1. TokenValidator class를 두어 Token 검증 과정을 통합했습니다.
  2. TokenGenerator에 refresh method 를 생성하여 TokenService 의 refresh method 가독성을 증대했습니다.
  3. core-domain 모듈의 test package 경로가 잘못된 것을 발견하여 이를 수정하였습니다.
  4. 추가된 class 의 test code를 작성하였습니다.

🙋🏻 More

closes #105

@sejineer sejineer added refactor 코드를 리팩토링 test 테스트 코드 추가 및 업데이트 labels Aug 22, 2024
@sejineer sejineer requested review from kjb512 and hojinida August 22, 2024 17:20
@sejineer sejineer self-assigned this Aug 22, 2024
@sejineer sejineer changed the title [REFACTOR]: TokenValidator와 TokenGe [REFACTOR]: TokenValidator와 TokenGenerator 추가로 TokenService 가독성 증대 및 패키지 경로 수정 Aug 22, 2024
lateinit var sut: TokenGenerator
val userId = "1234"

beforeTest {
jwtProperty = JwtProperty().apply {
accessToken = JwtProperty.TokenProperties().apply {
expiration = 10000
secret = "lnp1ISIafo9E+U+xZ4xr0kaRGD5uNVCT1tiJ8gXmqWvp32L7JoXC9EjAy0z2F6NVSwrKLxbCkpzT+DZJazy3Pg=="
secret =
"lnp1ISIafo9E+U+xZ4xr0kaRGD5uNVCT1tiJ8gXmqWvp32L7JoXC9EjAy0z2F6NVSwrKLxbCkpzT+DZJazy3Pg=="
Copy link
Contributor

Choose a reason for hiding this comment

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

원래 secret을 저렇게 하드코딩 하나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

HS512 알고리즘을 적용하려면 어느 정도 길이의 key가 필요해서 무작위로 넣었습니다. 나중에 fixture로 빼서 refactoring할 예정입니다

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 Author

Choose a reason for hiding this comment

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

자세히 보면 다릅니다. 자세히 보아야 아름다워요

@sejineer sejineer merged commit b34dc7a into develop Aug 24, 2024
1 check passed
@hojinida hojinida deleted the refactor/#105-token-refactor branch August 24, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor 코드를 리팩토링 test 테스트 코드 추가 및 업데이트
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Token 관련 Refactoring
2 participants