Commit 4f68185
committed
fix(tap-agent): enforce Horizon bucket isolation for RAV/receipt queries
- Use full Horizon identity (payer, data_service, service_provider,
collection_id) in reads to prevent cross-bucket reads.
- sender_account.rs: last non-final RAVs lookup now filters by
service_provider and data_service.
- sender_accounts_manager.rs: non-final RAV aggregation constrained to the
configured bucket via WHERE data_service = $1 AND service_provider = $2.
- sender_allocation.rs (Horizon):
- calculate_invalid_receipts_fee() now filters by collection_id, payer,
service_provider, and data_service.
- calculate_fee_until_last_id() now filters by collection_id, payer,
service_provider, and data_service (and updated SQLx arg indices).
- Rationale: Aligns with tap_horizon_ravs PK, matches Horizon’s identity
model, avoids mixing state across different data services/providers, and
complements the service-side DataServiceCheck which only guards ingestion.1 parent ffaf19d commit 4f68185
File tree
3 files changed
+46
-9
lines changed- crates/tap-agent/src/agent
3 files changed
+46
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
| 278 | + | |
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| |||
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
891 | | - | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
892 | 895 | | |
893 | 896 | | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
894 | 903 | | |
895 | 904 | | |
896 | 905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
935 | 935 | | |
936 | 936 | | |
937 | 937 | | |
| 938 | + | |
938 | 939 | | |
939 | | - | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
940 | 948 | | |
941 | 949 | | |
942 | 950 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1277 | 1277 | | |
1278 | 1278 | | |
1279 | 1279 | | |
1280 | | - | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1281 | 1283 | | |
1282 | 1284 | | |
1283 | 1285 | | |
1284 | 1286 | | |
1285 | 1287 | | |
1286 | 1288 | | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
1287 | 1293 | | |
1288 | 1294 | | |
1289 | 1295 | | |
| |||
1305 | 1311 | | |
1306 | 1312 | | |
1307 | 1313 | | |
1308 | | - | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
1309 | 1318 | | |
1310 | 1319 | | |
1311 | 1320 | | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
1312 | 1326 | | |
1313 | 1327 | | |
1314 | 1328 | | |
| |||
1353 | 1367 | | |
1354 | 1368 | | |
1355 | 1369 | | |
1356 | | - | |
1357 | | - | |
1358 | | - | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
1359 | 1375 | | |
1360 | 1376 | | |
1361 | 1377 | | |
1362 | 1378 | | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
1363 | 1383 | | |
1364 | 1384 | | |
1365 | 1385 | | |
| |||
1399 | 1419 | | |
1400 | 1420 | | |
1401 | 1421 | | |
1402 | | - | |
| 1422 | + | |
1403 | 1423 | | |
1404 | 1424 | | |
1405 | 1425 | | |
| |||
0 commit comments