Skip to content

✨ knowledge: add owner-only public MCP sharing controls - #10679

Closed
arteeh wants to merge 1 commit into
hivecommons:v5from
arteeh:feat/10676-public-knowledge
Closed

arteeh wants to merge 1 commit into
hivecommons:v5from
arteeh:feat/10676-public-knowledge

Conversation

@arteeh

@arteeh arteeh commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Owners currently need environment variables to control anonymous Knowledge MCP access. This adds sharing controls to the Knowledge header and Settings, with an enable confirmation, tag scope, endpoint URL/copy, and read-only status for other viewers.

Authenticated GET /api/knowledge/public reports the effective settings; verified-owner PUT persists them through runtime config and the Kubernetes dashboard overlay. Explicit settings override environment variables, including disabled/empty values. Each MCP request uses a settings snapshot; subsequent requests stop immediately after disabling. Successful changes are audited and failed saves restore the prior runtime value.

Validation: gofmt -l is clean. Added regression tests for authorization, persistence/overlay restoration, environment precedence, public tag filtering, immediate disable, save failure, and UI confirmation cancellation. Tests were not run locally per AGENTS.md; CI owns execution.

Fixes #10676

— hive: backend=codex model=gpt-6-astra effort=medium


🐝 Hive Agent: contributor | SHA: c9a30f3ef

Persist public sharing and tag scope, restore Kubernetes overlays, and expose shared controls in the Knowledge header and Settings. Preserve environment fallback and gate writes on verified owner access.

Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Hive-Run: hivecommons#10676
Hive-Plan: owner-only-public-knowledge-sharing
Hive-Spec: issue-10676#design
Signed-off-by: arteeh <arteeh@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Oct 5, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nicholasjackson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#10675 🐛 sync issue claim labels same files src/pkg/dashboard/static/index.html
#10678 ✨ knowledge: owner toggle for the public read-only MCP endpoint in dashboard CONFLICT src/docs/env-vars.md
src/docs/public-knowledge-mcp.md
src/pkg/config/knowledge_config.go
src/pkg/dashboard/mcp_knowledge.go
src/pkg/dashboard/static/index.html

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts with #10678 (same issue #10676), and the dashboard toggle alone does not open the endpoint through the auth middleware.

Duplicate/conflict. #10678 adds the same GET/PUT /api/knowledge/public routes, the same knowledge.public config key and the same response shape. I read both diffs in full; the Go types differ (*PublicKnowledgeConfig here vs struct-with-*bool there) and source reports "config" here vs "setting" there, so they cannot both merge. Flagging for a maintainer: one should be closed. I have not closed anything.

Verified defect — isPublicPath still reads only the env (high). This PR switches handlePublicKnowledgeMCP to s.publicKnowledgeSettings() (src/pkg/dashboard/mcp_knowledge.go), but src/pkg/dashboard/server.go:1854 at this head is unchanged: case path == publicKnowledgeMCPPath && publicKnowledgeEnabled(): — the env-only function. authenticate (server.go:1508-1512) only short-circuits to next.ServeHTTP for public paths; otherwise the request falls through to the token/identity checks. So on a spoke with DASHBOARD_AUTH_TOKEN set and HIVE_PUBLIC_KNOWLEDGE unset, an owner who enables sharing from the dashboard gets a UI that says "enabled" and a URL that anonymous MCP clients cannot reach. #10678 makes isPublicPath a Server method and fixes this (server.go:1853 in that PR).

Conversely, this PR correctly adopts Knowledge.Public in loadWithDashboardOverlay (src/pkg/config/config.go:5444-5447), which #10678 lacks — each PR has half the fix. A maintainer should pick one branch to carry both halves.

Minor: PublicKnowledgeConfig.Enabled bool + pointer-to-struct means the overlay cannot express "explicitly disabled" vs "unset" at the field level, but the pointer on the struct handles it; fine as written.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Supersession sweep found that this PR's claimed issue is already closed by another merged PR.

  • Claimed issue: hive#10676
  • Closing PR: #10678

A different merged PR closed the claimed issue. Leaving this contributor PR open for a human to review.

This comment is edited in place by the supersession sweep; it is not duplicated.

@clubanderson

Copy link
Copy Markdown
Member

Thanks @arteeh — this landed via #10678 (same scope: GET/PUT /api/knowledge/public, owner-only dashboard toggle, env fallback), which also carried the OpenAPI/api-reference updates. Closing as superseded; #10676 is covered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ knowledge: dashboard toggle for the public read-only MCP endpoint (owner only)

2 participants