• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

safe-global / safe-auth-service / 43393311894
97%

Build:
DEFAULT BRANCH: main
Ran 13 Nov 2026 08:29AM UTC
Jobs 1
Files 117
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 Nov 2026 08:26AM UTC coverage: 94.743% (+0.1%) from 94.627%
43393311894

push

github

web-flow
Add quota usage endpoint (PLA-2228) (#507)

* Add quota usage endpoint (PLA-2228)

The dashboard meter and the Attio sync need per-account quota numbers, but
only the gateway knew them and only exposed them through response headers.
GET /api/v1/users/quota reads the limit-count counter APISIX keeps in Redis
so used and reset date match the headers, adds the rejected requests and a
run-out projection from Datadog history, and caches the result for a minute.
The logic is a plain function over a user so the Attio sync can reuse it.

* Read quota usage from the internal APISIX route instead of its Redis

Reading the gateway's Redis from the auth service was rejected on security
grounds. PLA-2298 exposes an internal route on the APISIX data plane that
returns limit, remaining, rejected and reset for a consumer group, so the
service no longer needs Redis credentials, the counter key format or the
admin API. Also fixes the run-out test, which compared against a timestamp
taken at import time.

* Address review on the quota endpoint

Rename the setting to the data plane URL and add it to the env files,
raise a dedicated error when the consumer group has no limit-count plugin,
register the route only when the monthly quota is enabled, move the cache
TTL to settings, build the response once and reuse the shared aiohttp test
helper. The two APISIX client tests that relied on the quota being off by
default now disable it explicitly.

* Project the run-out date from the current billing cycle

Product decision on PLA-2228: drop the first rejection date and estimate the run-out date linearly from the calls made so far in the cycle, so the quota service no longer needs Datadog.

* Rename the quota client to the generic APISIX data plane client

The client talks to the APISIX data plane and can serve other internal routes than the quota one, so the class, factory and base exception no longer carry the quota name.

* Update app/services/quota_service.py

Co-authored-by... (continued)

3208 of 3386 relevant lines covered (94.74%)

0.95 hits per line

Coverage Regressions

Lines Coverage ∆ File
15
80.95
1.47% app/routers/users.py
1
99.31
0.01% app/config.py
Jobs
ID Job ID Ran Files Coverage
1 43393311894.1 13 Nov 2026 08:29AM UTC 117
94.74
GitHub Action Run
Source Files on build 43393311894
  • Tree
  • List 117
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • acc0e6ca on github
  • Prev Build on main (#43021310028)
  • Next Build on main (#43411089164)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc