mirror of
https://github.com/DeBrosOfficial/orama.git
synced 2026-06-17 02:34:12 +00:00
APIKeyToJWTHandler looked up the namespace by the raw api key, but keys are stored HMAC-hashed (Service.HashAPIKey), so it always returned 'invalid API key' for real keys — no api-key holder could exchange for a JWT. Resolve the hashed key first with a raw-key fallback for legacy rows, mirroring the gateway middleware's lookupAPIKeyNamespace. Adds args-aware mock + tests for the hashed-key, raw-fallback, and unknown-key paths.