Skip to content

Integrations

wcorn edited this page Jul 24, 2026 · 3 revisions

연동 (Integrations — Google 연결)

모듈 횡단 공통 기능. Google OAuth 연결 그 자체(연결/상태/해제/콜백)는 특정 모듈 소유가 아니라 캘린더 · 루틴 · 복습→캘린더 미러가 함께 쓰는 공용 자원이다. 그래서 /planner 밖 공용 네임스페이스로 분리한다.

상태: ✅ 이전 완료 (#962, Epic #963). 연결 API는 /api/integrations/google/*, FE 연동 설정 라우트는 /integrations. (구 /api/planner/google/* · /planner/settings 폐기)

1. 무엇이 공용인가

연결 그 자체 (공용 네임스페이스 /api/integrations/google/*):

기능 경로
인증 URL 발급 GET /api/integrations/google/oauth/url
OAuth 콜백 GET /api/integrations/google/oauth/callback (permitAll)
연결 상태 GET /api/integrations/google/status
연결 해제 POST /api/integrations/google/disconnect

플래너 기능(공용 아님 — /api/planner/* 유지): 캘린더 피드 /planner/calendar, 이벤트 /planner/calendar/events, 할일 /planner/tasks, 루틴 /planner/routines.

경계 사례 — 복습 미러 토글 PUT /api/planner/reviews/mirror: Google 연결에 의존하지만 복습 도메인 동작이라 복습 아래 유지(결정). 연동 페이지에는 "이 연결을 쓰는 기능"으로만 안내.

2. 연결을 공유하는 기능들

기능 연결 사용처
캘린더 일정(Calendar)·할일(Tasks) 읽기/쓰기
루틴 Google 반복 이벤트(RRULE) 생성·편집
복습→캘린더 미러 보조 "orino 복습" 캘린더에 단방향 push (Review-Calendar-Mirror)

스코프: auth/calendar + auth/tasks (재동의 불필요, 보조 캘린더 생성 가능).

3. UI · 라우트 (확정)

  • 좌측 사이드바에 「연동 설정」 항목(플래너와 별개 상위 항목) → /integrations.
  • 연동 설정 페이지 라우트: /integrations (구 /planner/settings 폐기). FE 네임스페이스를 BE(/api/integrations/google/*)와 1:1로 맞춘다. 페이지 컴포넌트는 pages/integrations/IntegrationsPage.
  • OAuth 복귀: BE 콜백이 브라우저를 /integrations?google=connected|error 로 302 리다이렉트 → 이 페이지가 쿼리를 읽어 토스트 + 연결 상태 갱신. 기존 /planner 콜백 shim(PlannerCallbackRedirect)은 폐기.
  • 화면 요소: Google 연결/해제 카드, 연결 상태, 복습 미러 토글. 상세는 Planner UI.

주의: Google Cloud Console에 등록하는 redirect URI는 BE 콜백(…/api/integrations/google/oauth/callback)이다. FE /integrations 복귀는 내부 이동이라 Console 등록 대상이 아니다.

4. 마이그레이션 기록 (#962, 완료)

연결 네임스페이스를 바꾸며 함께 손본 지점:

  • BE: GoogleOAuthController @RequestMapping /api/integrations/google · SecurityConfig permitAll 콜백 매처 · GoogleOAuthService.redirect() FE 복귀 경로 /integrations · application.yml redirect-uri (설정 prefix planner.google.*는 내부 바인딩이라 유지)
  • Infra/운영: infra/helm/be/values.yaml의 GOOGLE_REDIRECT_URI · be/.env.example · Google Cloud Console 등록 redirect URI(구/신 동시 등록 → 배포 → 구 제거)
  • FE: features/google/api/googleApi.ts 경로 문자열 · 콜백 shim(/planner, PlannerCallbackRedirect) 폐기 → IntegrationsPage가 /integrations?google= 직접 처리 · 연동 설정 라우트/사이드바 · MSW handlers.ts 목

복습 미러 토글(/planner/reviews/mirror)은 복습 도메인이라 이전 대상에서 제외(유지).

5. 관련 문서

플래너 모듈 개요 · Planner API · 복습→캘린더 미러 · 보안 위협 모델

Clone this wiki locally