gabriel / musehub public
feat patch task/admin-repair-identity-repo #1 / 1
AI Agent gabriel · 5 hours ago · Jun 17, 2026 · Diff

feat: admin repair-identity-repo endpoint

POST /api/admin/repair-identity-repo recreates the canonical {handle}/identity repo for identities whose repo was lost in a DB reset. Idempotent: returns created=false when the repo already exists. Requires is_admin=True.

Tests: AR_01 (403 non-admin), AR_02 (404 unknown), AR_03 (creates), AR_04 (idempotent), AR_05 (private/identity domain/correct pubkey).

sha256:b59e2315ea65229202f685648100a8f2111013205b1239a8694b60541d0d0d81 sha
+34 symbols
2 changed · 977 in snapshot files
sha256:1686f60653d9e2b99182013cf3edadfc24a243412c4c1f25a398afec935938a7 snapshot
+34
symbols added
2
files changed
977
files in snapshot
0
dead code introduced
Semantic Changes 34 symbols
+ _COUNTER variable variable _COUNTER L45–45
+ _NOW variable variable _NOW L44–44
+ _has_identity_repo function async_function _has_identity_repo L109–117
+ _key_for function function _key_for L39–42
+ _make_ctx function function _make_ctx L53–60
+ _seed_identity_with_key function async_function _seed_identity_with_key L63–106
+ _uid function function _uid L48–50
+ AsyncClient import import AsyncClient L24–24
+ AsyncSession import import AsyncSession L25–25
+ MSignContext import import MSignContext L28–28
+ MusehubAuthKey import import MusehubAuthKey L30–30
+ MusehubIdentity import import MusehubIdentity L31–31
+ MusehubRepo import import MusehubRepo L32–32
+ _hashlib import import _hashlib L37–37
+ annotations import import annotations L17–17
+ app import import app L33–33
+ compute_identity_id import import compute_identity_id L29–29
+ datetime import import datetime L20–20
+ encode_pubkey import import encode_pubkey L27–27
+ json import import json L19–19
+ pytest import import pytest L22–22
+ pytest_asyncio import import pytest_asyncio L23–23
+ require_signed_request import import require_signed_request L28–28
+ timezone import import timezone L20–20
+ test_ar01_non_admin_gets_403 function async_function test_ar01_non_admin_gets_403 L124–134
+ test_ar02_unknown_handle_gets_404 function async_function test_ar02_unknown_handle_gets_404 L141–151
+ test_ar03_creates_repo_when_missing function async_function test_ar03_creates_repo_when_missing L158–182
+ test_ar04_idempotent_when_repo_exists function async_function test_ar04_idempotent_when_repo_exists L189–217
+ test_ar05_created_repo_attributes function async_function test_ar05_created_repo_attributes L224–293
~ musehub/api/routes/api/admin.py .py 5 symbols added
+ RepairIdentityRepoRequest class class RepairIdentityRepoRequest L95–96
+ RepairIdentityRepoResponse class class RepairIdentityRepoResponse L99–100
+ admin_repair_identity_repo function async_function admin_repair_identity_repo L104–163
+ MusehubAuthKey import import MusehubAuthKey L17–17
+ MusehubIdentity import import MusehubIdentity L18–18
Files Changed
+1 ~1
977 in snapshot
← Older Oldest on task/admin-repair-identity-repo
All commits
Newer → Latest on task/admin-repair-identity-repo

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:b59e2315ea65229202f685648100a8f2111013205b1239a8694b60541d0d0d81 --body "your comment"