bitfl0wer
48add97e79
metric ton of types for message deserialization
2023-04-25 21:42:46 +02:00
bitfl0wer
c7afd81d80
Fix error due to deletion of impl::Display
2023-04-25 21:42:11 +02:00
bitfl0wer
36b6be5788
Merge remote-tracking branch 'origin/main' into feature/gateway-observer
2023-04-25 18:00:44 +02:00
bitfl0wer
7cb77bae0f
Improve readability
2023-04-25 17:41:14 +02:00
bitfl0wer
9dad307b71
Improve readability
2023-04-25 17:33:35 +02:00
bitfl0wer
e52a646054
Split up schemas.rs
2023-04-25 17:32:30 +02:00
bitfl0wer
87d9d14047
Add dependencies
2023-04-25 17:21:27 +02:00
bitfl0wer
792a06f408
separate User and Instance limits.
2023-04-24 20:58:45 +02:00
bitfl0wer
d9857180e9
Give each user their own rate limits
2023-04-24 19:51:35 +02:00
bitfl0wer
c9d5bb8b6e
Merge remote-tracking branch 'origin/main' into improvement/update-rate-limiter-implementation
2023-04-24 19:50:36 +02:00
bitfl0wer
17eab8169e
Change HashMap<> to Limits
2023-04-24 19:49:26 +02:00
bitfl0wer
3e9aebf7ee
Implement Limits::new() and more logic
2023-04-24 19:38:42 +02:00
bitfl0wer
eea118b623
Create internal User and API UserObject
2023-04-23 21:32:48 +02:00
bitfl0wer
2880097cb2
comment out test until spacebar pr is merged
2023-04-23 20:21:36 +02:00
bitfl0wer
f3f70ba131
Implement Login
2023-04-23 20:11:14 +02:00
bitfl0wer
fc4a0a4533
make compiler happy
2023-04-23 14:01:02 +02:00
bitfl0wer
d9c82d5bfa
start working on login
2023-04-23 14:00:27 +02:00
bitfl0wer
cfed349c03
Make send_request return Result
2023-04-23 13:58:17 +02:00
bitfl0wer
82bfec0612
Made test pass
2023-04-23 13:45:52 +02:00
bitfl0wer
d1d8b6f237
Add documentation
2023-04-23 12:06:51 +02:00
bitfl0wer
1e00296dc9
Made AuthEmail, Password and Username reusable
2023-04-23 11:58:45 +02:00
bitfl0wer
2e52fb71d4
Register function with good errors!
2023-04-22 22:12:56 +02:00
bitfl0wer
fbfa4fda94
push progress
2023-04-22 11:32:44 +02:00
bitfl0wer
d67cedc847
Remove boilerplate errors
2023-04-21 23:20:23 +02:00
bitfl0wer
b18e38a5fc
impl register
2023-04-21 18:20:57 +02:00
bitfl0wer
1418b67921
add error
2023-04-21 18:20:49 +02:00
bitfl0wer
f96bcb87f6
Move custom errros to central file
2023-04-21 16:18:20 +02:00
bitfl0wer
552b43f80b
Replace Custom Error boilerplate with macro
2023-04-21 15:04:58 +02:00
bitfl0wer
fff71f0529
create errors.rs
2023-04-21 14:30:10 +02:00
bitfl0wer
950eba2ae7
Add TODO
2023-04-21 14:30:03 +02:00
bitfl0wer
ff6874abcb
Fix bad build
2023-04-21 14:27:56 +02:00
bitfl0wer
4f745c958c
Have AuthRegister and AbsoluteRegister cancel each other out
2023-04-20 20:11:12 +02:00
bitfl0wer
897df7adce
Change comment
2023-04-20 19:47:20 +02:00
bitfl0wer
e43b3934e4
Improve limit check
2023-04-20 19:47:08 +02:00
bitfl0wer
27c111fd99
begin working on register
2023-04-20 00:14:11 +02:00
bitfl0wer
8666aa34e5
add users hashmap
2023-04-19 23:32:02 +02:00
bitfl0wer
9e10ce05a9
add await to fix test error
2023-04-19 20:58:14 +02:00
bitfl0wer
bc3083bcf6
add additional documentation and TODO
2023-04-19 20:42:28 +02:00
bitfl0wer
33b5d6d57c
create new() method
2023-04-19 20:42:11 +02:00
bitfl0wer
1d25fdffcb
Include new file
2023-04-19 20:41:52 +02:00
bitfl0wer
32f1365a54
make progress on instance object creation
2023-04-19 20:41:33 +02:00
bitfl0wer
f45193fc40
implement getting InstancePoliciesSchema
...
Co-authored-by: sky <skyrina@users.noreply.github.com>
2023-04-19 20:41:15 +02:00
bitfl0wer
7528a8eccd
remove token check, add username impl
2023-04-17 22:38:21 +02:00
bitfl0wer
38e3ee3afa
add Token struct and impl
2023-04-17 21:31:15 +02:00
bitfl0wer
0f424a9c53
start working on register
2023-04-16 23:03:24 +02:00
bitfl0wer
5e3fb77911
add gateway object
2023-04-16 23:03:12 +02:00
bitfl0wer
52c2bce5d3
use camel case
2023-04-16 22:50:51 +02:00
bitfl0wer
32ef8ee5b1
remove impl LoginSchema, add InstancePolicies
2023-04-16 22:18:51 +02:00
bitfl0wer
d4bf540203
Add PartialEq and Eq derives
2023-04-16 22:16:39 +02:00
bitfl0wer
4b129ee6a3
Rename client to instance
2023-04-16 22:16:22 +02:00
bitfl0wer
4d10710f4f
add auth module
2023-04-16 15:07:15 +02:00
bitfl0wer
157b351db9
reformat file
2023-04-16 14:55:13 +02:00
bitfl0wer
e919e71819
Added email regex validation and tests
2023-04-16 14:09:23 +02:00
bitfl0wer
76dd665e91
Implement LoginSchema
2023-04-16 13:41:26 +02:00
bitfl0wer
d6ae03b656
add comment
2023-04-16 12:33:57 +02:00
bitfl0wer
746299c029
Write test to check consent validation
2023-04-16 12:32:49 +02:00
bitfl0wer
4e9854d46e
write tests to check username validation
2023-04-16 12:30:30 +02:00
bitfl0wer
062faf8c07
add tests to confirm password validation
2023-04-16 12:26:12 +02:00
bitfl0wer
40425fc282
add "new" method for RegSchema with custom errors
2023-04-15 22:06:18 +02:00
bitfl0wer
28d03b9c9f
Add TotpSchema
2023-04-15 21:20:32 +02:00
bitfl0wer
3957d23c53
Update RegisterSchema, add LoginSchema
2023-04-15 21:16:47 +02:00
bitfl0wer
c5a4a56022
create RegisterSchema
2023-04-15 21:12:33 +02:00
bitfl0wer
ca988d93aa
create schemas.rs
2023-04-15 20:16:18 +02:00
bitfl0wer
673ddd5c8d
add test_send_request
2023-04-15 18:16:26 +02:00
bitfl0wer
e4ba507ace
add limit updates for Error, Global, Ip
...
Despite Error, Global and Ip technically being handled seperately, we still need to update their "reset" and "limit" values to match what the API tells us.
2023-04-15 17:12:33 +02:00
bitfl0wer
77d5349231
remove unneccessary variable
2023-04-15 17:09:42 +02:00
bitfl0wer
992b803548
add add_remaining
...
add_remaining() adds an i64 to the interal "remaining: u64" with underflow protection.
2023-04-15 17:08:19 +02:00
bitfl0wer
427ce0541e
update internal values through mut ref
2023-04-15 17:07:46 +02:00
bitfl0wer
1a398fecd7
add fallback if no rate limit header received
2023-04-15 14:55:50 +02:00
bitfl0wer
384d42e877
Derive PartialEq and Eq to use assertEq in tests
2023-04-15 13:54:57 +02:00
bitfl0wer
a8a4da36c7
add test which checks instance rate limits working
2023-04-15 13:54:33 +02:00
bitfl0wer
5130846c7f
rename tests
2023-04-15 13:27:43 +02:00
bitfl0wer
84258ec8da
Fix incorrect url formatting, add more tests
2023-04-15 13:27:34 +02:00
bitfl0wer
d60711a5d1
Fixed goofy ahh way to remove a slash from the end of the url
2023-04-15 13:03:51 +02:00
bitfl0wer
9855efe15e
Derive Debug, start debugging
2023-04-14 23:38:36 +02:00
bitfl0wer
965308e746
add documentation
2023-04-14 23:01:48 +02:00
bitfl0wer
88987e6bfb
make send_request return Option<Response>
2023-04-14 22:40:13 +02:00
bitfl0wer
ce21a8539d
add send_request method
2023-04-14 22:22:23 +02:00
bitfl0wer
112f44e224
Derive copy trait
2023-04-14 22:22:11 +02:00
bitfl0wer
d8dd2010a3
add new struct, send_request and can_send_request
2023-04-14 18:29:20 +02:00
bitfl0wer
1b71c63b1c
reduce code complexity& duplication, fix oversight
2023-04-14 17:11:13 +02:00
bitfl0wer
2e964145bd
reduce code duplication
2023-04-14 17:09:50 +02:00
bitfl0wer
04d03e1d3c
handle resetting rate limits
2023-04-14 16:56:54 +02:00
bitfl0wer
db61974e26
implement update limits
2023-04-12 22:59:08 +02:00
bitfl0wer
e7756ede4f
change return type from Limits to HashMap
2023-04-12 22:18:20 +02:00
bitfl0wer
bceff7dbe5
make code compile
2023-04-12 18:34:20 +02:00
bitfl0wer
8622849ef8
add update_limits (TODO) and add_to_queue
2023-04-12 18:33:16 +02:00
bitfl0wer
252697144f
impl display for limittype, add limittype
2023-04-12 18:32:49 +02:00
bitfl0wer
58c5025afe
add .iter() to Limits
2023-04-12 18:18:55 +02:00
bitfl0wer
ccff2b73c6
Optimize imports, allow dead code where needed
2023-04-12 17:10:12 +02:00
bitfl0wer
bb9575211a
refactor limit.rs, moved some logic
2023-04-12 16:49:18 +02:00
bitfl0wer
5e408bf4d2
me when i write bad code
2023-04-12 15:49:12 +02:00
bitfl0wer
484a6fb24e
Add todo
2023-04-11 21:27:37 +02:00
bitfl0wer
36ead61f09
fix can_send_request
2023-04-11 21:27:06 +02:00
bitfl0wer
ecb1fb0e53
add TODO comment
2023-04-10 21:02:29 +02:00
bitfl0wer
f44bba82a5
add can_send_request, update_limits and send_requests
2023-04-10 20:58:07 +02:00
bitfl0wer
be5546e809
Add docstring, rename var
2023-04-10 17:35:04 +02:00
bitfl0wer
4b4860590b
remove tests, reformat limit display, rename limit
2023-04-10 17:30:02 +02:00
bitfl0wer
dee5fd4631
add: impl display for limit, check_limits
2023-04-10 17:20:02 +02:00
bitfl0wer
78856a2fcd
create new folder structure to map api routes
2023-04-10 14:19:31 +02:00
bitfl0wer
6ec87fc913
create test to... test
2023-04-10 14:18:48 +02:00
bitfl0wer
2829f2e2e0
Remove http
2023-04-10 14:18:33 +02:00
bitfl0wer
2011024771
clean match and replace it with .unwrap_or_else
2023-04-08 23:56:53 +02:00
bitfl0wer
f3ee9b2dd6
get response body string out of result
2023-04-08 23:31:28 +02:00
bitfl0wer
d7ce80ee62
add notes on what needs to be done.
2023-04-08 14:51:36 +02:00
bitfl0wer
bfb63ddb2d
Use Vec<Limit> instead of Limit because there are multiple limits
2023-04-08 14:37:20 +02:00
bitfl0wer
3e84976256
add bucket identifiers, add check_limits stub
2023-04-07 23:22:44 +02:00
bitfl0wer
79cdc6e315
update use statement to match new name
2023-04-07 21:52:09 +02:00
bitfl0wer
bddce47896
replace Box<> with VecDeque<>
2023-04-07 21:51:50 +02:00
bitfl0wer
ea11db8460
start concepting/implementing RateLimiter
2023-04-07 21:01:48 +02:00
bitfl0wer
f6930d3a38
Indicate that code block is of type Rust
2023-04-05 22:19:15 +02:00
bitfl0wer
abcfb8801c
Create files
2023-04-05 21:55:27 +02:00
bitfl0wer
af13830d99
Add url parser and tests
2023-04-05 21:54:27 +02:00
bitfl0wer
5e000afdc6
main -> lib
2023-04-04 17:37:11 +02:00
bitfl0wer
19ebda2887
cargo init
2023-04-04 16:42:20 +02:00