#681: federated share from the panel - direct user@server candidate #712

Merged
Cordy merged 9 commits from feat-681 into main 2026-09-24 03:02:23 +00:00
Owner

Closes #681

Root cause. The panel's federated Add path (built in #603) exists and works — sharePick.kind === "federated" posts to /api/v1/ocm/shares, which validates the allow-list, discovers and sends (interop green). But its only candidate source was shareFedMatches(shareFedContacts, q) — the invited contacts list — and typing deliberately resets sharePick (the #571 pick-to-enable guard). With contacts [], a policy-any server could never produce a candidate, so Add stayed disabled. /api/v1/recipients being local-only is by design (user-enumeration guard), not the bug.

Fix (UI only, no backend change).

  • New pure helper shareFedDirect(q, servers, existing) in its own pure:fed-direct lift-block: parses user@host, matches the host case-insensitively against allow-listed policy-"any" servers, returns the canonical fqdn, and dedupes against contacts already offered.
  • The share dialog loads shareFedServers (policy-any fqdns from GET /api/v1/ocm/shares) alongside the contacts fetch.
  • shareSearchRecipients appends the direct candidate to the federated list — the existing render, pick, Add branch, and boundary note are reused untouched.

Decisions. Direct addressing is offered only for policy-any servers ("invited contacts only" keeps the contacts flow, matching the admin copy); typing user@<non-allow-listed host> still offers nothing rather than a row that would 403 on Add.

Tests. web/test/qa681.test.js: unit pins on the lifted helper (valid/unknown-host/malformed/dedupe/case-insensitivity + canonical fqdn) and wiring pins. This unblocks the rest of QA §5 (accept/decline inbound, federated revoke, Shares-view rows).

Closes #681 **Root cause.** The panel's federated Add path (built in #603) exists and works — `sharePick.kind === "federated"` posts to `/api/v1/ocm/shares`, which validates the allow-list, discovers and sends (interop green). But its only candidate source was `shareFedMatches(shareFedContacts, q)` — the *invited contacts* list — and typing deliberately resets `sharePick` (the #571 pick-to-enable guard). With contacts `[]`, a policy-`any` server could never produce a candidate, so Add stayed disabled. `/api/v1/recipients` being local-only is by design (user-enumeration guard), not the bug. **Fix (UI only, no backend change).** - New pure helper `shareFedDirect(q, servers, existing)` in its own `pure:fed-direct` lift-block: parses `user@host`, matches the host case-insensitively against allow-listed **policy-"any"** servers, returns the canonical fqdn, and dedupes against contacts already offered. - The share dialog loads `shareFedServers` (policy-`any` fqdns from `GET /api/v1/ocm/shares`) alongside the contacts fetch. - `shareSearchRecipients` appends the direct candidate to the federated list — the existing render, pick, Add branch, and boundary note are reused untouched. **Decisions.** Direct addressing is offered only for policy-`any` servers ("invited contacts only" keeps the contacts flow, matching the admin copy); typing `user@<non-allow-listed host>` still offers nothing rather than a row that would 403 on Add. **Tests.** `web/test/qa681.test.js`: unit pins on the lifted helper (valid/unknown-host/malformed/dedupe/case-insensitivity + canonical fqdn) and wiring pins. This unblocks the rest of QA §5 (accept/decline inbound, federated revoke, Shares-view rows).
scout(#681): share panel picker, Add gating, ocm/shares UI callers
All checks were successful
scout-681 / scout (push) Successful in 1s
824618585a
scout(#681b): shareFedMatches, contacts loader, fedhint toggle, ocm-interop test shape
All checks were successful
scout-681 / scout (push) Successful in 1s
scout-681b / scout (push) Successful in 1s
d7901edc24
test(#681): RED - direct federated candidate for policy-any allow-listed servers
All checks were successful
scout-681 / scout (push) Successful in 1s
scout-681b / scout (push) Successful in 1s
0add3f3a42
splice(#681): direct federated candidate wiring in the share panel
All checks were successful
scout-681 / scout (push) Successful in 1s
scout-681b / scout (push) Successful in 1s
320b8b06f4
one-shot(#681): RED gate, splice, web checks, self-cleaning commit
All checks were successful
fix-681 / fix (push) Successful in 10s
scout-681 / scout (push) Successful in 1s
scout-681b / scout (push) Successful in 1s
543d555087
A policy-any allow-listed server no longer needs an invited contact: typing a full federated address offers a direct candidate (canonical fqdn, contact-deduped) that rides the existing pick -> Add -> POST /api/v1/ocm/shares path. Helper ships as a pure lift-block with unit pins (qa681.test.js).
one-shot: apply v0.6.262 changelog entry, self-remove
All checks were successful
chg-262 / chg (push) Successful in 6s
3573aced1d
docs: changelog for v0.6.262 (#681 federated share from the panel)
All checks were successful
ci / test-and-build (pull_request) Successful in 1m21s
77e3645e22
Cordy merged commit 47af96314e into main 2026-09-24 03:02:23 +00:00
Cordy deleted branch feat-681 2026-09-24 03:02:25 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#712
No description provided.