Taras Kushnir
2a73f2dd07
Use easyjson for marshaling json. related PrivateCaptcha/issues#98
...
apparently json.Marshal() was taking about 3% of all CPU time for /verify
2026-01-27 20:49:16 +02:00
Taras Kushnir
a7802098e6
Add load test for verify endpoint. closes PrivateCaptcha/issues#98
2026-01-27 20:46:13 +02:00
Copilot
acae441a99
Improve test coverage for puzzle, portal, monitoring packages ( #264 )
...
* Initial plan
* Add tests for puzzle, monitoring, portal packages
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Add registration disabled tests
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Address PR review comments: fix tests and use constants
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Fix audit tests with non-empty arrays and use constants for error strings
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Update audit.go
* Update audit.go
---------
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-27 12:35:41 +02:00
Taras Kushnir
354967a96c
Bump ClickHouse version to 25.6.2
2026-01-26 15:11:26 +02:00
Taras Kushnir
315248bba0
Fix CI
2026-01-26 14:40:41 +02:00
Taras Kushnir
d355541170
Cosmetic improvement
2026-01-26 14:29:03 +02:00
Taras Kushnir
3c3f31a59d
Fix heredoc in bash
2026-01-26 14:24:38 +02:00
Taras Kushnir
c662aa30a1
Add option to have admin pwd for ClickHouse
2026-01-26 13:03:06 +02:00
Taras Kushnir
e8999c9a16
Move to bash scripts for DB init in Docker
2026-01-26 11:31:36 +02:00
Taras Kushnir
8a86a435b4
Fix typos
2026-01-24 08:43:48 +02:00
Taras Kushnir
d2867e7101
Rename drop metric location
2026-01-23 17:34:22 +02:00
Taras Kushnir
56b86be273
Add missing enum for test [ci skip]
2026-01-23 17:27:26 +02:00
Taras Kushnir
e72cf3c38a
Record last used time for API keys. closes PrivateCaptcha/issues#166
2026-01-23 17:13:39 +02:00
Taras Kushnir
9048bcaa5a
Add timeouts for channel selects
2026-01-23 16:59:37 +02:00
Taras Kushnir
7d42e32de6
Remove unused code
2026-01-23 14:10:22 +02:00
Taras Kushnir
894b884de5
Add http timeout for license activation
2026-01-22 20:43:06 +02:00
Taras Kushnir
4f8d2a9ff0
Respect context cancellation in backoff wait
2026-01-20 18:38:26 +02:00
Copilot
091e6d38bc
Make audit log parsing extensible for downstream repositories ( #258 )
...
* Initial plan
* Make audit log parsing extensible with AuditLogParser and template override
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Simplify AuditLogParser interface by removing unused handled return value
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-20 11:57:35 +02:00
Copilot
9f101a13ff
Split settings usage stats by organization ( #256 )
...
* Initial plan
* Split account stats by organization
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Fix usage chart layout and stats handler
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Address code review feedback
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Clarify account stats warning log
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Adjust stats logging and legend layout
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Move legend sizing constants
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Document legend sizing constants
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Refine legend text measurement
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Improve legend truncation and logging
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Cosmetic improvements
* Refactor legend layout logic
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Tweak legend row spacing
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Clarify legend layout fields
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 >
Co-authored-by: Taras Kushnir <tk.dev@mailbox.org >
2026-01-17 09:56:46 +02:00
Taras Kushnir
64ceb48321
Remove unused code
2026-01-15 14:57:51 +02:00
Taras Kushnir
809a667bf9
Allow localhost subdomains
2026-01-15 14:52:54 +02:00
Taras Kushnir
0f70c38529
Add more tests
...
80% done by Claude Opus 4.5 w/ copilot, but not quite
2026-01-15 14:35:13 +02:00
Copilot
e09db1dbb8
Allow org members without subscription to create properties via API ( #251 )
...
* Initial plan
* Allow org members without subscription to create properties via API
- Add requestUserEx() to allow skipping subscription check
- Update postNewProperties() to not require user subscription (org owner subscription is checked instead)
- Update getAsyncTask() to not require user subscription
- Add integration tests for Portal and API to verify org members can create properties
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Fix TestApiPostPropertiesNoSubscription to check API error code
Update test to use requestResponseAPISuite and check for StatusSubscriptionPropertyLimitError instead of HTTP 402
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Refactor tests and fix task handler subscription check
- Fix getAsyncTask to require subscription (nil subscriptions blocked, expired trials allowed)
- Refactor API tests with helper functions createPropertyInputs, waitForAsyncTaskCompletion
- Refactor API and Portal tests as test suites for nil and expired trial subscriptions
- Add step to test non-member rejection before join in API tests
- Simplify Portal tests to focus on member property creation
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Fix redundant imports in property_test.go
Use consistent db_test alias instead of multiple aliases for the same package
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Add non-member rejection test and refactor async task wait helpers
- Add non-member rejection step in API tests (verifies 403 Forbidden before invite)
- Simplify Portal tests (just verify member can create properties after joining)
- Refactor multiple async task wait loops to use waitForAsyncTaskCompletion helper
- Add waitForAsyncTaskCompletionWithResult helper for tests that need results
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Ensure invited-but-not-joined members cannot create properties
- Add RetrieveUserOrganizationMember() that excludes invited users
- Add requestOrgMember() API helper that uses the new function
- Add OrgMember() Portal helper that uses the new function
- Update postNewProperties() to use requestOrgMember()
- Update postNewOrgProperty() to use OrgMember()
- Add test steps for invited-but-not-joined rejection in API and Portal tests
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Refactor: return access level from requestOrg/Org instead of new functions
- Modify RetrieveUserOrganization to return access level as third value
- Delete RetrieveUserOrganizationMember function
- Modify requestOrg to return access level as third value
- Delete requestOrgMember function
- Modify Org to return access level as third value
- Delete OrgMember function
- Update all callers to ignore unused access level return values
- Check access level in postNewProperties and postNewOrgProperty to block invited users
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Fix code review: use 403 Forbidden and check level.Valid
- Use HTTP 403 Forbidden instead of 500 in Portal for invited users
- Add level.Valid check before accessing level.AccessLevel
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-15 12:06:34 +02:00
Copilot
7d1ef63389
Add t.Helper annotations to Go test helpers ( #253 )
...
* Initial plan
* test: mark helper functions with t.Helper
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-14 19:20:53 +02:00
Taras Kushnir
5cffff09d8
Use status recorder also for recovered middleware
2026-01-12 19:11:09 +02:00
Taras Kushnir
8b160436fe
Use http request with context
2026-01-12 12:15:57 +02:00
Taras Kushnir
d1c0a1afcb
Split timeout handler into soft and hard
...
- fix potential superfluous writes like the stdlib http.TimeoutHandler
- we don't want to run extra goroutines on public unauthenticated methods
2026-01-12 12:13:02 +02:00
Taras Kushnir
c9da66dc33
Use backoff and multiple attempts to ping DBs
2026-01-12 09:58:33 +02:00
Taras Kushnir
688ace5196
Cosmetic improvement
2026-01-11 20:05:45 +02:00
Taras Kushnir
9f1c81af51
Fix typo
2026-01-11 19:42:32 +02:00
Taras Kushnir
ebdeb3ea05
Cosmetic improvement
2026-01-11 19:30:02 +02:00
Taras Kushnir
e1f0e612f3
Use standard timeout handler
2026-01-11 15:51:04 +02:00
Taras Kushnir
f3dd1fafcb
Use portal mailer in tests instead of stub mailer
2026-01-11 15:44:15 +02:00
Taras Kushnir
3f3c0988bf
Add more tests
...
With copilot. Merged maually due to bugs
2026-01-10 17:42:05 +02:00
Taras Kushnir
5926536d2c
Revert redirect 'fix'
2026-01-10 12:13:47 +02:00
Taras Kushnir
27495ae7ee
Cosmetic improvements
2026-01-10 12:04:42 +02:00
Taras Kushnir
79965c7e72
Fix tests
2026-01-10 12:01:07 +02:00
Taras Kushnir
341d071c65
Add cosmetic validation for email domains
2026-01-10 11:52:02 +02:00
Taras Kushnir
2c98081185
Improve org invitation functionality. related PrivateCaptcha/issues#227
...
- Prefill email address for the invite link
- show masked email in members list
- improve usual register flow too
2026-01-10 11:50:09 +02:00
Taras Kushnir
8442b9e7b2
Allow inviting users without accounts. closes PrivateCaptcha/issues#227
2026-01-10 09:51:54 +02:00
Taras Kushnir
f02b7fca9e
Remove unused code
2026-01-09 15:54:12 +02:00
Taras Kushnir
336353e551
Add negative test coverage for portal endpoint
...
Done by copilot, merged manually due to conflicts
2026-01-09 09:59:26 +02:00
Taras Kushnir
19991f1fb7
Cosmetic improvements
2026-01-08 20:31:08 +02:00
Copilot
7d1247848b
Add organization transfer feature ( #240 )
...
* Initial plan
* Initial plan for organization transfer feature
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Add organization transfer feature with UI, DB layer, and integration test
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Address PR feedback: verify old owner in property transfer, swap org membership, show masked email in audit, add negative tests
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 20:25:09 +02:00
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
18ec9715a0
Cosmetic improvements
2026-01-07 18:37:13 +02:00
Copilot
d00d9ce9cb
Add unit and integration tests for code coverage improvements ( #238 )
...
* Initial plan
* Initial planning for code coverage improvements
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Add unit tests for code coverage improvements
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Fix integration test failures and add more tests for code coverage
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Address code review feedback - simplify status code conversion
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Address PR review feedback: use config.NewStaticValue() and improve test assertions
Co-authored-by: ribtoks <505555+ribtoks@users.noreply.github.com >
* Add remaining tests: ChunkedCleanup, audit_enterprise, echoPuzzle
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 18:29:04 +02:00