Files
OmniRoute/src/shared/utils
diegosouzapw ccaa0b5f79 fix(quota): block qtSd models for keys with no quota-pool allocation (Check 2.9)
E2E testing on the VPS showed a normal key (empty allowedQuotas) could call a
qtSd/<group>/<provider>/<model> virtual model and route through a shared quota
pool — because the quota-exclusive enforcement (Check 3) only ran when
allowedQuotas was non-empty, so an unallocated key fell through to the normal
model checks and qtSd was served. This is the "empty allowedQuotas = all pools"
gap from the redesign.

Add Check 2.9 in enforceApiKeyPolicy: if the requested model is a qtSd model and
the key is NOT allocated to any quota pool (allowedQuotas empty), reject 403
QUOTA_NOT_ALLOCATED. Allocated keys are unchanged (Check 3 still validates scope).
This matches the owner's rule: only a key selected in a pool may use its qtSd
models. Normal (non-qtSd) model access for normal keys is unchanged.

Test: tests/unit/apikeypolicy-quota-only.test.ts — new case asserts a non-quota
key is blocked from qtSd (QUOTA_NOT_ALLOCATED) yet still uses normal models.
2026-06-02 07:40:08 -03:00
..
2026-05-29 12:44:29 -03:00
2026-05-26 23:51:47 -03:00
2026-04-30 14:08:50 -03:00
2026-05-23 01:46:59 -03:00
2026-05-26 23:51:47 -03:00
2026-04-28 20:46:25 -03:00
2026-04-30 01:27:03 -03:00
2026-05-26 23:51:47 -03:00
2026-04-28 20:46:25 -03:00
2026-04-30 14:08:50 -03:00
2026-05-27 06:22:15 -03:00
2026-05-26 23:51:47 -03:00
2026-05-26 23:51:47 -03:00