Commit Graph

100 Commits

Author SHA1 Message Date
Copilot
bc5f8a9d6e Add test coverage for maintenance jobs, rate limiter, cache, and portal handlers (#241)
* Initial plan

* Add unit tests for improved test coverage

Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com>

* Address code review feedback

Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com>

* Move integration tests to pkg/api and pkg/portal, fix TestResend2FA logic

Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com>

* Fix code review issues: remove unused import and fix job name generation

Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com>

* Fix TestResend2FA tests: add CSRF token and verify codes are different

Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com>
2026-01-08 19:56:39 +02:00
Taras Kushnir
ae0972b1d1 Fix build 2026-01-08 08:46:13 +02:00
Taras Kushnir
bb82daa529 Make global variables in tests consistent 2026-01-08 08:44:33 +02:00
Copilot
b9a3945ff0 Add negative codepath tests for API endpoints (#242)
* Initial plan

* Add negative codepath tests for API endpoints

Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com>

* Fix task test for invalid UUID format

Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com>

* Fix code review feedback - use t.Fatalf for consistency

Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com>
2026-01-07 20:25:08 +02:00
Taras Kushnir
f534ee7ec5 Add a mode to run tests without ClickHouse 2026-01-06 15:46:24 +02:00
Taras Kushnir
8112359ef9 Add more tests 2026-01-02 18:44:17 +02:00
Taras Kushnir
acc2e09427 Add timeout config for periodic jobs 2025-12-25 13:33:19 +01:00
Taras Kushnir
cbdc994e0d Add Org scope to API keys. closes PrivateCaptcha/issues#237 2025-12-22 18:54:47 +01:00
Taras Kushnir
1478f7a376 Add read-only attribute to the scope of API key 2025-12-22 14:33:26 +01:00
Taras Kushnir
782dbb5f34 Validate API requests while reading JSON 2025-12-22 12:50:08 +01:00
Taras Kushnir
727fbfa93e Preallocate map size 2025-12-22 12:47:18 +01:00
Taras Kushnir
f308e55d91 Make properties API to use PUT 2025-12-19 20:02:27 +01:00
Taras Kushnir
f446e2884d Add API to get a single property. related PrivateCaptcha/issues#45 2025-12-18 18:17:51 +01:00
Taras Kushnir
3475c9c1e2 Add API to batch-update properties. related PrivateCaptcha/issues#45 2025-12-18 14:28:55 +01:00
Taras Kushnir
8386d16fe6 Cosmetic improvement 2025-12-18 11:02:33 +01:00
Taras Kushnir
50945a6480 Fix typo 2025-12-17 19:27:53 +01:00
Taras Kushnir
a01792ffd8 Add API to get properties. related PrivateCaptcha/issues#45 2025-12-17 19:16:18 +01:00
Taras Kushnir
66d842413a Split portal and DB page size for properties 2025-12-17 19:01:35 +01:00
Taras Kushnir
05e653631e Add pagination support for org properties. related PrivateCaptcha/issues#45 2025-12-17 18:32:41 +01:00
Taras Kushnir
653b91f86e Add API support to delete properties. related PrivateCaptcha/issues#45 2025-12-17 12:55:49 +01:00
Taras Kushnir
b959c00af8 Add create properties bulk API. related PrivateCaptcha/issues#45 2025-12-15 15:43:05 +01:00
Taras Kushnir
85ca8c5a7a Add preliminary basic version of orgs API. related PrivateCaptcha/issues#45 2025-12-10 21:15:02 +01:00
Taras Kushnir
9effd7a5df Refactor API server routes mounting 2025-12-08 17:45:52 +01:00
Taras Kushnir
57636bbf48 Add API key scope 2025-12-08 12:44:42 +01:00
Taras Kushnir
9151c22370 Cache chart stats also on the server level 2025-12-07 20:13:18 +01:00
Taras Kushnir
916bb28dd6 Add separate test for verifying test property with another sitekey 2025-12-03 16:38:22 +01:00
Taras Kushnir
58b0573a6d Add comment to flaky test 2025-12-03 11:25:33 +01:00
Taras Kushnir
008c5bea0f Fix tests 2025-12-03 11:07:13 +01:00
Taras Kushnir
cbab265d85 Send verify response instead of http code for sitekey verification 2025-12-02 21:42:01 +01:00
Taras Kushnir
1ac836c713 Fix tests 2025-12-02 20:44:47 +01:00
Taras Kushnir
c2c3fa9156 Cosmetic improvements 2025-12-02 19:55:25 +01:00
Taras Kushnir
14fa5396e5 Add more user-friendly http error body response 2025-12-02 19:21:24 +01:00
Taras Kushnir
da93cf591b Check expected sitekey in /verify 2025-12-02 18:52:43 +01:00
Taras Kushnir
fdd3d7d47b Add passthrough API headers 2025-11-27 12:10:43 +02:00
Taras Kushnir
2d67bc1875 Add more logs to sitekey endpoint for errors 2025-11-24 07:59:11 +02:00
Taras Kushnir
d8e97404d9 Tune down sitekey cached errors 2025-11-24 07:55:55 +02:00
Taras Kushnir
fa8422d1c7 Add basic auditlogs implementation. closes PrivateCaptcha/issues#204 2025-11-22 19:39:18 +02:00
Taras Kushnir
f1013af2c3 Add backpressure for org member checks 2025-11-19 14:34:18 +02:00
Taras Kushnir
884a5d2117 Force recheck user limits upon joining the org 2025-11-19 14:11:04 +02:00
Taras Kushnir
cc697aa71e Cosmetic improvement 2025-11-19 11:08:46 +02:00
Taras Kushnir
81e01d80ee Include property org members for limit checks backfill 2025-11-19 11:05:26 +02:00
Viktor Szépe
c2990f579b Correct misspellings (#217) 2025-11-19 09:40:16 +02:00
Taras Kushnir
cf374ab0e3 Add more logs for requests cut by user limiter 2025-11-19 09:33:23 +02:00
Taras Kushnir
0ae7d84009 Split user limiter into properties and API 2025-11-19 09:31:37 +02:00
Taras Kushnir
15a9082b16 Allow organization members to access verify API for property
meaning even when these members don't have an active subscription
2025-11-19 08:28:10 +02:00
Taras Kushnir
f8c1bbbaae Add log for limited users 2025-11-19 08:28:10 +02:00
Taras Kushnir
16e4244077 Add functionality to backfill potential stale session in portal
Also get rid of unnecessary changes from previous commit
2025-11-16 21:09:16 +02:00
github-actions[bot]
19acfe7c6e Fix code style issues (#208)
Co-authored-by: GitHub Action <action@github.com>
2025-10-26 08:19:09 +02:00
Taras Kushnir
a05a7563a9 Add cosmetic spot check for the most stupid bots 2025-10-16 13:06:29 +03:00
Taras Kushnir
57f788f667 Backfill stub puzzle access records 2025-10-13 14:17:24 +03:00