Commit fdcd642
[P3] Implement Guardian Social Recovery Methods (#28)
* Fix guardian API paths and implement missing methods
- Fixed all 6 existing guardian methods to use correct /api/v1/identity paths
- Changed removeGuardian() to use DELETE method
- Implemented completeRecovery() method
- Implemented rejectRecovery() method
- Implemented getPendingRecoveries() method
- Updated method signatures to match node implementation
All 9 guardian endpoints now implemented correctly.
* Fix critical guardian method mismatches with node implementation
Fixed 6 critical issues where client methods didn't match node API:
1. addGuardian(): Added session_token and guardian_public_key parameters
2. listGuardians(): Changed to use Authorization header instead of query params
3. removeGuardian(): Changed to use Authorization header, removed identity_id param
4. approveRecovery(): Added session_token, changed signature from string to number[]
5. rejectRecovery(): Added session_token and signature parameters
6. getPendingRecoveries(): Added Authorization header with session_token
Updated types to match node responses:
- Guardian interface now matches GuardianInfo from node
- GuardianResponse includes total_guardians
- RecoverySession matches InitiateRecoveryResponse
- RecoveryStatus matches RecoveryStatusResponse
All methods now correctly implement node's guardian.rs API contract.
Verified against zhtp/src/api/handlers/guardian.rs lines 200-946.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 45e8cad commit fdcd642
File tree
8 files changed
+172
-125
lines changed- dist/core
- src/core
8 files changed
+172
-125
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
287 | | - | |
288 | | - | |
| 287 | + | |
| 288 | + | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
296 | 296 | | |
297 | 297 | | |
| 298 | + | |
298 | 299 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
| 300 | + | |
| 301 | + | |
305 | 302 | | |
306 | 303 | | |
307 | 304 | | |
308 | 305 | | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
322 | 309 | | |
| 310 | + | |
323 | 311 | | |
324 | 312 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
90 | 101 | | |
91 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
92 | 110 | | |
93 | 111 | | |
94 | 112 | | |
| |||
0 commit comments