fix(governance): report only the dashboard sections that exist (#2147)
#2121 removed the pages behind sixteen sections and both capability handlers still named them, so GET /api/capabilities advertised sections nothing can render and the old service probed for pages that are gone. The single binary now reports an organisation as unavailable (its page exists, its writes do not) and lists nothing else it has no page for; the old service reports only the sections and probes its pages still make.
This commit is contained in:
2 files changed
+4
-18
No files matched your search
@@ -11,13 +11,8 @@ import (
|
||||
func (s *Server) handleCapabilities(w http.ResponseWriter, r *http.Request) {
|
||||
sections := map[string]bool{
|
||||
"chat": s.Chat != nil && s.Chat.Contract != nil,
|
||||
"logs": s.LogFeed != nil,
|
||||
"skills": s.Skills != nil,
|
||||
"curators": s.Curators != nil,
|
||||
"channels": s.Channels != nil,
|
||||
"captures": s.Captures != nil,
|
||||
"mappings": s.Mappings != nil,
|
||||
"bindings": s.Bindings != nil,
|
||||
// The workflows page draws its statistics from the task store
|
||||
// and its definition list from the local registry, so it is
|
||||
// worth showing with only the former.
|
||||
@@ -48,11 +43,6 @@ type pageProbe struct{ section, method, path string }
|
||||
func pageProbes() []pageProbe {
|
||||
return []pageProbe{
|
||||
{"org_members", http.MethodPost, "/api/orgs/_/members"},
|
||||
{"org_agents", http.MethodPut, "/api/orgs/_/agents/_"},
|
||||
{"org_policies", http.MethodPut, "/api/access/policies"},
|
||||
{"org_denials", http.MethodGet, "/api/access/denials"},
|
||||
{"org_audit", http.MethodGet, "/api/audit"},
|
||||
{"org_usage", http.MethodGet, "/api/usage"},
|
||||
{"org_config", http.MethodPost, "/api/control-plane/resources/_/commands/replace"},
|
||||
}
|
||||
}
|
||||
@@ -612,17 +612,13 @@ func (m *Module) capabilities(ctx context.Context, _ *struct{}) (*httpapi.Reply[
|
||||
sections := map[string]bool{"chat": signedIn, "memory": signedIn}
|
||||
for _, name := range []string{
|
||||
"settings", "events", "workflows", "runs", "credentials", "secret_engines", "controls", "memory_admin",
|
||||
"home", "system_status", "org_config", "captures", "mappings", "bindings", "extension_catalogue", "model_aliases", "workflow_editor",
|
||||
"home", "system_status", "org_config", "captures", "mappings", "extension_catalogue", "model_aliases", "workflow_editor",
|
||||
} {
|
||||
sections[name] = p.InstanceAdmin()
|
||||
}
|
||||
for _, name := range []string{
|
||||
"tasks", "work_requests", "logs", "skills", "curators", "channels",
|
||||
"task_execution", "organisations", "tools", "plugins", "container_runtime", "agent_profiles",
|
||||
"org_agents", "org_audit", "org_usage", "org_work_intake",
|
||||
} {
|
||||
sections[name] = false
|
||||
}
|
||||
// An organisation is created through the API alone here, so its page is
|
||||
// offered but its writes are not.
|
||||
sections["organisations"] = false
|
||||
// The access pages are offered to those the policy chain lets use them.
|
||||
sections["org_members"] = m.mayUse(ctx, p, ActionManageMembers, KindMember)
|
||||
sections["org_policies"] = m.mayUse(ctx, p, ActionManagePolicies, KindPolicy)
|
||||
|
||||
Reference in new issue
Block a user