프로젝트

일반

사용자정보

Actions

보고 #422

진행중
JL JL

Examples 정리 — GoTrue 전환 후 broken 상태로 남은 auth_roundtrip / user_get

보고 #422: Examples 정리 — GoTrue 전환 후 broken 상태로 남은 auth_roundtrip / user_get

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

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

0%

추정시간:

설명

문제

GoTrue 인증 전환(#411) 시 AuthService.Challenge / AuthService.Verify RPC 가 proto 에서 제거됐지만, 두 example 이 정리되지 않고 broken 상태로 남았다. cargo build --all-targets / cargo build --examples 가 아래와 같이 실패한다:

error[E0599]: no method named `verify` found for struct `AuthServiceClient<T>`
  --> examples/auth_roundtrip.rs:59:10
error[E0599]: no method named `verify` found for struct `AuthServiceClient<T>`
  --> examples/user_get.rs:54:10

영향 받는 파일

  • examples/auth_roundtrip.rs — AuthService.Challenge → 서명 → AuthService.Verify 라운드트립 테스트. 목적 자체가 사라짐 (wallet-based 인증 제거됨). secp256k1 challenge 흐름은 이제 NodeService 에만 남아있고 examples/node_register.rs 에서 이미 커버됨.
  • examples/user_get.rs — UserService.GetUser 테스트. setup 단계에서 AuthService.Verify 로 account 를 만들었지만 그 RPC 가 사라짐. UserService.GetUser 자체는 public RPC 로 여전히 동작하므로 setup 만 다른 방식으로 바꾸면 됨.

해결 방안

  1. auth_roundtrip.rs 삭제 — 검증 대상이 사라졌고, 남은 AuthService.GenerateKeypair 는 이미 domain::auth::crypto unit test 에서 커버됨.
  2. user_get.rs 재작성 — sqlx 로 accounts + wallets row 를 직접 시드한 뒤 public UserService.GetUser 호출 → 응답 검증. JWT / GoTrue 의존 없이 self-contained 하게 유지.

의존

  • 원인: #411 (GoTrue 전환)

비고

examples/wallet_earnings.rs 는 #421 Phase 0 (account-scope 전환) 시 이미 stub 으로 정리되었다. examples/node_*.rs 는 컴파일은 되지만 런타임에서는 GoTrue user JWT 없이 RegisterNode 호출이 Unauthenticated 로 실패할 가능성이 있어 추후 별도로 검토 필요 (본 이슈 범위 외).


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

다음 일감과 관련됨: 이슈 #411: Supabase GoTrue 인증 전환 — wallet-based auth 제거 및 GoTrue JWT 통합해결James Lee2026/04/24

Actions

JL James Lee이(가) 6달 전에 변경 Actions #1

  • 다음 일감과 관련됨:에 이슈 #411: Supabase GoTrue 인증 전환 — wallet-based auth 제거 및 GoTrue JWT 통합이(가) 추가되었습니다.

JL James Lee이(가) 6달 전에 변경 Actions #2

  • 상태을(를) 신규에서 해결(으)로 변경되었습니다.

구현 완료

commit:server|9d32fe4

처리 내역

examples/auth_roundtrip.rs — 삭제

  • 검증 대상이던 AuthService.Challenge → 서명 → AuthService.Verify 라운드트립 자체가 GoTrue 전환(#411)으로 사라짐.
  • secp256k1 challenge 흐름은 NodeService 에만 남았고, examples/node_register.rs 가 이미 동일한 secp256k1 sign + RegisterNode round-trip 을 커버.
  • 남은 AuthService.GenerateKeypair 는 domain::auth::crypto unit test 에서 검증됨.
  • → 검증해야 할 새로운 동작이 없으므로 example 자체를 폐기.

examples/user_get.rs — 재작성

  • 기존: AuthService.Verify 로 account 생성 → GetUser 검증
  • 변경: sqlx 로 accounts + wallets row 를 직접 시드 → GetUser 검증
  • UserService.GetUser 자체는 public RPC 라 JWT 불필요. GoTrue 서버를 띄우지 않고도 self-contained 하게 작동.
  • 시나리오는 동일하게 유지: happy path (grade="clay", friend_count=0) / 알 수 없는 wallet → NOT_FOUND / 빈 wallet → INVALID_ARGUMENT.

Before / After

$ cargo build --examples            # before: E0599 (verify method missing)
$ cargo clippy --all-targets        # before: 실패

$ cargo build --examples            # after: ok
$ cargo clippy --all-targets        # after: ok (warnings 없음)
$ cargo test --lib                  # 37 passed

비고 (본 이슈 범위 외)

  • examples/wallet_earnings.rs 는 #421 Phase 0 시 stub 으로 정리됨.
  • examples/node_*.rs 는 컴파일은 통과하지만 런타임에서는 GoTrue user JWT 없이 RegisterNode 호출이 Unauthenticated 로 실패할 가능성. node 등록 흐름 자체를 GoTrue 토큰을 첨부하도록 업데이트하는 것은 별도 이슈로 추적해야 함 (실 GoTrue 인스턴스 또는 헬퍼가 필요).
Actions

내보내기 PDF Atom