Files
zeekay 5c1c6f3e9d feat: add HTTP API with IAM auth for MPC wallet operations
Adds a REST API layer that bridges HTTP requests to NATS for MPC node
coordination. All wallet endpoints require bearer token auth validated
against hanzo.id/api/userinfo. Health/readiness probes remain public.

Endpoints: POST /api/v1/wallets (keygen), GET /api/v1/wallets,
POST /api/v1/sign, POST /api/v1/reshare

Also updates Dockerfile to Go 1.25 and hanzo-mpc binary naming.
2026-02-23 17:25:02 -08:00

18 lines
406 B
Go

package api
import "context"
type contextKey string
const userContextKey contextKey = "iam_user"
func setUser(ctx context.Context, user *IAMUser) context.Context {
return context.WithValue(ctx, userContextKey, user)
}
// GetUser extracts the authenticated IAM user from the request context.
func GetUser(ctx context.Context) *IAMUser {
user, _ := ctx.Value(userContextKey).(*IAMUser)
return user
}