diff --git a/internal/api/plugins/handlers.go b/internal/api/plugins/handlers.go index bfc8504..16db9ff 100644 --- a/internal/api/plugins/handlers.go +++ b/internal/api/plugins/handlers.go @@ -82,8 +82,8 @@ func (h *Handler) GetV1Plugins(w http.ResponseWriter, r *http.Request) { Mode: cfg.Mode, Status: "unknown", Config: cfg, - RequiresRestart: false, // Default: plugins support hot-reload - Version: "1.0.0", // Placeholder + RequiresRestart: false, // Default: plugins support hot-reload + Version: h.getPluginVersion(name, cfg), } // Check if plugin is registered @@ -196,7 +196,7 @@ func (h *Handler) PutV1PluginsPluginNameConfig(w http.ResponseWriter, r *http.Re h.logger.Info("updated plugin config", "plugin", pluginName, "user", user.Name) // Return updated plugin info with actual version - version := h.getPluginVersion(pluginName) + version := h.getPluginVersion(pluginName, newConfig) info := PluginInfo{ Name: pluginName, Enabled: newConfig.Enabled, @@ -268,7 +268,7 @@ func (h *Handler) GetV1PluginsPluginNameHealth(w http.ResponseWriter, r *http.Re response := map[string]any{ "status": status, - "version": "1.0.0", + "version": h.getPluginVersion(pluginName, cfg), "timestamp": time.Now().UTC(), } @@ -301,9 +301,10 @@ func (h *Handler) checkPermission(user *auth.User, permission string) bool { // getPluginVersion retrieves the version for a plugin // TODO: Implement actual version query from plugin binary/container -func (h *Handler) getPluginVersion(pluginName string) string { +func (h *Handler) getPluginVersion(pluginName string, cfg PluginConfig) string { // In production, this should query the actual plugin binary/container - // For now, return a default version based on plugin name hash - _ = pluginName // Unused until actual implementation + // For now, return a default version + _ = pluginName + _ = cfg return "1.0.0" }