Commit Graph

18 Commits

Author SHA1 Message Date
Taras Kushnir 5fd00615e1 Return success for echo puzzles 2025-07-18 17:19:55 +03:00
Taras Kushnir 6bb2d74779 Vibe-code activation keys packer for GitHub Action 2025-07-08 19:47:39 +03:00
Taras Kushnir be96cf3d4c Refactor rate limiter out of auth middleware
Now we have a normalized sequence of "security" middlewares for public endpoints:
1. crash recovery (always first)
2. CDN security (whatever that means)
3. HTTP metrics (prometheus)
4. rate limiter (effect will be visible via metrics, but not logs)
5. out tracing (for logs)
6. All the rest

Since this commit, this sequence is same in both portal and API servers.
2025-07-08 17:56:40 +03:00
Taras Kushnir ebc2c27c68 Cosmetic improvement 2025-07-07 16:20:56 +03:00
Taras Kushnir 468c9c9cc3 Fix typo 2025-07-07 15:19:40 +03:00
Taras Kushnir 42f495c141 Use a single rate limiter based on IPs with views 2025-07-07 15:17:32 +03:00
Taras Kushnir 3466f9a023 Send stack version during activation 2025-07-06 11:19:53 +03:00
Taras Kushnir fc87e8b063 Mirror cache key extension logic to env vars 2025-07-05 14:59:41 +03:00
Taras Kushnir c1e55eed9a Cosmetic improvements
- add common retriable error type
- run license check faster to support issuing logic (external)
- decrease API cache warmup limit to top 50
2025-07-04 16:41:24 +03:00
Taras Kushnir a57d9bba9c Fix linter error 2025-07-03 18:52:50 +03:00
Taras Kushnir b9819b22d1 Embed all key files
This is done in order to make this package more "exportable" for Go.
As a benefit, we also got rid of extra "tests" tag.
2025-07-03 18:32:01 +03:00
Taras Kushnir bab2f69ddf Quit server gracefully on license error 2025-07-02 22:06:40 +03:00
Taras Kushnir 3c2edf64b2 Add EE license check functionality 2025-07-02 14:13:48 +03:00
Taras Kushnir 45d9781640 Cosmetic improvements
- fix not using "order by" for top usage query in CH
- skip querying users from CH entirely because we anyway have to get them
- fix typo in job crash handler
2025-06-21 17:59:15 +03:00
Taras Kushnir bf0598c1a9 Make siteverify API more resilient for unauthorized access
- more aggressive caching of API keys and added cache warmup
- remove direct DB access in APIkey() middleware immediately
- decrease resources usage for test puzzles
- decrease cache collision possibility for cached solved puzzles
- cosmetic improvement in rate limiter and leaky bucket Updater logic
- move user limits check and API key backfill to a separate goroutine
2025-06-21 14:16:28 +03:00
Taras Kushnir 9ec1ef8d65 Refactor caching layer
Main reason being otter/v2 release with APIs for sliding expiration.

- added new cache API to use Loader logic from otter/v2 (fetch from DB)
- main direction of work is improving "negative caching" performance
  (currently it is still intertwined with the main cache)
- expose new Prometheus metric for cache hit ratio
2025-06-21 14:16:28 +03:00
Taras Kushnir f2c64f3cfb Cosmetic security improvements to reduce spam from SonarCloud 2025-06-17 15:04:41 +03:00
Taras Kushnir 4951055189 Initial commit 2025-05-31 10:56:00 +03:00