프로젝트

일반

사용자정보

Actions

이슈 #411

진행중
JL JL

Supabase GoTrue 인증 전환 — wallet-based auth 제거 및 GoTrue JWT 통합

이슈 #411: Supabase GoTrue 인증 전환 — wallet-based auth 제거 및 GoTrue JWT 통합

James Lee이(가) 약 7시간 전에 추가함.

상태:
해결
우선순위:
보통
담당자:
목표버전:
시작일:
2026/04/24
완료일:
진척도:

0%

추정시간:

설명

개요

기존 wallet address 기반 secp256k1 challenge/verify 인증을 Supabase GoTrue(자체 호스팅)로 전환한다.

배경

  • 기존 구조에서는 wallet private key = 사용자 identity였음
  • 모바일 다중 디바이스 환경에서 private key 동기화 불가 → 근본적 문제
  • wallet address는 보상 수신 주소(reward destination)로만 사용되어야 하며, 특정 사용자에 종속되지 않아야 함

변경 범위

인증 레이어

  • GoTrue(supabase/gotrue) 서비스를 docker-compose에 추가 (port 9011)
  • JWT 검증을 표준 HMAC-SHA256으로 교체 (jsonwebtoken crate, GoTrue 호환)
  • AuthContext: user_id (GoTrue UUID) + email + token_type ("user" | "node")
  • Node 토큰은 별도 유지 (typ: "node", sub = node_id)

프로토 / AuthService

  • AuthService RPC를 GenerateKeypair 하나로 축소 (Challenge/Verify/Register 제거)
  • secp256k1 챌린지는 노드 등록(NodeService)에만 남김

DB 스키마 (migrations/0006_supabase_auth_schema.sql)

  • accounts 테이블 재설계: user_id UUID PK (GoTrue sub), email, display_name, profile_icon
  • wallets 테이블 신설: user_id → wallet_address (1:N, 보상 지갑 목록)
  • nodes.owner_user_id UUID 컬럼 추가 (노드 소유 사용자 추적)
  • 기존 wallet address 기반 계정 데이터 DROP

핸들러 변경

  • register_node: GoTrue JWT 필수, owner_user_id = JWT sub
  • heartbeat / delete_node: owner_user_id 기준 소유권 검증
  • get_user: wallet → wallets 테이블 join으로 조회
  • Admin HTTP 콘솔: challenge/verify 엔드포인트 제거, GoTrue JWT paste UI 추가

tools/client.py

  • Python gRPC 테스트 클라이언트에서 Auth Challenge/Verify 메뉴 제거

GoTrue 설정 (개발)

GOTRUE_JWT_SECRET: JWT_SECRET 환경변수와 동일값으로 설정
GOTRUE_MAILER_AUTOCONFIRM: true
GOTRUE_SITE_URL: http://localhost:3000

Sign-up: POST :9011/signup {"email":"…","password":"…"}
Login: POST :9011/token?grant_type=password {"email":"…","password":"…"}


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

다음 일감과 관련됨: 이슈 #420: Redeem Code 시스템 — 사용권 발급/리딤/관리 (QR 코드 기반)해결James Lee2026/04/282026/04/29

Actions
다음 일감과 관련됨: 이슈 #421: AGX 잔액을 Wallet 종속 → Account(GoTrue user_id) 종속으로 전환해결James Lee2026/04/27

Actions
다음 일감과 관련됨: 보고 #422: Examples 정리 — GoTrue 전환 후 broken 상태로 남은 auth_roundtrip / user_get해결James Lee2026/04/27

Actions
다음 일감과 관련됨: 이슈 #424: Dev Console 에 GoTrue Sign Up / Log In 통합 — 테스트 환경 간소화해결James Lee2026/04/27

Actions
다음 일감과 관련됨: 이슈 #419: Supabase Auth 적용, 앱 로그인 테스트신규Ryan Lee2026/04/272026/05/01

Actions
다음 일감과 관련됨: 이슈 #434: [Go backport] Supabase GoTrue 인증 전환 — Phase 1: 인프라 + 인증 코어해결Henry Park2026/05/11

Actions
Actions

내보내기 PDF Atom