30 Commits

Author SHA1 Message Date
Aravinth Manivannan
ad4582cc16
feat: record and fetch max recorded nonces 2023-10-29 06:27:58 +05:30
Aravinth Manivannan
4e2758f415
chore: clippy lints 2023-10-16 21:50:53 +05:30
Aravinth Manivannan
0e75a22beb
chore: bump sqlx to 0.7 2023-10-16 21:15:44 +05:30
Aravinth Manivannan
78d85ab9a9
feat: annotate license headers using reuse on text source files 2023-07-03 23:19:51 +05:30
Aravinth Manivannan
32762cf6b5
fix: linting 2023-07-02 22:04:42 +05:30
Aravinth Manivannan
1e0aedad61
chore: linting 2023-07-02 21:51:24 +05:30
Aravinth Manivannan
2cf5e48d8e
feat: log pow performance stats while pow verification 2023-06-30 03:19:38 +05:30
realaravinth
21825582e5
feat: fallabck to localhost when running tests 2022-08-09 16:29:24 +05:30
realaravinth
c377cf431e
feat & fix: ip queues 2022-08-09 02:52:17 +05:30
Kian-Meng Ang
bb42841a66 Fix typos 2022-08-04 23:06:54 +08:00
realaravinth
249b6461ee
chore: migrate tests to also run with mariadb 2022-07-23 11:59:42 +05:30
realaravinth
098d0cfc24
feat: migrate fetching stats to use db_* 2022-05-27 17:11:15 +05:30
realaravinth
bbc8873762
feat: migrate record_stats to use db_* 2022-05-27 16:23:33 +05:30
realaravinth
4cd4605266
chore: use local app ctx 2022-05-27 15:25:10 +05:30
realaravinth
a971d4209d
fix and chore: refactor tests to minimize initializing DB connections
SUMMARY
    The test suite was spinning up way too many database connections that what's
    strictly needed and so the test suite was failing with[0]:
	code: "53300", message: "sorry, too many clients already"

EXPERIMENTS
    Tried sharing database connection pool across all tests with
    async_once[0] but faced:
	- IO errors
	    The connections were probably getting dropped in between tests
	- actix Actor errors
	    The actor was probably not getting initialized before a
	    a reference to the async_once initialized app
	    context(crate::data::Data) is retrieved and used

FIX
    crate::tests was spinning up an App context
    instance(crate::data::Data) for most utility functions, which was
    unnecessarily excessive.

    Each test now creates an instance of the application context at the
    beginning and shared a reference with all test utility functions. So
    number of database connections/app context instance = number of unit
    tests.

[0]: permanently fixes #22
[1]: https://docs.rs/async_once/latest/async_once/
2022-05-14 12:55:56 +05:30
realaravinth
fc8a1670d2
update copyright notice 2022-01-08 22:16:05 +05:30
realaravinth
b5af9ee259
it appears actix-web's scope behaviour has changed in the latest beta
release:

Routes 404'd when scope contained trailing slash like so:
let scope = "/api/v1/pow/";
web::scope(scope)//

So had to rm trailing slash in scope
2021-11-29 17:33:08 +05:30
realaravinth
147f563ec8
demo user task 2021-08-09 11:56:25 +05:30
realaravinth
b7ec1bca22
duplicate email check and address clippy warnings 2021-07-11 21:46:50 +05:30
realaravinth
f5624947b9
redis storage for captcha mech 2021-06-11 19:31:03 +05:30
realaravinth
9e70f8f756
rename guard -> mcaptcha 2021-06-01 17:33:47 +05:30
realaravinth
fcdbe66b26
captcha stats 2021-05-27 14:47:29 +05:30
realaravinth
72667bd2e1
using custom version of actix-codegen and cors for pow routes 2021-05-25 14:34:24 +05:30
realaravinth
91ca00ea79
get notifications 2021-05-10 15:38:09 +05:30
realaravinth
527724ecda
pow stats for solution and verification 2021-05-09 19:33:28 +05:30
realaravinth
0829ee1c74
pow uses const routes 2021-05-02 17:13:04 +05:30
realaravinth
1b0dfd8082
routes updated 2021-04-12 10:45:53 +05:30
realaravinth
c776092023
scoped cors 2021-04-12 10:25:52 +05:30
realaravinth
bbf182a918
changes to test suite to use new routes 2021-04-11 23:50:53 +05:30
realaravinth
a3f060350c
moved pow to independent module 2021-04-11 22:57:56 +05:30