Commit Graph

12 Commits

Author SHA1 Message Date
Taras Kushnir 5bf531bab0 Refactor puzzle verification and issue out of api.Server 2025-08-26 14:49:49 +03:00
Taras Kushnir aa5edef529 Simplify context value checks. Add tags for debug cache logging. 2025-07-27 09:08:20 +03:00
Taras Kushnir 24734338f9 Fix tests 2025-07-26 12:51:48 +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 42f495c141 Use a single rate limiter based on IPs with views 2025-07-07 15:17:32 +03:00
Taras Kushnir fc87e8b063 Mirror cache key extension logic to env vars 2025-07-05 14:59:41 +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 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 0a469c7f9e Update otter to v2 2025-06-17 20:35:18 +03:00
Taras Kushnir 2b36f8d10b Improve monitoring
- split metrics by service (API, portal, cdn, "common")
- fix domain name appended to path in metrics
- fix built-in http dashboard in Grafana
2025-06-08 13:27:37 +03:00
Taras Kushnir 4951055189 Initial commit 2025-05-31 10:56:00 +03:00