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

[톰캣 구현하기 - 3, 4단계] 포이(김보준) 미션 제출합니다. #409

Merged
merged 18 commits into from
Sep 14, 2023

Conversation

poi1649
Copy link

@poi1649 poi1649 commented Sep 7, 2023

두둠 굿투씨유어게인입니다! 어프로브 하실 때 남겨주신 커멘트 확인했습니다. 감사합니다 👍

다른 부분에 대해서는 처음 리뷰 요청을 드렸을 때에 비해 큰 변경점이 없지만, Session 관련해 몇 가지 변경이 있어 이 과정과 이유를 먼저 공유해드립니다!

저번에 SessionManager를 통해서 Session을 생성하고, 주입까지 하는 형태는 SessionManager를 일급 컬렉션처럼 사용하면서도 팩토리 메소드 패턴의 팩토리 클래스처럼 사용한다는 느낌이 있었던 것 같습니다! 그럼 SessionManager 자체가 UUID Session만을 생성하는 팩토리 클래스 역할 + 일급 컬렉션 역할이 합쳐져있어서 책임 분리가 안된 느낌이었던 것 같습니다!

이 의견에 굉장히 공감했습니다. 그래서 두둠이 제시해주신 방향으로 Session을 리팩터링 해보았는데, 밑의 커멘트에서 약간 의문이 생겨 Session의 id에 대해 몇가지 찾아보았습니다.

지금은 단순히 UUID로 고유한 식별자로만 사용하지만 Session 값에 유의미한 정보가 들어가는 경우도 있을 것 같습니다

일단 Session id에는 유의미한 정보가 들어가면 안된다고 합니다. 쿠키에 저장되는 만큼 탈취 위험이 있고, 만약 추측할 수 있는 규칙이 있다면 프로그램 전체 보안에 큰 타격이 있을 수 있다고 합니다. (세션의 expired 기간이 있는 이유, 웹 어플리케이션에서 프레임워크가 제공하는 세션 기능을 사용하는 것을 권장하는 이유도 같은 맥락인 것 같네요)
그래서 만약 별다른 이유가 없다면 세션 아이디 정책은 제가 정한 정책을 어느 곳에서도 일관적으로 사용하도록 하는 것이 좋겠다고 생각했습니다. 이로 인해 결국 다시 SessionManager안에 UUID 객체를 직접 가지도록 변경했습니다...🥲


글이 너무 길어졌네요..! 이번 단계에서는 미션에 있는 요구사항을 디테일하게 반영하려고 노력해보았습니다! 의문이 생기는 부분이 있다면 편하게 커멘트 남겨주시면 감사할 것 같습니다! 오늘도 좋은 하루 되세요~🫡

  • 추가수정

구구의 커멘트 를 보고 ThreadPoolExecutor 대신 Executors를 사용하도록 리팩터링해보았습니다.
테스트 코드도 작성해봤는데 이 부분에 대해 커멘트 남겨주시면 감사할 것 같습니다!

@poi1649 poi1649 self-assigned this Sep 7, 2023
Copy link

@younghoondoodoom younghoondoodoom left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 포이! Connector 클래스에 신기한 기술을 많이 사용하셨네요..! 처음보는 기술이 많아서 많이 배우고 가네요 ㅎㅎ 이번에는 이 부분 집중적으로 얘기해봤으면 좋겠네요!
간단하게 제 생각 남겼으니까 참고 부탁드립니다!

@sonarcloud
Copy link

sonarcloud bot commented Sep 12, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 8 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

warning The version of Java (11.0.20.1) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link

@younghoondoodoom younghoondoodoom left a comment

Choose a reason for hiding this comment

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

안녕하세요 포이! 아이미스유네요.. 리뷰 너무 늦게 해드려서 죄송합니다ㅠ
쓰레드 관련해서 많이 고민하고 학습하신것 같아서 이만 어프로브 하겠습니다!

@younghoondoodoom younghoondoodoom merged commit e49dab6 into woowacourse:poi1649 Sep 14, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants