Actions
이슈 #439
진행중
JL
HP
[Go backport] Mobile SDK GoTrue 인증 전환 — Phase 6
이슈 #439:
[Go backport] Mobile SDK GoTrue 인증 전환 — Phase 6
시작일:
2026/05/18
완료일:
2026/05/18 (약 6달 지연)
진척도:
0%
추정시간:
설명
배경¶
서버 측 Phase 1–5 를 통해 GoTrue 기반 user_id 인증 과 AGX 회계가 완료되었으나, 모바일 SDK (alphea-rpc/sdk/, alphea-rpc/sdk/mobile/) 는 여전히 제거된 wallet challenge/Verify 흐름을 호출하고 있으며 현재 서버와 호환되지 않는다:
-
sdk.Authenticate(...)는AuthService.Challenge/Verify를 호출 (Phase 1에서 서버에서 제거됨) -
sdk.AuthenticateWithWallet(...)동일 -
tokenManager.refreshToken은 RegisterNode 을 ownerWalletAddress 필드 + Authorization 헤더 없이 호출 (Phase 1 이후 user JWT 필수) -
sdk/mobile/mobile.goAuthenticate 계열 함수들 동일
작업 범위¶
제거¶
-
sdk.Authenticate(ctx, AuthConfig)제거 -
sdk.AuthenticateWithWallet(ctx, WalletAuthConfig, Signer)제거 -
sdk.AuthConfig,sdk.WalletAuthConfig,sdk.Signer제거 -
sdk/mobile/mobile.go::Authenticate*,AuthenticateWithWallet제거
신규¶
-
sdk.AuthenticateWithGoTrueToken(ctx, GoTrueAuthConfig) -> (*AuthResult, error)- GoTrue user JWT + node 서명 keypair + device meta 을 받아 NodeService.NodeChallenge + RegisterNode 로 노드 토큰 획득
- GoTrue 토큰은 모바일 앱이 supabase-flutter/swift/js 등 공식 클라이언트로 미리 획득
sdk.GoTrueAuthConfig { ServerAddr, GoTrueToken, PrivateKey, DeviceID, Platform, Timezone }-
sdk.AuthResult안의WalletAddress는 node 서명 keypair address (소유자 wallet 아님) sdk/mobile/mobile.go::AuthenticateWithGoTrueToken(serverAddr, gotrueToken, privateKey, deviceID, platform, timezone) -> string (AuthResult JSON)
Token refresh¶
-
tokenManager.refreshToken은 RegisterNode 를 저장된 user JWT 를 Authorization 헤더에 실어 호출 - ownerWalletAddress 필드 대신 walletAddress (서명 키) 필드 사용
-
NodeAgent.UpdateUserJWT(token)메소드 추가 — 모바일 앱이 GoTrue 세션 갱신 시 호출
기타¶
-
NodeConfig에UserJWT string필드 추가. authTransport 에서 node access token 과 구분 -
sdk/api.go는 Phase 2/4 에서 이미 wallet_address 필드 제거되었음 — 추가 변경 없음 -
sdk/auth_test.go/sdk/call_test.go관련 테스트 정리
DoD¶
-
make build,make test통과 -
sdk.Authenticate/AuthenticateWithWallet단어 제거 -
sdk.AuthenticateWithGoTrueToken이 RegisterNode 경로로 노드 토큰 획득 - tokenManager 가 user JWT 을 포함해 RegisterNode 호출
- sdk/mobile 가 새 인증 API로 포팅됨 (gomobile 호환)
관련 이슈¶
- 이전 phase: #434(Phase 1, 해결), #435(Phase 2, 해결), #436(Phase 3, 해결), #437(Phase 4, 해결), #438(Phase 5, 해결)
- Mobile app 구현과 별개이며, Mobile 측에서는 supabase-flutter/swift 등 공식 클라이언트로 GoTrue 로그인 수행 후 SDK에 토큰 주입
Actions