Skip to content

[Feat/save refresh token at test login] - 테스트 로그인 시 리프레시 저장#88

Merged
ekgns33 merged 2 commits intomainfrom
feat/save-refresh-token-at-test-login
May 10, 2025
Merged

[Feat/save refresh token at test login] - 테스트 로그인 시 리프레시 저장#88
ekgns33 merged 2 commits intomainfrom
feat/save-refresh-token-at-test-login

Conversation

@ekgns33
Copy link
Copy Markdown
Contributor

@ekgns33 ekgns33 commented May 10, 2025

작업내역

  • 리프레쉬 토큰을 저장하는 로직이 빠져있어 수정했습니다. 테스트 전용 로그인 시 Refresh 토큰 미저장으로 오류 #86
  • 현재 카카오, 애플로그인을 각각의 구현체로 만들어서 사용중인데요, 추상화없이 구체 클래스로만 구현하여
    새로운 구현체를 만들때 일련의 로직이 빠지는 휴먼에러가 발생하는 것 같습니다.
  • 리팩토링 단계에서 해결해보겠습니당

Summary by CodeRabbit

  • Tests
    • Added a new test to verify successful token refresh after login, ensuring that access and refresh tokens are correctly issued and persisted.

@ekgns33 ekgns33 self-assigned this May 10, 2025
@ekgns33 ekgns33 added the bug Something isn't working label May 10, 2025
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2025

Walkthrough

A dependency on TokenRefreshService was added to the TestAuthService class, modifying the login process to persist the refresh token upon user login. Additionally, a new integration test was introduced to verify the refresh token flow, ensuring that a refresh token can be used to obtain new tokens after login.

Changes

File(s) Change Summary
src/main/java/org/runimo/runimo/auth/test/TestAuthService.java Added TokenRefreshService dependency; updated login to save refresh token via service before responding.
src/test/java/org/runimo/runimo/auth/controller/TokenRefreshAcceptanceTest.java Added integration test for login and refresh token flow; changed test class package.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant TestAuthService
    participant TokenRefreshService

    Client->>TestAuthService: login(userId)
    TestAuthService->>TestAuthService: generate token pair
    TestAuthService->>TokenRefreshService: putRefreshToken(userPublicId, refreshToken)
    TokenRefreshService-->>TestAuthService: (ack)
    TestAuthService-->>Client: TestAuthResponse(token pair)
Loading
sequenceDiagram
    participant Client
    participant API
    participant TestAuthService
    participant TokenRefreshService

    Client->>API: POST /api/v1/auth/test/login (userId)
    API->>TestAuthService: login(userId)
    TestAuthService->>TokenRefreshService: putRefreshToken
    TestAuthService-->>API: TestAuthResponse(token pair)
    API-->>Client: { access_token, refresh_token }

    Client->>API: POST /api/v1/auth/refresh (Authorization: refresh_token)
    API->>TokenRefreshService: validate refresh_token
    TokenRefreshService-->>API: (valid)
    API-->>Client: { new access_token, new refresh_token }
Loading

Poem

In the meadow of tokens, a refresh now blooms,
With every login, persistence resumes.
Tests hop along, checking the flow,
Ensuring fresh carrots wherever we go!
🥕✨

— A rabbit who loves secure logins

Tip

⚡️ Faster reviews with caching
  • CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.

Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Free

📥 Commits

Reviewing files that changed from the base of the PR and between 00b896c and 27d5582.

📒 Files selected for processing (2)
  • src/main/java/org/runimo/runimo/auth/test/TestAuthService.java (2 hunks)
  • src/test/java/org/runimo/runimo/auth/controller/TokenRefreshAcceptanceTest.java (3 hunks)

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 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.

Support

Need help? Join our Discord community for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this 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.

@ekgns33 ekgns33 merged commit 77f8ba6 into main May 10, 2025
3 checks passed
@ekgns33 ekgns33 deleted the feat/save-refresh-token-at-test-login branch May 10, 2025 03:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 🚀 feature 🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant