feat(connections): connect two workspaces by code (#138) #145

Merged
sharang merged 2 commits from feat/tenant-connections into main 2026-11-20 08:54:44 +00:00
2 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 3ef530b504 fix(connections): refuse user tokens on product routes
ci / shared (pull_request) Successful in 11s
ci / test (pull_request) Successful in 6m32s
ci / image (pull_request) Skipped
The two internal routes carry the peer's tenant id, which no person
sees; a user token is now refused there whatever groups its client
holds. The per-person window for entering codes applies only when a
person is named: keyed on the portal's own client, one workspace's
attempts would have blocked every other workspace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
2026-11-20 09:43:35 +01:00
Sharang ParnerkarandClaude Opus 5.5 400d1b1678 feat(connections): connect two workspaces by code (#138)
ci / shared (pull_request) Successful in 13s
ci / test (pull_request) Successful in 6m36s
ci / image (pull_request) Skipped
A workspace administrator creates a code (160 random bits, 14 days,
single use, stored as SHA-256 only); another workspace's administrator
enters it and the two are connected at once. Each side sees only the
other's display name. Every code that does not work gets the same 404,
and entering codes is limited to 20 per hour per workspace and person.
Either side can end a connection; archiving a workspace ends all of its
connections, and a purged side leaves the other an ended connection
with the name it knew. Both audit logs record each step; the other
side's entry names neither the person nor the address.

Products read the active connections and check one before each
delivery under the new route group connections.read
(GET /v1/internal/tenants/{id}/connections, GET
/v1/internal/connections/{connection}).

The Postgres GetTenant now answers a non-UUID id as not found (404),
as the memory store does, instead of a 500.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q9inRcu428A2iNjDHPEAT9
2026-11-20 09:39:56 +01:00