Skip to content

Develop -> Main#169

Merged
Seol-JY merged 2 commits intomainfrom
develop
Feb 23, 2026
Merged

Develop -> Main#169
Seol-JY merged 2 commits intomainfrom
develop

Conversation

@Seol-JY
Copy link
Copy Markdown
Member

@Seol-JY Seol-JY commented Feb 23, 2026

Summary by CodeRabbit

새로운 기능

  • QR 코드 기반 웹 로그인 기능 추가
  • 웹 세션 생성, 승인, 상태 조회 API 엔드포인트 제공
  • Redis 기반 임시 세션 저장소 지원

구성

  • CORS 정책에 web.toduck.app 출처 추가
  • 웹 인증 엔드포인트 인증 필수 설정 추가

Seol-JY and others added 2 commits February 23, 2026 20:49
- QR 코드 기반 웹 로그인 세션 관리 (Redis)
- 웹용 Access Token 발급 (3일 만료)
- CORS에 web.toduck.app 도메인 추가
- 웹 로그인 인증 엔드포인트 보안 설정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Seol-JY Seol-JY merged commit f5ce561 into main Feb 23, 2026
2 of 3 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 23, 2026

Caution

Review failed

The pull request is closed.

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'auto_resolve_threads', 'spring_specific'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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
ℹ️ Recent review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e937654 and 88f892d.

📒 Files selected for processing (16)
  • build.gradle
  • src/main/java/im/toduck/domain/auth/domain/service/JwtService.java
  • src/main/java/im/toduck/domain/auth/domain/usecase/WebLoginUseCase.java
  • src/main/java/im/toduck/domain/auth/presentation/api/WebLoginApi.java
  • src/main/java/im/toduck/domain/auth/presentation/controller/WebLoginController.java
  • src/main/java/im/toduck/domain/auth/presentation/dto/request/WebLoginAuthorizeRequest.java
  • src/main/java/im/toduck/domain/auth/presentation/dto/response/WebSessionCreateResponse.java
  • src/main/java/im/toduck/domain/auth/presentation/dto/response/WebSessionStatusResponse.java
  • src/main/java/im/toduck/global/config/security/CorsConfig.java
  • src/main/java/im/toduck/global/config/security/SecurityConfig.java
  • src/main/java/im/toduck/global/security/jwt/access/AccessTokenProvider.java
  • src/main/java/im/toduck/infra/redis/weblogin/WebLoginSession.java
  • src/main/java/im/toduck/infra/redis/weblogin/WebLoginSessionRepository.java
  • src/main/java/im/toduck/infra/redis/weblogin/WebLoginSessionService.java
  • src/main/java/im/toduck/infra/redis/weblogin/WebLoginSessionServiceImpl.java
  • src/main/java/im/toduck/infra/redis/weblogin/WebLoginSessionStatus.java

Walkthrough

QR 코드 기반 웹 로그인 기능을 새로 추가합니다. Redis 세션 관리, JWT 웹 액세스 토큰 생성(3일 유효기간), REST API 엔드포인트, 보안 설정 업데이트 및 ZXing 라이브러리 의존성을 포함합니다.

Changes

코호트 / 파일 변경 요약
의존성 관리
build.gradle
ZXing 라이브러리 2개 추가 (core, javase 3.5.3)
JWT 토큰 생성
src/main/java/im/toduck/domain/auth/domain/service/JwtService.java, src/main/java/im/toduck/global/security/jwt/access/AccessTokenProvider.java
웹 액세스 토큰 생성 메서드 추가 (3일 유효기간), 커스텀 만료 시간을 지원하는 generateTokenWithCustomExpiry 메서드 추가
웹 로그인 핵심 로직
src/main/java/im/toduck/domain/auth/domain/usecase/WebLoginUseCase.java
세션 생성, 승인, 상태 폴링 및 QR 코드 생성 로직을 포함하는 웹 로그인 유스케이스 구현
Redis 세션 관리
src/main/java/im/toduck/infra/redis/weblogin/WebLoginSession.java, src/main/java/im/toduck/infra/redis/weblogin/WebLoginSessionRepository.java, src/main/java/im/toduck/infra/redis/weblogin/WebLoginSessionService.java, src/main/java/im/toduck/infra/redis/weblogin/WebLoginSessionServiceImpl.java, src/main/java/im/toduck/infra/redis/weblogin/WebLoginSessionStatus.java
Redis 기반 세션 저장소, 저장소 인터페이스 및 구현, 상태 enum 추가
REST API 계층
src/main/java/im/toduck/domain/auth/presentation/api/WebLoginApi.java, src/main/java/im/toduck/domain/auth/presentation/controller/WebLoginController.java
웹 로그인 API 인터페이스 및 컨트롤러 구현 (/v1/auth/web 엔드포인트)
요청/응답 DTO
src/main/java/im/toduck/domain/auth/presentation/dto/request/WebLoginAuthorizeRequest.java, src/main/java/im/toduck/domain/auth/presentation/dto/response/WebSessionCreateResponse.java, src/main/java/im/toduck/domain/auth/presentation/dto/response/WebSessionStatusResponse.java
세션 생성 및 승인 요청/응답 객체, 세션 상태 응답 객체 추가
보안 설정
src/main/java/im/toduck/global/config/security/CorsConfig.java, src/main/java/im/toduck/global/config/security/SecurityConfig.java
CORS 허용 원본에 https://web.toduck.app 추가, /v1/auth/web/authorize 엔드포인트 인증 필수 설정

Sequence Diagram(s)

sequenceDiagram
    participant 클라이언트 as 클라이언트<br/>(웹)
    participant API as WebLoginController<br/>/v1/auth/web
    participant UseCase as WebLoginUseCase
    participant Redis as Redis<br/>세션저장소
    participant JWT as JwtService
    
    rect rgba(100, 200, 150, 0.5)
    Note over 클라이언트,JWT: 1. 세션 생성 및 QR 코드 생성
    클라이언트->>API: POST /sessions (익명)
    API->>UseCase: createWebSession()
    UseCase->>Redis: createSession()
    Redis-->>UseCase: sessionToken 반환
    UseCase->>UseCase: generateQrCode(sessionToken)
    UseCase-->>API: WebSessionCreateResponse<br/>(sessionToken, qrImageBase64)
    API-->>클라이언트: ApiResponse with QR코드
    end
    
    rect rgba(100, 150, 200, 0.5)
    Note over 클라이언트,JWT: 2. 세션 승인 (모바일에서)
    클라이언트->>API: POST /authorize (인증됨)<br/>WebLoginAuthorizeRequest
    API->>UseCase: authorizeWebSession(userId, role, request)
    UseCase->>Redis: findBySessionToken()
    Redis-->>UseCase: WebLoginSession
    UseCase->>UseCase: approve(userId, role)
    UseCase->>Redis: save(session)
    UseCase-->>API: true
    API-->>클라이언트: ApiResponse(true)
    end
    
    rect rgba(200, 150, 100, 0.5)
    Note over 클라이언트,JWT: 3. 상태 폴링 및 토큰 발급
    클라이언트->>API: GET /sessions/{sessionToken} (익명)
    API->>UseCase: getWebSessionStatus(sessionToken)
    UseCase->>Redis: findBySessionToken()
    Redis-->>UseCase: WebLoginSession (APPROVED)
    UseCase->>JWT: createWebAccessToken(userId, role)
    JWT-->>UseCase: accessToken (3일 유효)
    UseCase->>Redis: deleteSession(sessionToken)
    UseCase-->>API: WebSessionStatusResponse<br/>(APPROVED, accessToken, userId)
    API-->>클라이언트: ApiResponse with accessToken
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45분

Possibly related PRs

Suggested labels

✨ Feature

Suggested reviewers

  • kang20
  • Junad-Park
  • jungbk0808

Poem

🐰 세션을 Redis에 담고,
QR 코드가 반짝 빛나네!
웹 로그인, 이제 더 쉬워,
토끼도 춤을 추며 노네~ 🎉

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

📝 Jacoco Test Coverage

Overall Project 49.78% -1.51% 🍏
Files changed 6.07%

File Coverage
CorsConfig.java 100% 🍏
SecurityConfig.java 100% 🍏
JwtService.java 80.69% -4.46%
WebLoginSessionServiceImpl.java 22% -78%
AccessTokenProvider.java 10.85% -20.16%
WebLoginController.java 10.34% -89.66%
WebLoginUseCase.java 7.6% -92.4%
WebLoginSession.java 0%
WebLoginSessionStatus.java 0%
WebLoginAuthorizeRequest.java 0%
WebSessionStatusResponse.java 0%
WebSessionCreateResponse.java 0%

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