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

🩹 토큰 헀더 μ»΄ν¬λ„ŒνŠΈ μΆ”κ°€ #24

Merged
merged 1 commit into from
Oct 9, 2024

Conversation

waterfogSW
Copy link
Member

@waterfogSW waterfogSW commented Oct 9, 2024

Summary by CodeRabbit

  • μƒˆλ‘œμš΄ κΈ°λŠ₯

    • API에 Bearer 토큰 인증을 μœ„ν•œ μƒˆλ‘œμš΄ AuthorizationHeader 헀더 λ§€κ°œλ³€μˆ˜κ°€ μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
    • /users/my μ—”λ“œν¬μΈνŠΈμ˜ get μž‘μ—…μ΄ μ—…λ°μ΄νŠΈλ˜μ–΄, μ‚¬μš©μž ν”„λ‘œν•„ 정보 μ ‘κ·Ό μ‹œ 인증 토큰이 ν•„μš”ν•˜κ²Œ λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
  • λ³΄μ•ˆ κ°•ν™”

    • μ‚¬μš©μž κ΄€λ ¨ μž‘μ—…μ— λŒ€ν•œ API의 λ³΄μ•ˆ λͺ¨λΈμ΄ ν–₯μƒλ˜μ—ˆμŠ΅λ‹ˆλ‹€.

Copy link

coderabbitai bot commented Oct 9, 2024

Walkthrough

이 λ³€κ²½ 사항은 3days API의 OpenAPI 사양에 μ—¬λŸ¬ 가지 μˆ˜μ •μ„ λ„μž…ν•©λ‹ˆλ‹€. μ£Όμš” λ³€κ²½ μ‚¬ν•­μœΌλ‘œλŠ” JWT ν˜•μ‹μ˜ Bearer 토큰 인증을 μœ„ν•œ μƒˆλ‘œμš΄ 헀더 λ§€κ°œλ³€μˆ˜ AuthorizationHeader의 좔가와 /users/my 경둜의 μˆ˜μ •μ΄ ν¬ν•¨λ©λ‹ˆλ‹€. 이 변경은 νŠΉμ • μ—”λ“œν¬μΈνŠΈμ— λŒ€ν•œ 토큰 기반 인증을 κ°•μ œν•˜μ—¬ API의 λ³΄μ•ˆ λͺ¨λΈμ„ κ°•ν™”ν•©λ‹ˆλ‹€.

Changes

파일 λ³€κ²½ μš”μ•½
openapi.yaml - components/parameters에 AuthorizationHeader μΆ”κ°€ (ν•„μˆ˜ 헀더, JWT ν˜•μ‹)
- /users/my 경둜의 get μž‘μ—…μ— AuthorizationHeader λ§€κ°œλ³€μˆ˜ 포함

Possibly related PRs

  • ✨ λ‚˜μ΄λŠ” 상관 μ—†μ–΄μš” 반영 #17: 이 PR의 λ³€κ²½ 사항은 μ‚¬μš©μž 인증과 κ΄€λ ¨λœ μƒˆλ‘œμš΄ λ§€κ°œλ³€μˆ˜ 및 μ—”λ“œν¬μΈνŠΈ μΆ”κ°€λ₯Ό ν¬ν•¨ν•˜κ³  μžˆμ–΄, μ£Όμš” PR의 μ „λ°˜μ μΈ λ³΄μ•ˆ 강화와 관련이 μžˆμ„ 수 μžˆμŠ΅λ‹ˆλ‹€.

Suggested reviewers

  • dojinyou
  • moondev03
  • jisu15-kim

πŸ‡ μƒˆλ‘œμš΄ 헀더가 생겼넀,
인증이 더 κ°•ν•΄μ‘Œλ„€!
μ‚¬μš©μž 정보 λ³΄ν˜Έν•˜μž,
ν† ν°μœΌλ‘œ μ•ˆμ „ν•˜κ²Œ κ°€μž!
API의 길을 λ°ν˜€μ£ΌλŠ”,
Rabbit의 기쁨을 λ…Έλž˜ν•˜λ„€! 🎢


πŸ“œ Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

πŸ“₯ Commits

Files that changed from the base of the PR and between 6676694 and 8de8358.

πŸ“’ Files selected for processing (1)
  • openapi.yaml (2 hunks)
🧰 Additional context used
πŸ”‡ Additional comments (3)
openapi.yaml (3)

274-282: 인증 헀더 λ§€κ°œλ³€μˆ˜ μΆ”κ°€ 승인

JWT ν˜•μ‹μ˜ Bearer 토큰을 μ‚¬μš©ν•˜λŠ” AuthorizationHeader λ§€κ°œλ³€μˆ˜μ˜ μΆ”κ°€λŠ” API의 λ³΄μ•ˆμ„ κ°•ν™”ν•˜λŠ” 쒋은 λ°©λ²•μž…λ‹ˆλ‹€. μ΄λŠ” 토큰 기반 인증을 적절히 κ΅¬ν˜„ν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.


145-146: μ‚¬μš©μž ν”„λ‘œν•„ μ—”λ“œν¬μΈνŠΈμ— 인증 μš”κ΅¬μ‚¬ν•­ μΆ”κ°€ 승인

/users/my μ—”λ“œν¬μΈνŠΈμ— AuthorizationHeader λ§€κ°œλ³€μˆ˜λ₯Ό μΆ”κ°€ν•œ 것은 μ μ ˆν•©λ‹ˆλ‹€. μ΄λŠ” μ‚¬μš©μž ν”„λ‘œν•„ 정보에 λŒ€ν•œ 접근을 인증된 μš”μ²­μœΌλ‘œ μ œν•œν•˜μ—¬ λ³΄μ•ˆμ„ κ°•ν™”ν•©λ‹ˆλ‹€.


145-146: πŸ› οΈ Refactor suggestion

인증 λ©”μ»€λ‹ˆμ¦˜μ˜ 일관성 κ²€ν†  μ œμ•ˆ

  1. BearerAuth λ³΄μ•ˆ μŠ€ν‚€λ§ˆμ™€ AuthorizationHeader λ§€κ°œλ³€μˆ˜κ°€ λͺ¨λ‘ μ •μ˜λ˜μ–΄ μžˆμŠ΅λ‹ˆλ‹€. 이 쀑 ν•˜λ‚˜λ§Œ μ‚¬μš©ν•˜λŠ” 것이 쒋을 수 μžˆμŠ΅λ‹ˆλ‹€. BearerAuthλ₯Ό μ‚¬μš©ν•˜λ©΄ OpenAPI 툴과의 ν˜Έν™˜μ„±μ΄ 더 쒋을 수 μžˆμŠ΅λ‹ˆλ‹€.

  2. λ‹€λ₯Έ μ—”λ“œν¬μΈνŠΈλ“€λ„ 인증이 ν•„μš”ν•œμ§€ κ²€ν† ν•˜κ³ , ν•„μš”ν•˜λ‹€λ©΄ μΌκ΄€λ˜κ²Œ μ μš©ν•˜λŠ” 것이 μ’‹μŠ΅λ‹ˆλ‹€.

λ‹€μŒ 슀크립트λ₯Ό μ‹€ν–‰ν•˜μ—¬ 인증이 ν•„μš”ν•  수 μžˆλŠ” λ‹€λ₯Έ μ—”λ“œν¬μΈνŠΈλ₯Ό 확인해 λ³΄μ„Έμš”:

Also applies to: 274-282


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❀️ Share
πŸͺ§ Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@waterfogSW
Copy link
Member Author

별닀λ₯Έ μ΄μŠˆμ—†μœΌλ©΄ λ¨Έμ§€ν•˜κ² μŠ΅λ‹ˆλ‹€.

@waterfogSW waterfogSW merged commit f421888 into main Oct 9, 2024
3 checks passed
@waterfogSW waterfogSW deleted the fix/authorization-header branch October 9, 2024 09:39
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.

1 participant