이슈 #602
진행중[요청] @alphea/connect 웹 SDK 에 ProfileService 노출 요청 (displayName·avatarUrl — 서버·모바일SDK 는 이미 제공 중)
0%
설명
Hub 웹 홈화면에 사용자 이름·프로필 이미지·보유 포인트를 로그인한 계정의 실제 값으로 표시하려 합니다. 확인해 보니 서버 API 는 이미 전부 존재하고 배포까지 되어 있으며, 모바일 SDK 는 이를 이미 노출하고 있습니다. 웹 SDK @alphea/connect 만 ProfileService 를 노출하지 않아 웹에서 이름·프로필 이미지를 가져올 방법이 없습니다.
서버 API 추가 요청이 아니라, 웹 SDK 에 이미 있는 서버 API 를 노출해 달라는 요청입니다.
현황 정리¶
| 항목 | 서버 (edge) | 모바일 SDK | 웹 SDK @alphea/connect
|
Hub Web |
|---|---|---|---|---|
사용자 이름 (displayName) |
있음 · 라이브 | 노출 중 | 없음 | 하드코딩 |
프로필 이미지 (avatarUrl) |
있음 · 라이브 | 노출 중 | 없음 | 고정 SVG |
| 보유 포인트 | 있음 · 라이브 | 노출 중 | 있음 | 하드코딩 |
즉 막혀 있는 것은 이름과 프로필 이미지 두 가지이고, 포인트는 웹 SDK 에 이미 있어 Hub Web 쪽 연동만 하면 됩니다.
서버 확인 — ProfileService 는 이미 배포되어 살아 있습니다¶
alphea-edge-core/alphea-rpc/proto/alphea/connect/v1/profile.proto
service ProfileService {
rpc GetProfile(GetProfileRequest) returns (Profile);
rpc UpdateProfile(UpdateProfileRequest) returns (Profile);
rpc CreateProfilePhotoUpload(...) returns (CreateProfilePhotoUploadResponse);
rpc UpdateProfilePhoto(UpdateProfilePhotoRequest) returns (Profile);
rpc GetSubscription(...) returns (Subscription);
rpc SubmitSubscriptionReceipt(...) returns (Subscription);
rpc DeactivateAccount(...) returns (DeactivateAccountResponse);
}
message Profile {
string email = 1;
string display_name = 2; // empty = unset
string avatar_url = 3; // empty = client default
AvatarKind avatar_kind = 4;
bool is_premium = 5;
string server_time = 6;
}
edge.alphea.dev 에 실제로 떠 있는지 확인했습니다. 인증 없이 호출해 401(존재) 과 404(미존재) 를 대조했습니다.
$ curl -X POST "https://edge.alphea.dev/alphea.connect.v1.ProfileService/GetProfile" \
-H "Content-Type: application/json" -d '{}'
{"code":"unauthenticated"} ← HTTP 401 · 서비스 존재
$ curl -X POST "https://edge.alphea.dev/alphea.connect.v1.RewardService/GetPointSummary" \
-H "Content-Type: application/json" -d '{}'
{"code":"unauthenticated"} ← HTTP 401 · 서비스 존재
$ curl -X POST "https://edge.alphea.dev/alphea.connect.v1.NoSuchService/Nope" \
-H "Content-Type: application/json" -d '{}'
404 page not found ← HTTP 404 · 대조군
GetProfile 은 401 을 돌려주므로 라우팅·핸들러가 모두 붙어 있는 상태입니다.
모바일 SDK 는 이미 노출하고 있습니다¶
alphea-core-mobile-sdk/mobile/connect_services.go:103
// --- ProfileService ---
func (c *Client) ConnectGetProfile() *StringResult {
return connectStringResult(c.coreClient.ConnectProfile().GetProfile(ctx))
}
func (c *Client) ConnectUpdateProfile(inputJSON string) *StringResult { ... }
func (c *Client) ConnectCreateProfilePhotoUpload(inputJSON string) *StringResult { ... }
func (c *Client) ConnectUpdateProfilePhoto(inputJSON string) *StringResult { ... }
alphea-core-mobile-sdk/pkg/foundation/connect_profile.go:31 의 JSON 투영입니다. 웹 SDK 타입을 만들 때 이 필드명을 그대로 쓰면 두 SDK 가 일치합니다.
type Profile struct {
Email string `json:"email"`
DisplayName string `json:"displayName"`
AvatarURL string `json:"avatarUrl"`
AvatarKind AvatarKind `json:"avatarKind"`
IsPremium bool `json:"isPremium"`
ServerTime string `json:"serverTime"`
}
웹 SDK 에는 ProfileService 가 없습니다¶
설치 버전: @alphea/connect@0.1.4-rc.1
레포: git.alphea.io/Alphea-Dev/alphea-framework.git · packages/connect
dist/connect/surface.js 가 아는 서비스는 다섯 개뿐이고 ProfileService 는 포함돼 있지 않습니다.
$ grep -o "alphea\.connect\.v1\.[A-Za-z]*Service" dist/connect/surface.js | sort -u alphea.connect.v1.AuthService alphea.connect.v1.BootstrapService alphea.connect.v1.ReferralService alphea.connect.v1.RewardService alphea.connect.v1.WalletService
데이터 클라이언트(createAlpheaConnectDataClient)에도 points / referral / rounds / redeem / claim / wallet 만 있고 profile 이 없습니다.
웹에서 현재 얻을 수 있는 사용자 정보는 다음이 전부이며, 이름과 이미지가 어디에도 없습니다.
sessionSnapshot() → authority, authenticated, renewable, expiresAt, userId currentSession() → userId, email, accountId, isPremium, expiresIn, tokenType
displayName 은 웹 SDK 전체에서 referral.d.ts 의 AlpheaConnectUserRef 한 곳에만 존재하는데, 이는 내가 초대한 친구 목록의 투영이라 본인 값을 얻는 데는 쓸 수 없습니다.
요청 사항¶
@alphea/connect 에 ProfileService 래퍼를 추가해 주시기 바랍니다.
우선순위 1 — 홈화면에 필요한 최소 범위
createAlpheaConnectDataClient({ transport }).profile.get()
→ { email, displayName, avatarUrl, avatarKind, isPremium, serverTime }
-
Profile.GetProfile을surface.ts에auth: "bearer",contractStatus: "live"로 등록 - 모바일 SDK 와 동일한 camelCase 필드명 사용
-
displayName이 빈 문자열일 수 있음(proto 주석의empty = unset),avatarUrl도 마찬가지(empty = client default) — 디코더가 이를 그대로 통과시켜 주면 화면 쪽에서 기본값 처리를 하겠습니다
우선순위 2 — 이후 프로필 편집 화면에 필요
UpdateProfile, CreateProfilePhotoUpload, UpdateProfilePhoto. 당장은 필요하지 않으므로 1 번만 먼저 나와도 홈화면 작업은 진행할 수 있습니다.
포인트는 요청 대상이 아닙니다¶
웹 SDK 에 이미 있습니다. Hub Web 에서 데이터 클라이언트를 붙이는 작업만 남아 있고, 그건 저희 쪽에서 진행합니다.
createAlpheaConnectDataClient({ transport }).points
.balance() // → { balance, earnedToday, allTime, serverTime }
.summary() // → Reward.GetPointSummary · { balance, earnedToday, currentRound, roundId, resetAt, serverTime }
선행 조건 — #601¶
현재 edge.alphea.dev 의 CORS 응답 헤더 중복으로 브라우저에서 모든 Connect RPC 가 차단되고 있어 로그인 자체가 되지 않습니다(#601). GetProfile 이 웹 SDK 에 추가되어도 #601 이 해결되기 전에는 브라우저에서 검증할 수 없습니다.
참고 — Hub Web 현재 상태¶
src/ui/HomePage.tsx:12 에 디자인 값이 하드코딩되어 있고, 연동 시 이 객체만 교체하면 되도록 한 곳에 모아 두었습니다.
const designValues = {
name: "Dee",
points: "6,400",
round: "The next round\nopens soon.",
} as const;
표시할 데이터가 없습니다.