diff --git a/coordinator/internal/transport/http/server.go b/coordinator/internal/transport/http/server.go index 98fb9af..79c9b88 100644 --- a/coordinator/internal/transport/http/server.go +++ b/coordinator/internal/transport/http/server.go @@ -132,6 +132,11 @@ func (s *Server) Handler(token string, uiToken ...string) http.Handler { mux.HandleFunc("GET /health", s.handleHealth) // Unauthenticated like /health, so a Prometheus scraper needs no credential. mux.Handle("GET /metrics", s.metrics.Handler()) + // Worker-key exchange is fronted by the coordinator when the userservice + // is embedded (serve mode): the key itself is the credential. + if s.userserviceURL != "" { + mux.HandleFunc("POST /worker-tokens/exchange", s.handleWorkerTokenExchangeProxy) + } hasBasicAuth := len(uiToken) > 0 && uiToken[0] != "" if s.uc.Dashboard != nil && (s.uiSessionMode() || hasBasicAuth) { diff --git a/coordinator/internal/transport/http/templates/add-worker.html b/coordinator/internal/transport/http/templates/add-worker.html index 036813d..09475c0 100644 --- a/coordinator/internal/transport/http/templates/add-worker.html +++ b/coordinator/internal/transport/http/templates/add-worker.html @@ -41,12 +41,12 @@