idip service access: take ONE credential off a restricted service (#1778) #1797

Merged
ben merged 1 commit from idip-unrestrict into main 2026-09-23 21:19:54 +00:00
Owner

Closes #1778. Stacked on #1796 (idip-credentials-ui) — this PR's base is that branch, so its diff is only the #1778 work; once #1796 merges, retarget to main (or I will) and it lands by push as an ordinary ticket (no landing-pr).

What changes

  • Control plane: POST /api/v1/idip/credentials/{slug}/access/{service}/unrestrict — the service's opening set minus THIS credential, written in ONE SetPolicy: no open-to-everyone window. The last opening credential is refused (409 last_opening_credential) with the message naming the two ways out (open it to all members, or restrict it to another credential first) — a service never silently becomes stewards-only. Not-an-opener / open-to-all → idempotent 204. Steward-gated + logged like restrict/open.
  • OpenAPI path + regenerated client (check:client in sync); IdipCredentialsClient.unrestrictService.
  • Editor (S7i "who can reach it"): the Only credential holders — current row gains Stop this credential opening it when other credentials open the service too; the last-opener case shows the two ways out in place of the act, keeping Open to all members as the first.

Proof

  • internal/controlapi/idip_service_unrestrict_test.go: Files {Finance, Kaumātua} → unrestrict Kaumātua → {Finance}; the IdipGateDecider over the SAME matrix denies the Kaumātua-only holder on their next request, still admits the Finance holder, still refuses a plain member, and the row never read open (AC1); the last opener is 409 with the copy and nothing changes (AC2); idempotence + the bare-slug claim form. go test ./internal/controlapi/ ./internal/member/ green.
  • Dashboard: credentialsSurface gains both editor cases (AC3); suite 148 files / 1889 tests green; vue-tsc clean.

Screenshots (harness ?scenario=idip, Kaumātua's detail)

Files opened by Finance + Kaumātua: the act is offered after taking Kaumātua off Files; Meetings (last opener) shows the two ways out
two openers after

🤖 Generated with Claude Code

Closes #1778. **Stacked on #1796** (`idip-credentials-ui`) — this PR's base is that branch, so its diff is only the #1778 work; once #1796 merges, retarget to `main` (or I will) and it lands by push as an ordinary ticket (no `landing-pr`). ## What changes - **Control plane:** `POST /api/v1/idip/credentials/{slug}/access/{service}/unrestrict` — the service's opening set minus THIS credential, written in ONE `SetPolicy`: no open-to-everyone window. The **last opening credential is refused** (409 `last_opening_credential`) with the message naming the two ways out (open it to all members, or restrict it to another credential first) — a service never silently becomes stewards-only. Not-an-opener / open-to-all → idempotent 204. Steward-gated + logged like restrict/open. - **OpenAPI** path + regenerated client (`check:client` in sync); `IdipCredentialsClient.unrestrictService`. - **Editor (S7i "who can reach it"):** the *Only credential holders — current* row gains **Stop this credential opening it** when other credentials open the service too; the last-opener case shows the two ways out in place of the act, keeping *Open to all members* as the first. ## Proof - `internal/controlapi/idip_service_unrestrict_test.go`: Files {Finance, Kaumātua} → unrestrict Kaumātua → {Finance}; the `IdipGateDecider` over the SAME matrix denies the Kaumātua-only holder on their next request, still admits the Finance holder, still refuses a plain member, and the row never read open (AC1); the last opener is 409 with the copy and nothing changes (AC2); idempotence + the bare-slug claim form. `go test ./internal/controlapi/ ./internal/member/` green. - Dashboard: `credentialsSurface` gains both editor cases (AC3); suite 148 files / 1889 tests green; `vue-tsc` clean. ## Screenshots (harness `?scenario=idip`, Kaumātua's detail) | Files opened by Finance + Kaumātua: the act is offered | after taking Kaumātua off Files; Meetings (last opener) shows the two ways out | |---|---| | ![two openers](https://git.matou.nz/attachments/966bc3eb-e865-4025-8726-27776972c456) | ![after](https://git.matou.nz/attachments/a12d8bd7-b5a1-4b76-91df-79caa0a2dde3) | 🤖 Generated with [Claude Code](https://claude.com/claude-code)
idip service access: #1778 — take ONE credential off a restricted service in one write (no open-to-everyone window); the last opener is refused with the two ways out; the editor offers the act only where it applies
Some checks failed
ci / seam (pull_request) Failing after 8m37s
ci / publish-broker (pull_request) Has been skipped
ci / publish (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
9df3cbe57d
Beside `restrict` (additive) and `open` (clears everything) the credential-side
door gains `POST /api/v1/idip/credentials/{slug}/access/{service}/unrestrict`:
the service's opening set minus THIS credential, written in ONE SetPolicy, so
stopping Kaumātua opening Files while Finance keeps it never passes through a
state where every member reaches Files. The last opening credential is refused
(409 last_opening_credential) with the message naming the two ways out — open it
to all members, or restrict it to another credential first — so a service never
silently becomes stewards-only. A credential that does not open the service, or
a service open to all, is an idempotent 204; either claim form is recognised.
Steward-gated and logged like the other two.

OpenAPI path + regenerated client (check:client in sync);
IdipCredentialsClient.unrestrictService. The S7i "who can reach it" editor's
"Only credential holders — current" row gains "Stop this credential opening it"
when others open the service too; the last-opener case shows the two ways out in
place of the act and keeps "Open to all members" as the first.

Seam tests (idip_service_unrestrict_test.go): Files {Finance, Kaumātua} →
unrestrict Kaumātua → {Finance}, with the IdipGateDecider over the SAME matrix
denying the Kaumātua-only holder on their next request, still admitting the
Finance holder and still refusing a plain member — the row never read open; the
last-opener 409 with the copy and nothing changed; idempotence and the bare-slug
form. Dashboard: credentialsSurface gains both editor cases; suite 148 files /
1889 tests green; vue-tsc clean.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ben changed target branch from idip-credentials-ui to main 2026-09-23 20:38:43 +00:00
ben force-pushed idip-unrestrict from 9df3cbe57d
Some checks failed
ci / seam (pull_request) Failing after 8m37s
ci / publish-broker (pull_request) Has been skipped
ci / publish (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
to 54050d4660
All checks were successful
ci / seam (pull_request) Successful in 13m33s
ci / publish (pull_request) Has been skipped
ci / publish-broker (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
2026-09-23 20:38:43 +00:00
Compare
ben force-pushed idip-unrestrict from 54050d4660
All checks were successful
ci / seam (pull_request) Successful in 13m33s
ci / publish (pull_request) Has been skipped
ci / publish-broker (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
to 9914e01a01
All checks were successful
ci / seam (pull_request) Successful in 13m20s
ci / publish (pull_request) Has been skipped
ci / publish-broker (pull_request) Has been skipped
ci / deploy-broker (pull_request) Has been skipped
2026-09-23 21:19:47 +00:00
Compare
ben merged commit 61d190da7a into main 2026-09-23 21:19:54 +00:00
Sign in to join this conversation.
No reviewers
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
Matou/idss!1797
No description provided.