Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProvisionUser ¶
ProvisionUser exchanges a validated token for the caller's Convex users._id, creating the row on first contact. Idempotent — the web client calls the same mutation at sign-in (PRD §11, §13). Returned as a func, not a method, so the WS handler can hold it as a field the tests can stub without a real Convex deployment.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server holds the Echo instance and shared dependencies. Handlers are methods on Server so they can reach dependencies without package-level globals.
func (*Server) RegisterRoutes ¶
func (s *Server) RegisterRoutes()
RegisterRoutes wires all HTTP routes. Kept separate from server lifecycle so the route table is easy to scan in one place.
type TokenValidator ¶
type TokenValidator struct {
// contains filtered or unexported fields
}
TokenValidator verifies Clerk-issued JWTs against the instance JWKS (PRD §13). It is the only component that knows what "authenticated" means; everything past the WS upgrade treats identity as message data.
func NewTokenValidator ¶
func NewTokenValidator(ctx context.Context, issuer string) (*TokenValidator, error)
NewTokenValidator fetches the JWKS for issuer and keeps it refreshed in the background (keyfunc handles caching and kid rotation).