Actions
보고 #422
진행중
JL
JL
Examples 정리 — GoTrue 전환 후 broken 상태로 남은 auth_roundtrip / user_get
보고 #422:
Examples 정리 — GoTrue 전환 후 broken 상태로 남은 auth_roundtrip / user_get
설명
문제¶
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 만 다른 방식으로 바꾸면 됨.
해결 방안¶
-
auth_roundtrip.rs삭제 — 검증 대상이 사라졌고, 남은AuthService.GenerateKeypair는 이미domain::auth::cryptounit test 에서 커버됨. -
user_get.rs재작성 — sqlx 로accounts+walletsrow 를 직접 시드한 뒤 publicUserService.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 로 실패할 가능성이 있어 추후 별도로 검토 필요 (본 이슈 범위 외).
JL James Lee이(가) 6달 전에 변경
- 상태을(를) 신규에서 해결(으)로 변경되었습니다.
구현 완료¶
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::cryptounit test 에서 검증됨. - → 검증해야 할 새로운 동작이 없으므로 example 자체를 폐기.
examples/user_get.rs — 재작성
- 기존:
AuthService.Verify로 account 생성 →GetUser검증 - 변경:
sqlx로accounts+walletsrow 를 직접 시드 →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