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

Modify/#66 modify authority #67

Merged
merged 7 commits into from
Jul 27, 2023
Merged

Modify/#66 modify authority #67

merged 7 commits into from
Jul 27, 2023

Conversation

dong2ast
Copy link
Collaborator

๐Ÿ“Œ ๊ด€๋ จ ์ด์Šˆ

closed #66
URL์ด ๋งŽ์ด ๋ฐ”๋€Œ์–ด์„œ ์•„์ง์€ merge ์•ˆํ•˜๋Š”๊ฒŒ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.

โœจ ๊ณผ์ œ ๋‚ด์šฉ

  • Authority Enum ํ•„๋“œ ์ถ”๊ฐ€
  • Boolean ํ•„๋“œ ์ง€์šฐ๊ณ  Enum type์œผ๋กœ ํ™•์ธํ•˜๊ฒŒ ๋ณ€๊ฒฝ
  • ์ž‘๊ฐ€ ๊ด€๋ จ๋œ URI ํ•œ ์ปจํŠธ๋กค๋Ÿฌ์—์„œ ๊ด€๋ฆฌํ•˜๊ฒŒ ๋ณ€๊ฒฝ
  • Security Config์— ์ž‘๊ฐ€ URI์— ๋Œ€ํ•œ ์ ‘๊ทผ ๊ถŒํ•œ ์„ค์ •
  • token์œผ๋กœ ์œ ์ € ์ •๋ณด ๋ฐ›์•„์˜ค๊ฒŒ ๋ณ€๊ฒฝ -> Path Variable ์‚ฌ์šฉ x

๐Ÿ“ธ ์Šคํฌ๋ฆฐ์ƒท(์„ ํƒ)

๐Ÿ“š ๋ ˆํผ๋Ÿฐ์Šค (๋˜๋Š” ์ƒˆ๋กœ ์•Œ๊ฒŒ ๋œ ๋‚ด์šฉ) ํ˜น์€ ๊ถ๊ธˆํ•œ ์‚ฌํ•ญ๋“ค

@dong2ast dong2ast added the ๊ฐœ๋ฐœ ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ ํ–ˆ์„ ๋•Œ label Jul 25, 2023
@dong2ast dong2ast self-assigned this Jul 25, 2023
Comment on lines +40 to +44
/**
* HttpServletRequest๋‚˜ HttpServletResponse ๊ฐ์ฒด๊ฐ€ Service ๊ณ„์ธต์œผ๋กœ ๋„˜์–ด๊ฐ€๋Š” ๊ฒƒ์€ ์ข‹์ง€ ์•Š๋‹ค.
* request, response๋Š” ์ปจํŠธ๋กค๋Ÿฌ ๊ณ„์ธต์—์„œ ์‚ฌ์šฉ๋˜๋Š” ๊ฐ์ฒด์ด๋ฉฐ, Service ๊ณ„์ธต์ด request์™€ response๋ฅผ ์•Œ ํ•„์š”๊ฐ€ ์—†๋‹ค.
*/
String accessToken = tokenProvider.resolveAccessToken(request);
Copy link
Member

Choose a reason for hiding this comment

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

์˜ค ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค!๐Ÿ‘

Comment on lines +21 to +23
@GetMapping("/myhome") //ํšŒ์› ํ™ˆ ์กฐํšŒ (์ž‘๊ฐ€์™€ ์ฃผ๋ฏผ ๊ตฌ๋ถ„์€ ์„œ๋น„์Šค ๋‹จ ๋‚ด์—์„œ)
public ApiResponseDto<HomeResponseDto> getHome(@AuthenticationPrincipal User user) {
Long memberId = memberRepository.getMemberByEmail(user.getUsername()).getId();
Copy link
Member

Choose a reason for hiding this comment

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

controller์—์„œ repository๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๊ฒƒ์ด ์•„ํ‚คํ…์ฒ˜ ๊ด€์ ์ด๋‚˜ ์œ ์ง€ ๋ณด์ˆ˜ ์ธก๋ฉด์—์„œ ์ข‹์ง€ ์•Š์€ ๊ฒƒ ๊ฐ™์•„์„œ
email ์ •๋ณด๋ฅผ service๋กœ ๋„˜๊ฒจ์„œ service ๋‚ด์—์„œ repository๋ฅผ ํ˜ธ์ถœํ•ด์„œ ํ•ด๋‹น ์ด๋ฉ”์ผ์˜ ์œ ์ €๊ฐ€ ์žˆ๋Š”์ง€๋ฅผ ๊ฒ€์ฆํ•˜๋„๋ก ํ•˜๋Š”๊ฒŒ ์–ด๋–จ๊นŒ์š”?

Copy link
Member

@onpyeong onpyeong left a comment

Choose a reason for hiding this comment

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

์Šคํ”„๋ง ์‹œํ๋ฆฌํ‹ฐ role ์ ์šฉํ•˜๋‹ค๋‹ˆ ๊ตฟ๊ตฟ!๐Ÿ‘
๊ทผ๋ฐ ์–ธ์ œ ์‰ฝ๋‹ˆ๊นŒ....

@dong2ast dong2ast merged commit 37c673e into main Jul 27, 2023
1 check passed
@dong2ast dong2ast deleted the modify/#66-modify-authority branch July 27, 2023 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๊ฐœ๋ฐœ ์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ์„ ์ถ”๊ฐ€ ํ–ˆ์„ ๋•Œ
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[modify] authority๋ฅผ ์ด์šฉํ•ด ๊ถŒํ•œ ๋ถ„๋ฆฌ
2 participants