idip service access: deleting a credential strands its matrix rows — a service can silently become stewards-only, and rows show a bare slug #1779

Closed
opened 2026-09-23 16:59:21 +00:00 by ben · 3 comments
Owner

What

Deleting a credential leaves its slug in idss/access-matrix.json on every service it opened. Nobody can hold a deleted credential, so it grants nothing — but:

  • if it was the only credential opening a service, that service silently becomes stewards-only (idip_gate.go:153-185 — restricted, no opening credential held, operators still allowed), with no one having chosen that; and
  • the row's front-door line shows the bare slug where the name was (accessRow, idip_service_access.go:215-237 — the name lookup misses), e.g. "restricted — kaumatua holders only" for a credential that no longer exists.

Nothing in internal/keria (definitions store / DefinitionAdapter.Delete/Retire) touches the matrix.

Build

  • On a credential's final delete (both the plain delete and revoke-from-all's last step), remove its slug from every policy in the matrix, in the same operation, attributed + audit-logged ("removed deleted credential X from files").
  • If that leaves a service with NO opening credential, do NOT let it fall to stewards-only by accident: the delete is refused up front (409) naming the services it would strand, and the delete-choice UI shows them ("Kaumātua is the only credential opening Files — open Files to all members or restrict it to another credential first"). Retire is unaffected (a retired credential still opens its doors until the last holder is revoked — DDR 0217 ruling 3 — and the definition then vanishes: the same cleanup runs then).
  • A one-time sweep for existing communities: drop matrix slugs with no definition, and report (not silently open/close) any service that sweep leaves with no opening credential.

Acceptance

  • Delete a credential that shares a service with another → its slug is gone from the matrix; the service stays restricted to the other.
  • Delete the ONLY credential opening a service → refused up front, naming the service; nothing deleted.
  • Retire → last holder revoked → the definition vanishes AND its slug leaves the matrix, under the same stranding guard.
  • No row ever renders a bare slug for a deleted credential.
## What Deleting a credential leaves its slug in `idss/access-matrix.json` on every service it opened. Nobody can hold a deleted credential, so it grants nothing — but: - if it was the **only** credential opening a service, that service silently becomes **stewards-only** (`idip_gate.go:153-185` — restricted, no opening credential held, operators still allowed), with no one having chosen that; and - the row's front-door line shows the bare slug where the name was (`accessRow`, `idip_service_access.go:215-237` — the name lookup misses), e.g. "restricted — kaumatua holders only" for a credential that no longer exists. Nothing in `internal/keria` (definitions store / `DefinitionAdapter.Delete`/`Retire`) touches the matrix. ## Build - On a credential's final delete (both the plain delete and revoke-from-all's last step), remove its slug from every policy in the matrix, in the same operation, attributed + audit-logged ("removed deleted credential X from files"). - If that leaves a service with NO opening credential, do NOT let it fall to stewards-only by accident: the delete is refused up front (409) naming the services it would strand, and the delete-choice UI shows them ("Kaumātua is the only credential opening Files — open Files to all members or restrict it to another credential first"). Retire is unaffected (a retired credential still opens its doors until the last holder is revoked — DDR 0217 ruling 3 — and the definition then vanishes: the same cleanup runs then). - A one-time sweep for existing communities: drop matrix slugs with no definition, and report (not silently open/close) any service that sweep leaves with no opening credential. ## Acceptance - [ ] Delete a credential that shares a service with another → its slug is gone from the matrix; the service stays restricted to the other. - [ ] Delete the ONLY credential opening a service → refused up front, naming the service; nothing deleted. - [ ] Retire → last holder revoked → the definition vanishes AND its slug leaves the matrix, under the same stranding guard. - [ ] No row ever renders a bare slug for a deleted credential.

swarm-claim host=matou-dev-server-01 run=30963
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=30963 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1779 — status success

⛔ close-report gates REFUSED this close — the following claims did not verify:

  • commit 89d6a15fb9 is not reachable from origin/main (not landed)
  • changed_files: 'STATUS.md' is not in the diff of the claimed commits
  • changed_files: 'control-plane/cmd/control-plane/main.go' is not in the diff of the claimed commits
  • changed_files: 'internal/controlapi/idip_service_access.go' is not in the diff of the claimed commits
  • changed_files: 'internal/controlapi/idip_service_access_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/keria/adapter.go' is not in the diff of the claimed commits
  • changed_files: 'internal/keria/matrix_cleanup_adapter_test.go' is not in the diff of the claimed commits
  • changed_files: 'internal/member/matrix_cleanup.go' is not in the diff of the claimed commits
  • changed_files: 'internal/member/matrix_cleanup_test.go' is not in the diff of the claimed commits
envelope
{
  "issue": 1779,
  "status": "success",
  "commits": [
    "89d6a15fb90d455822d50da253cde01e944ec6ea"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "internal/controlapi/idip_service_access.go",
    "internal/controlapi/idip_service_access_test.go",
    "internal/keria/adapter.go",
    "internal/keria/matrix_cleanup_adapter_test.go",
    "internal/member/matrix_cleanup.go",
    "internal/member/matrix_cleanup_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/keria/ ./internal/member/ ./internal/controlapi/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/keria/ ./internal/member/ ./internal/controlapi/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/keria/... ./internal/member/... ./internal/controlapi/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Delete a credential that shares a service with another → its slug is gone from the matrix; the service stays restricted to the other": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterDelete_PrunesSharedService + internal/member/matrix_cleanup_test.go TestFakeMatrix_RemoveCredential_SharedServiceStaysRestricted; DefinitionAdapter.Delete → pruneMatrix → member.ConfigRepoMatrix.RemoveCredential",
    "Delete the ONLY credential opening a service → refused up front, naming the service; nothing deleted": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterDelete_RefusesSoleOpener (409 StrandError names files, definition untouched); DefinitionAdapter.Delete WouldStrand guard before defs.Delete",
    "Retire → last holder revoked → the definition vanishes AND its slug leaves the matrix, under the same stranding guard": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterRetireVanish_PrunesMatrix; vanishIfRetiredEmpty now calls the shared pruneMatrix after defs.Delete",
    "No row ever renders a bare slug for a deleted credential": "internal/controlapi/idip_service_access_test.go TestIdipServiceAccess_DeletedCredentialNeverRendersBareSlug; accessRow drops a Komiti entry whose definition is gone → 'restricted — stewards only'"
  },
  "summary": "A vanished credential's slug is pruned from the access matrix in the same act, a delete that would strand a service is refused up front, and no SERVICE ACCESS row renders a bare deleted slug.",
  "blockers": []
}
**close-report** for #1779 — status `success` :no_entry: **close-report gates REFUSED this close** — the following claims did not verify: - commit 89d6a15fb90d455822d50da253cde01e944ec6ea is not reachable from origin/main (not landed) - changed_files: 'STATUS.md' is not in the diff of the claimed commits - changed_files: 'control-plane/cmd/control-plane/main.go' is not in the diff of the claimed commits - changed_files: 'internal/controlapi/idip_service_access.go' is not in the diff of the claimed commits - changed_files: 'internal/controlapi/idip_service_access_test.go' is not in the diff of the claimed commits - changed_files: 'internal/keria/adapter.go' is not in the diff of the claimed commits - changed_files: 'internal/keria/matrix_cleanup_adapter_test.go' is not in the diff of the claimed commits - changed_files: 'internal/member/matrix_cleanup.go' is not in the diff of the claimed commits - changed_files: 'internal/member/matrix_cleanup_test.go' is not in the diff of the claimed commits <details><summary>envelope</summary> ```json { "issue": 1779, "status": "success", "commits": [ "89d6a15fb90d455822d50da253cde01e944ec6ea" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "internal/controlapi/idip_service_access.go", "internal/controlapi/idip_service_access_test.go", "internal/keria/adapter.go", "internal/keria/matrix_cleanup_adapter_test.go", "internal/member/matrix_cleanup.go", "internal/member/matrix_cleanup_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/keria/ ./internal/member/ ./internal/controlapi/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/keria/ ./internal/member/ ./internal/controlapi/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/keria/... ./internal/member/... ./internal/controlapi/...", "exit_code": 0 } ], "criteria": { "Delete a credential that shares a service with another → its slug is gone from the matrix; the service stays restricted to the other": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterDelete_PrunesSharedService + internal/member/matrix_cleanup_test.go TestFakeMatrix_RemoveCredential_SharedServiceStaysRestricted; DefinitionAdapter.Delete → pruneMatrix → member.ConfigRepoMatrix.RemoveCredential", "Delete the ONLY credential opening a service → refused up front, naming the service; nothing deleted": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterDelete_RefusesSoleOpener (409 StrandError names files, definition untouched); DefinitionAdapter.Delete WouldStrand guard before defs.Delete", "Retire → last holder revoked → the definition vanishes AND its slug leaves the matrix, under the same stranding guard": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterRetireVanish_PrunesMatrix; vanishIfRetiredEmpty now calls the shared pruneMatrix after defs.Delete", "No row ever renders a bare slug for a deleted credential": "internal/controlapi/idip_service_access_test.go TestIdipServiceAccess_DeletedCredentialNeverRendersBareSlug; accessRow drops a Komiti entry whose definition is gone → 'restricted — stewards only'" }, "summary": "A vanished credential's slug is pruned from the access matrix in the same act, a delete that would strand a service is refused up front, and no SERVICE ACCESS row renders a bare deleted slug.", "blockers": [] } ``` </details>

close-report for #1779 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1779,
  "status": "success",
  "commits": [
    "89d6a15fb90d455822d50da253cde01e944ec6ea"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/main.go",
    "internal/controlapi/idip_service_access.go",
    "internal/controlapi/idip_service_access_test.go",
    "internal/keria/adapter.go",
    "internal/keria/matrix_cleanup_adapter_test.go",
    "internal/member/matrix_cleanup.go",
    "internal/member/matrix_cleanup_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go build ./...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/keria/ ./internal/member/ ./internal/controlapi/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go test ./internal/keria/ ./internal/member/ ./internal/controlapi/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c golangci-lint run ./internal/keria/... ./internal/member/... ./internal/controlapi/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Delete a credential that shares a service with another → its slug is gone from the matrix; the service stays restricted to the other": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterDelete_PrunesSharedService + internal/member/matrix_cleanup_test.go TestFakeMatrix_RemoveCredential_SharedServiceStaysRestricted; DefinitionAdapter.Delete → pruneMatrix → member.ConfigRepoMatrix.RemoveCredential",
    "Delete the ONLY credential opening a service → refused up front, naming the service; nothing deleted": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterDelete_RefusesSoleOpener (409 StrandError names files, definition untouched); DefinitionAdapter.Delete WouldStrand guard before defs.Delete",
    "Retire → last holder revoked → the definition vanishes AND its slug leaves the matrix, under the same stranding guard": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterRetireVanish_PrunesMatrix; vanishIfRetiredEmpty now calls the shared pruneMatrix after defs.Delete",
    "No row ever renders a bare slug for a deleted credential": "internal/controlapi/idip_service_access_test.go TestIdipServiceAccess_DeletedCredentialNeverRendersBareSlug; accessRow drops a Komiti entry whose definition is gone → 'restricted — stewards only'"
  },
  "summary": "A vanished credential's slug is pruned from the access matrix in the same act, a delete that would strand a service is refused up front, and no SERVICE ACCESS row renders a bare deleted slug.",
  "blockers": []
}
**close-report** for #1779 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1779, "status": "success", "commits": [ "89d6a15fb90d455822d50da253cde01e944ec6ea" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/main.go", "internal/controlapi/idip_service_access.go", "internal/controlapi/idip_service_access_test.go", "internal/keria/adapter.go", "internal/keria/matrix_cleanup_adapter_test.go", "internal/member/matrix_cleanup.go", "internal/member/matrix_cleanup_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go build ./...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/keria/ ./internal/member/ ./internal/controlapi/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go test ./internal/keria/ ./internal/member/ ./internal/controlapi/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c golangci-lint run ./internal/keria/... ./internal/member/... ./internal/controlapi/...", "exit_code": 0 } ], "criteria": { "Delete a credential that shares a service with another → its slug is gone from the matrix; the service stays restricted to the other": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterDelete_PrunesSharedService + internal/member/matrix_cleanup_test.go TestFakeMatrix_RemoveCredential_SharedServiceStaysRestricted; DefinitionAdapter.Delete → pruneMatrix → member.ConfigRepoMatrix.RemoveCredential", "Delete the ONLY credential opening a service → refused up front, naming the service; nothing deleted": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterDelete_RefusesSoleOpener (409 StrandError names files, definition untouched); DefinitionAdapter.Delete WouldStrand guard before defs.Delete", "Retire → last holder revoked → the definition vanishes AND its slug leaves the matrix, under the same stranding guard": "internal/keria/matrix_cleanup_adapter_test.go TestAdapterRetireVanish_PrunesMatrix; vanishIfRetiredEmpty now calls the shared pruneMatrix after defs.Delete", "No row ever renders a bare slug for a deleted credential": "internal/controlapi/idip_service_access_test.go TestIdipServiceAccess_DeletedCredentialNeverRendersBareSlug; accessRow drops a Komiti entry whose definition is gone → 'restricted — stewards only'" }, "summary": "A vanished credential's slug is pruned from the access matrix in the same act, a delete that would strand a service is refused up front, and no SERVICE ACCESS row renders a bare deleted slug.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1779
No description provided.