Commit Graph

91 Commits

Author SHA1 Message Date
onyinyang d881cf2fec
Remove spare and unallocated bridges rather than replacing them 2024-04-16 16:45:07 -04:00
onyinyang 8e08adbdb0
Add sync check for unallocated_bridges in lox-library 2024-04-16 16:45:07 -04:00
Cecylia Bocovich c92a14d612
Use more descriptive error for lox proto functions
Request functions for protocols in the Lox library previously returned a
ProofError error type, which is not verbose enough to allow for accurate
debugging.

This commit introduces a new error enum, CredentialError, with several
types that allow for descriptive error messages.
2024-03-12 16:16:04 -04:00
Cecylia Bocovich 12deeddeb0
Further condense search for replacement spares 2024-03-09 20:55:40 -05:00
Cecylia Bocovich 762fef432f
Remove unecessary res variable 2024-03-09 20:55:40 -05:00
Cecylia Bocovich a6c98b8f43
De-duplicate bridge replacement code 2024-03-09 20:55:40 -05:00
Cecylia Bocovich e6b0cf842a
Pass available_bridge by value rather than reference
Allows us to pop() from extra_bridges, which is less prone to errors than
calling both last() and then remove().
2024-03-09 20:55:40 -05:00
Cecylia Bocovich 2c396f63fa
Factor out a dissolve_spare_bucket fn
This function takes a spare bucket, specified by the given key, and
repurposes the bridges as unallocated.
2024-03-09 20:15:03 -05:00
Cecylia Bocovich 41402209f5
Delay recycling bridge table keys until we're done with them 2024-03-09 20:14:34 -05:00
Cecylia Bocovich 6462027b7f
Simplify selection of spare replacement bucket 2024-03-09 20:14:29 -05:00
Cecylia Bocovich 203b949d43
Use let-else to return early and reduce indentation 2024-03-09 16:25:41 -05:00
onyinyang 420d3be4bd Fixes last open invite bucket distribution 2024-02-12 23:11:55 +00:00
onyinyang 33e24ef5b6 Fix bug in bridge_replace fn, test 2024-01-18 03:34:22 +00:00
onyinyang 075d51b088 Add better serde error handling to wasm functions 2023-12-21 17:00:49 +00:00
Cecylia Bocovich 39449cabe8
Respond with error when open invitation buckets are empty
Expand the error type returns by invite() to include a new error for
when there are no available bridges for open invitation users. This
fixes a bug that previously caused a panic when we have no bridges to
distribute.

See https://gitlab.torproject.org/tpo/anti-censorship/lox/-/issues/43
2023-12-20 13:52:42 -05:00
onyinyang c8b6bb9fdd Formatting and clippy changes 2023-12-19 20:02:12 +00:00
onyinyang 472445a9a5
Add README for rdsys-backend-api, lox-utils and switch to lox-zkp crate 2023-11-23 11:44:05 -05:00
onyinyang fdde186c92
Add lox-wasm and lox-utils READMEs and other fmt fixes 2023-11-21 12:57:00 -05:00
onyinyang cb159405a3 Add watched_blockages to config file and improve naming 2023-11-14 17:30:45 +00:00
onyinyang e356034dae
Fixup and add comments, README to Lox Library 2023-11-07 18:44:25 -05:00
onyinyang ba70b1b4d4
Add a MAX_DAILY_BRIDGES to limit invites per day 2023-10-30 15:17:08 -04:00
onyinyang 68b5a9c18e
Upgrading several dalek dependencies and rand 2023-10-19 10:58:09 -04:00
onyinyang 4f7b96a603
Fix up some minor issues + fix bug in context sync 2023-10-18 12:09:46 -04:00
onyinyang 89fb0fbf4b
Add handling for unaccounted for bridges 2023-10-18 12:08:15 -04:00
onyinyang 25add69c4d
Add syncing functionality 2023-10-18 12:08:15 -04:00
onyinyang be0d026fe8
Cleanup and add syncing of resources 2023-10-18 12:08:15 -04:00
onyinyang faf40caf3a
Change open invite logic to distribute to k users 2023-08-02 10:34:39 -04:00
onyinyang 35f62ed213
Cleanup 2023-08-02 10:20:40 -04:00
onyinyang f52c6f515a
Add EXPIRY_DATE constant and fixup cloned vectors 2023-08-02 10:11:47 -04:00
onyinyang 93ce3e41b7
Add ExhausedIndexError for no available bucket ids 2023-08-02 10:11:46 -04:00
onyinyang 9c2b7703a8
Added open inv cleanup test 2023-08-02 10:11:46 -04:00
onyinyang a62b537aa6
Add testing for blocked bucket cleanup 2023-08-02 10:11:46 -04:00
onyinyang 3c88f4471b
Fix up convoluted function 2023-08-02 10:11:46 -04:00
onyinyang d2d09bccc1
Add more comprehensive logic for tidying unneeded buckets 2023-08-02 10:11:46 -04:00
onyinyang 40f1e88a31
Add find_next_available_key function to prevent overwriting buckets 2023-08-02 10:11:46 -04:00
onyinyang d98ae40879
Fix formatting 2023-07-19 10:30:35 -04:00
onyinyang 607466b949
Clean up clippy fixes 2023-06-23 13:04:15 -04:00
onyinyang 69e4579450
Change encbuckets to HashMap with EncryptedBucket 2023-06-23 08:30:14 -04:00
onyinyang 610a579731
Fix up bridge_unreachable 2023-06-23 08:24:28 -04:00
onyinyang 0ede04164b
Fix up replace function, remove recyclable 2023-06-23 08:24:28 -04:00
onyinyang 607ecd89c7
Converting bridgetable vectors to HashMaps 2023-06-23 08:24:28 -04:00
onyinyang 221f490d26
Update lox-distributor to handle gone resources more correctly 2023-06-16 17:18:19 -04:00
Cecylia Bocovich 67639e2f11
Remove needless range loops 2023-06-16 15:59:11 -04:00
onyinyang 5ac0fc7bef
Fixup cargo imports to address stdweb issue 2023-06-07 16:02:02 -04:00
onyinyang 16ced3c5e0
Add other cargo fmt changes 2023-06-06 19:58:35 -04:00
onyinyang 8d0f570627
Adds test and fixes for allocate bridges 2023-05-15 18:57:23 -04:00
onyinyang 45bb5756df
Minor fixes 2023-05-15 12:53:32 -04:00
onyinyang 6bff64f283
Adds replace_bridge test and fixes bugs in the function 2023-05-15 12:32:22 -04:00
onyinyang 0d317cea8c
Fix replace bridge to align with changes to lox-distributor 2023-05-11 17:02:33 -04:00
onyinyang 508eaf3bdd
Add functions to recycle and allocate extra bridges 2023-05-09 13:00:40 -04:00