Repository navigation
[feat] auth-gateway를 없애고 Drive는 사용자 Google 클라이언트로 Google에 직접 연결한다 - #17
Merged
Merged
Conversation
…equire the user's own client (#16) Why: the gateway login protected no local feature (nothing local talks to the gateway, any Google account was allowed) yet forced a first-run login and no offline first start. Drive only needed the gateway to hold the desktop client secret. The app now sends code exchange and renewal to oauth2.googleapis.com/token itself and opens straight to the work screen. Galpi ships no Google OAuth client: GitHub push protection rejects the plain and the base64 form alike, a shipped secret ties every user to one project, and Google may revoke a published one. Users save their own client (ID + secret) in the settings sheet; README (both copies) and the sheet explain how to create one. Changes: remove AppAccessGate, GatewayAuthPort/GatewaySessionStore, the gateway adapter and session store, 4 IPC commands, 2 ports, the AUTH_REQUIRED/GATEWAY_* codes and the login screen, account chip and sign-out; DriveAuthPort exchange/refresh lose the bearer and take the required client; DriveTokenFailure drops AuthRequired (401 is now Unavailable); startup is bind -> subscribe -> loadWorkspace. Add DriveClient (validated, redacted Debug, no Serialize), Secret::DriveClientSecret, load/save/clear_drive_client commands (39 total, 16 ports), DRIVE_CLIENT_REQUIRED without a saved client, DRIVE_CLIENT_LOCKED while connecting or connected, a Picker callback guard that revokes tokens issued under a replaced client, a start-up drop of connections made with the old built-in client, and the settings sheet section with the setup entry shown instead of Connect while no client is saved. Docs: new ADR superseding 2026-10-09 and 2026-10-11, cautions for push protection and the native failure banner. Tested: cargo test --all-targets (346 passed), cargo clippy -D warnings, cargo fmt --check, bun run check, bun test (282 pass), gates G1-G23; live Google smoke with a client saved in the app (connect, upload, renewal, Picker import, disconnect, revoked-token check) and app-window checks (no login screen, setup entry without a client, save, locked while connected, kept across restart, delete), see .issueops/evidence/task-16-smoke.md. Not-tested: the start-up drop of an old built-in-client connection in a real window (none on the dev machine; covered by use case tests), a production- published user project, narrow-width layout, Windows.
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에 요청을 보내지 않도록 앱 로그인 게이트를 없앴습니다. Drive 코드 교환과 토큰 갱신은
oauth2.googleapis.com/token에 직접 보냅니다. Drive를 연결하려면 사용자가 설정 시트에 자기 Google OAuth 클라이언트를 저장해야 하고, 소스에는 클라이언트 ID와 보안 비밀번호가 없습니다.로그인 게이트는 로컬 기능을 보호하지 않았고, gateway가 Drive에 필요했던 이유는 보안 비밀번호를 보관하는 일뿐이었습니다. 그 값을 소스에 두려 했으나 GitHub push 보호가 평문과 base64를 모두 막았고, 한 프로젝트에 모든 사용자를 묶는 문제도 있어 사용자가 자기 클라이언트를 가져오게 했습니다.
Closes #16
변경 내용
AppAccessGate)와 gateway 포트·어댑터·세션 저장소, IPC 명령 4개,AUTH_REQUIRED·GATEWAY_*오류 코드, 로그인 화면·계정 칩·로그아웃. 앱은 세션 없이 작업 화면으로 바로 열립니다.invalid_grant만 연결을 지우고, 401과 5xx는DRIVE_UNAVAILABLE로 처리합니다.DriveClient(형식 검증,Debug에서 비밀번호 가림), 명령 3개(load_drive_client,save_drive_client,clear_drive_client), 비밀번호는 기존 비밀 저장소 흐름에Secret::DriveClientSecret으로 저장합니다. 보안 비밀번호는 IPC로 돌려주지 않습니다.DRIVE_CLIENT_REQUIRED로 멈추고, 설정 시트와 온보딩 카드는 연결 대신 클라이언트 설정으로 안내합니다.DRIVE_CLIENT_LOCKED로 거부합니다. refresh token은 발급한 클라이언트에서만 갱신되기 때문입니다. Picker 동의를 기다리는 사이 클라이언트가 바뀌면 새 토큰을 폐기합니다.Google Drive 사용 준비(클라이언트 만드는 방법), 설정 시트의만드는 방법, ADR(앞선 두 ADR을 대체)과 push 보호 caution을 추가했고, 명령 39개·포트 16개로 문서를 맞췄습니다.drive.file범위, Picker 흐름, ChatGPT 로그인, 워커.확인한 것
cargo test --all-targets346건,cargo clippy -D warnings,cargo fmt --check,bun run check,bun test282건이 통과했습니다. 클라이언트 저장 규칙, 잠금, Picker 중 클라이언트 변경, 클라이언트 없음, 옛 연결 해제는 전용 테스트로 고정했습니다.oauth2.googleapis.com/token으로 가는 것도 확인했습니다.저장됨, 연결된 동안의 잠금 안내, 재시작 뒤 유지, 클라이언트 삭제를 직접 눌러 확인했습니다. 단계별 시각과 결과는.issueops/evidence/task-16-smoke.md에 있습니다.리뷰 포인트
Galpi폴더가 생깁니다.drive.file범위가 클라이언트(프로젝트)별로 파일을 구분하기 때문이고, 설정 시트와 README에 이 점을 적었습니다.클라이언트 ID,보안 비밀번호)에 기대고 있습니다. Rust 테스트가 두 접두어를 고정하지만, 오류 코드를 칸별로 나누는 편이 나은지 의견을 받고 싶습니다.Galpi Desktop클라이언트는 이제 Galpi가 쓰지 않습니다. 삭제 여부는 소유자가 정합니다.