프로젝트

일반

사용자정보

Actions

이슈 #439

진행중
JL HP

[Go backport] Mobile SDK GoTrue 인증 전환 — Phase 6

이슈 #439: [Go backport] Mobile SDK GoTrue 인증 전환 — Phase 6

James Lee이(가) 약 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.go Authenticate 계열 함수들 동일

작업 범위

제거

  • 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에 토큰 주입

연결된 일감 1 (한 건 진행 중 — 모두 미완료)

다음 일감을 우선 진행: 이슈 #438: [Go backport] Legacy wallet_address 컬럼 제거 — Phase 5 (final cleanup)해결Henry Park2026/05/152026/05/15

Actions
Actions

내보내기 PDF Atom