diff --git a/internal/daemon/controller/handler_ui.go b/internal/daemon/controller/handler_ui.go index a8de878f8..314c7c459 100644 --- a/internal/daemon/controller/handler_ui.go +++ b/internal/daemon/controller/handler_ui.go @@ -2,11 +2,11 @@ // SPDX-License-Identifier: MPL-2.0 //go:build ui -// +build ui package controller import ( + "context" "net/http" "strings" @@ -17,6 +17,9 @@ func init() { handleUi = handleUiWithAssets } +// serveMetadata provides controller metadata to the UI for licensed versions of Boundary. +var serveMetadata = func(ctx context.Context, w http.ResponseWriter) {} + func handleUiWithAssets(c *Controller) http.Handler { var nextHandler http.Handler if c.conf.RawConfig.DevUiPassthroughDir != "" { @@ -40,7 +43,9 @@ func handleUiWithAssets(c *Controller) http.Handler { default: switch r.URL.Path { case "/", "/favicon.png", "/assets/styles.css": - + case "/metadata.json": + serveMetadata(c.baseContext, w) + return default: for i := dotIndex + 1; i < len(r.URL.Path); i++ { intVal := r.URL.Path[i] diff --git a/internal/daemon/controller/handler_ui_test.go b/internal/daemon/controller/handler_ui_test.go index 4b927ca23..e59d43f2d 100644 --- a/internal/daemon/controller/handler_ui_test.go +++ b/internal/daemon/controller/handler_ui_test.go @@ -2,7 +2,6 @@ // SPDX-License-Identifier: MPL-2.0 //go:build ui -// +build ui package controller