Repository navigation
[feat] auth-gateway Google 로그인이 있어야 Galpi를 사용하도록 변경 - #11
Merged
Merged
Conversation
Why: galpi#10 requires a Google sign-in through auth-gateway before the app can be used. Sign-in follows RFC 8252 (system browser, loopback redirect, PKCE) against the gateway's /auth/native endpoints; any signed-in Google account is allowed, a stored session keeps the app usable offline, and only a 400 invalid_grant from the gateway or a sign-out discards it. Lore: - Intent: Gate every feature behind an auth-gateway session, enforced by the host. - Changes: - Move the browser opener, loopback listener, and PKCE out of chatgpt/ into adapters/outbound/browser_sign_in/; callers pass SignInCodes, so ChatGPT keeps its error codes. - Add domain/gateway.rs, GatewayAuthPort/GatewaySessionStore, application/gateway.rs AppAccessGate, and AUTH_REQUIRED on prepare, refine_transcript, transcribe, import_transcript, start_recording. - Add GatewayOAuthAdapter, Secret::GatewaySession with settings/gateway.rs, four Tauri commands, and composition wiring. - Add the login screen in front of the inert shell, the account chip with sign-out, access-machine, access-controller, and the strict Zod AppAccess schema. - Update README (ko/en), DESIGN.md, AGENTS.md files, ARCHITECTURE.md, OPEN_API_SPEC.md, and overviews to 28 commands and 15 ports. - Tested: cargo fmt --check; cargo clippy --all-targets -D warnings; cargo test --all-targets (224 passed); bun run check; bun test (201 pass); python3 scripts/verify-docs-platform.py; issueops gates check (11/11) - Not-tested: real sign-in against a running auth-gateway (needs Supabase/Redis credentials; deferred until auth-gateway#8 is deployed); Windows Credential Manager entry on real Windows hardware. - Risk: The first launch after updating needs an online Google sign-in. macOS keeps the gateway refresh token in the 0600 settings file until the app is signed.
Why: The auth-gateway sign-in gate is a structural decision, and implementing it surfaced two pitfalls worth keeping: adding a stored credential needs every LocalSettingsStore match arm plus is_empty, and the runtime-unavailable message now lives on the login screen, so plain-browser QA mocks the Tauri IPC. Lore: - Intent: Keep the decision and pitfalls from galpi#10 in the project docs. - Changes: - Add an ADR for requiring the auth-gateway Google sign-in and host-side AUTH_REQUIRED. - Add a caution for new stored credentials in LocalSettingsStore. - Add a caution for the login-screen runtime failure and IPC-mocked browser QA. - Tested: python3 scripts/verify-docs-platform.py (PLATFORM_DOCS_OK) - Risk: Low; documentation only.
Why: The IssueOps cycle for galpi#10 keeps its plan, intent, plan review, gate ledger, and verification report next to the change they describe. Lore: - Intent: Track the cycle materials for io-21fd3b1e1f06. - Changes: - Add plan.md, intent.md, plan-review.md, gates.md (11/11 met), and report.md under .issueops/issues/10/. - Tested: issueops gates check (11/11 met) - Risk: Low; records only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
이제 Galpi는 auth-gateway를 거쳐 Google 계정으로 로그인해야 기능을 쓸 수 있습니다. 로그인은 시스템 브라우저와
127.0.0.1루프백 주소, PKCE로 진행하며, 저장된 로그인이 있으면 auth-gateway에 닿지 못해도 계속 쓸 수 있습니다. auth-gateway가 세션을 거부(invalid_grant)하거나 사용자가 로그아웃할 때만 다시 로그인을 요구합니다.Closes #10
변경 내용
AUTH_REQUIRED로 거부합니다. 녹음 정지·작업 취소·설정 저장·진단은 막지 않습니다.400 invalid_grant면 세션을 지우며, 연결 실패·5xx·429 같은 나머지 실패에서는 저장된 세션으로 앱을 엽니다.com.m16khb.galpi:gateway-session항목을, macOS는0600권한의settings.json을 씁니다. 이메일만settings.json에 따로 저장하며, 창으로는 로그인 상태와 이메일만 넘어갑니다.inert라 클릭과 키보드 이동이 닿지 않습니다. 로그인 뒤 상단에 계정 표시(온라인또는오프라인 · 저장된 로그인 사용)와로그아웃버튼이 나타납니다.adapters/outbound/browser_sign_in/로 옮겨 두 로그인이 함께 씁니다. ChatGPT의 오류 코드와 동작은 그대로입니다.load_app_access,sign_in_to_gateway,cancel_gateway_sign_in,sign_out_of_gateway). 기존 명령의 인자와 응답은 바뀌지 않았습니다.확인한 것
AUTH_REQUIRED가 되는지, 갱신 성공·거부·연결 실패의 세 갈래, 로그인 중 두 번째 시도 거부, 로그인 중 로그아웃, 저장 세션이 있는 상태의 로그인 취소(세션 유지)를 확인했습니다(cargo test --all-targets gateway, 24개 성공)./me실패 시 이메일 없음, 다른 시도의 응답 거부, 갱신 응답 분류를 확인했습니다.400 invalid_grant만 세션을 지우고400 invalid_request·빈 400·401·429·503·형식 오류·연결 거부는 세션을 유지합니다.cargo fmt --check와cargo clippy -D warnings도 경고 없이 끝났습니다.bun run check와bun test(201개 성공)로 확인했습니다. 상태 기계 전이, 로그인 버튼 노출 규칙, 브라우저 대기 중 두 번째 로그인 호출이 0회인지, 런타임 연결 실패 시 재시작 안내만 보이는지, 토큰 필드가 섞인 응답을 Zod가 거부하는지가 테스트에 들어 있습니다.Content-Type, 오류 형태가 맞는지 확인했습니다.확인하지 못한 것:
리뷰 포인트
400 invalid_grant만 세션을 지우고, 401·403을 포함한 나머지는 모두 오프라인 사용으로 처리합니다.