feat(people): add project client access and client enablement operations
What
Absorbs the project client-users API that shipped in basecamp/bc3#13098 (1d8d4ce95d, deployed): three new operations on the People service, modeled in Smithy and regenerated across all six SDKs.
| Operation | Route | Notes |
|---|---|---|
UpdateProjectClientAccess | PUT /projects/{id}/people/client_users.json | client-side counterpart of UpdateProjectAccess; same grant/revoke/create triad |
EnableProjectClients | POST /projects/{id}/client_enablement.json | answers {"clients_enabled": true} |
DisableProjectClients | DELETE /projects/{id}/client_enablement.json | answers {"clients_enabled": false} |
Endpoint contract
createrows need onlyemail_address;namedefaults to the address server-side,titleandcompany_nameare optional. Modeled asCreateClientRequest(distinct fromCreatePersonRequest, which requiresname).- Only client users are eligible: a
grantid belonging to a team member is omitted fromgrantedrather than cross-graded, andrevokenever removes a team member. Response is the existingProjectAccessResultshape, each personclient: true. 403until clients are enabled on the project; enabling is deliberately a separate call because it applies the project's default client visibility.POSTenablement is403unless the project can have clients;DELETEis403while any client users remain.- Invitations are all-or-nothing. An invalid
createrow (an email-less one included) answers422 {"errors": [{"email_address", "messages"}]}naming each rejected row, and nobody is invited. New distinct addresses that would exceed the account's user limit answer a bare429, and nobody is invited; addresses already on the account take no seat and a repeated address counts once.
Two contract traits this op does not inherit from UpdateProjectAccess
- The 429 is a verdict, not throttling. It carries no
Retry-Afterand re-asking cannot change the answer, so the operation declaresretryOn: [503]instead of the shared[429, 503]. Every SDK gates status retry on the declared set (SPEC §7 Gate 3), so the 429 surfaces on the first attempt; a conformance case asserts one request andrate_limit/httpStatus 429in all six runners. The error keeps the status-mappedrate_limitcode (SPEC §6 maps by status, and the bare body gives nothing to shape-detect); I'm not adding operation-aware error mapping across six SDKs for one route — a caller that hit this op knows a 429 from it is the seat limit. SPEC's "all operations use[429, 503]" sentences now name the exception. Happy to revisit if the CLI needs a distinct code. - The 422 body is a row list, not a field map. SPEC §6 had two 422 shapes (
{error}and{errors: {field: [...]}}); this one is{errors: [{email_address, messages}]}(withemail_address: nullfor a blank row), and every SDK dropped the rows and answered "Request failed (HTTP 422)". New SPEC §6 step 1b keys the sharedfield_errorsslot by each row'semail_address, else an integerindex(the account enrollment API's spelling), else its position, so the rejected addresses reach bothmessage(not-an-address: Email address must be valid) and the structured slot in all six languages. Unit tests in each SDK replay the literal bc3 controller bodies plus strict-gate negatives; the people service tests assert the slot; a conformance case pins the composed message across the runners. I reused the existing slot rather than adding a per-operation typed error class in six languages: the rows already are a map from an identifier to messages.
What else is in here
- Idempotency: all three are naturally idempotent (the PUT re-asks the same all-or-nothing question; the toggles re-answer the same state), so
check-idempotency-parityadvances 88 → 91 / 216 → 219 andEnableProjectClientsis the eleventh flagged POST in SECURITY.md. - Go: hand-written wrappers over the generated client; all three accounted for in the grouped-client inventory (not grouped, beside
UpdateProjectAccess). - Tests in all six languages: wire body (name omitted when blank), enablement toggle, 403/422/429 paths. Conformance: paths, request body, 503 retries, single-attempt 429, row-keyed 422, dispatched in all six runners.
- Provenance pin does not move. The range since the pin also carries the Subtask API, circles create, bulk enrollments, backlinks and unscoped recording-show families, which need their own triage. The three routes are waived in
spec/bc3-route-allowlist.ymlwith routes.rb/controller/test-api evidence and marked for deletion at the next repin; the contract is registered asspec/api-gaps/project-client-users.md(absorbed-in-sdk).
Release notes: enhancement.
Downstream
The CLI PR (basecamp-cli, feat/project-clients) pins this branch and will flip to the tagged release after merge, as #839 → basecamp-cli#677 did.
I'm babysitting the review loop on this PR: Copilot, Codex, cubic and CI feedback each get a fix or a reasoned reply per round.
Summary by cubic
Adds three People service operations that manage project client users, ported from basecamp/bc3#13098 into all six SDKs.
New Features
UpdateProjectClientAccessuses the samegrant/revoke/createtriad asUpdateProjectAccess;createrows need onlyemail_address, andnamedefaults to the address server-side.EnableProjectClientsandDisableProjectClientstoggle enablement and are a required first step (403until enabled).- Only client users are eligible: team-member IDs are omitted from
granted, andrevokenever removes a team member. - All three operations are naturally idempotent.
- The TypeScript request type is exported from the package root.
- Go classifies
UpdateProjectClientAccessasproject_accessto match the other SDKs.
Error handling
- Invitations are all-or-nothing; one bad
createrow rejects the whole batch with a row-keyed422naming each rejectedemail_address. - The row-keyed
422is a new error shape (SPEC §6 step 1b); rejected addresses now reach thefield_errorsslot instead of a bare "Request failed". - Malformed row selectors fall through to the next keying strategy rather than discarding the whole list.
- Swift now treats a boolean
indexselector as malformed, keying the row by position instead of"1". - The seat-limit
429is a verdict, not throttling, soUpdateProjectClientAccessretries only on503and surfaces the429on the first attempt; the retry documentation now names this exception.
The provenance pin stays put; the new routes are waived in the bc3 route allowlist, and the gap entry now references the provenance file rather than embedding the pin SHA.