Repository navigation
Commit 6c95592
authored
* fix(node): prefer canonical repo row over mirror row in get_repo (#124)
get_repo matched both mirror rows (bare short-DID, is_public=true, no
visibility rules) and canonical rows (full did:key: DID, correct rules),
returning one nondeterministically. When the mirror row won, the
visibility gate saw is_public=true + empty rules, allowing unauthenticated
read of private/withheld content.
Add ORDER BY to prefer canonical rows (UUID id, no slash) over mirror
rows (slash-form id), matching the ranking logic already used by
DEDUP_CTE and dedupe_canonical_repos.
Test seeds mirror FIRST so an unordered fetch_optional returns the
mirror row — proving the test locks in the fix.
* fix(test): date canonical row after mirror to guard CASE term in get_repo fix (#124)
* fix(node): tighten get_repo owner matching to did:key only, not any DID method (#124 P2)
* fix(node): refactor owner DID normalization to a dedicated function in create_repo
* fix(node): align clone URL and slug construction with tightened did:key matching
- Make normalize_owner_key pub(crate) and reuse it in api/repos, api/events, api/peers, and visibility modules.
- Add read-gate authorize_repo_read and to_response clone_url slug tests.
* fix(node): hoist owner-key CASE into shared const + address #124 review feedback
- Hoist 7 verbatim SQL CASE copies into OWNER_KEY_CASE_SQL const
(dedup_cte(), get_repo, count_repos_deduped), keeping one literal
copy in the v7 migration with a cross-reference comment.
- Add 9 unit tests for normalize_owner_key over the full boundary set.
- Add LIMIT 1 to get_repo query for single-row intent.
- Add non_key_owner_bare_short_does_not_match is_owner regression test.
- Update is_owner doc to reflect did:key-only rule.
- Document non-key clone_url disk-path constraint in to_response.
* test(node): add SQL round-trip test for normalize_owner_key vs OWNER_KEY_CASE_SQL
Verifies every boundary value produces identical results from the
Rust function and the SQL CASE expression, preventing silent drift.
---------
Co-authored-by: Gravirei <gravirei@users.noreply.github.com>
1 parent 466a550 commit 6c95592
6 files changed
Lines changed: 469 additions & 58 deletions
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 | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
| 70 | + | |
75 | 71 | | |
76 | 72 | | |
77 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
| 299 | + | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
948 | | - | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
| 948 | + | |
953 | 949 | | |
954 | 950 | | |
955 | 951 | | |
| |||
1096 | 1092 | | |
1097 | 1093 | | |
1098 | 1094 | | |
1099 | | - | |
| 1095 | + | |
1100 | 1096 | | |
1101 | 1097 | | |
1102 | 1098 | | |
| |||
1141 | 1137 | | |
1142 | 1138 | | |
1143 | 1139 | | |
1144 | | - | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
1148 | | - | |
| 1140 | + | |
1149 | 1141 | | |
1150 | 1142 | | |
1151 | 1143 | | |
| |||
1474 | 1466 | | |
1475 | 1467 | | |
1476 | 1468 | | |
1477 | | - | |
| 1469 | + | |
1478 | 1470 | | |
1479 | 1471 | | |
1480 | 1472 | | |
| |||
1630 | 1622 | | |
1631 | 1623 | | |
1632 | 1624 | | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
1633 | 1633 | | |
1634 | 1634 | | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
1638 | | - | |
1639 | | - | |
| 1635 | + | |
1640 | 1636 | | |
1641 | 1637 | | |
1642 | 1638 | | |
| |||
2340 | 2336 | | |
2341 | 2337 | | |
2342 | 2338 | | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
| 2342 | + | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
2343 | 2389 | | |
0 commit comments