Files
OmniRoute/src/app/api
Andrew B. adbcd2c8bc fix(auth): gate invalid-key check on isRequireApiKeyEnabled for embeddings and web-fetch (#7785) (#7810)
* fix(auth): gate invalid-key check on isRequireApiKeyEnabled for embeddings and web-fetch (#7785)

When REQUIRE_API_KEY=false, /v1/embeddings and /v1/web/fetch still returned
401 for invalid presented keys while all other client APIs allowed anonymous
access. The route-local invalid-key check was not gated on
isRequireApiKeyEnabled(), unlike the /v1/combos pattern.

Gate the invalid-key check on isRequireApiKeyEnabled() in both route files so
anonymous access works consistently across all client APIs.

Refs: https://github.com/diegosouzapw/OmniRoute/issues/7785

* fix(tests): set REQUIRE_API_KEY=true in embeddings-auth invalid-key subtest

The "should return 401 when an invalid API key is provided" test now
correctly sets REQUIRE_API_KEY="true" so the route-level gated check
is exercised. Before, the test asserted 401 when REQUIRE_API_KEY was
not set, which after #7785 fix now returns 400 (model validation fails)
instead of 401.

* test(auth): assert anonymous-passthrough in embeddings-auth legacy suite (#7785)

Per #7785's acceptance criteria, the pre-existing embeddings regression
test must assert BOTH enforcement states, not just the enforced-401
case. Add the missing REQUIRE_API_KEY=false + invalid-key subtest
alongside the already-fixed REQUIRE_API_KEY=true + invalid-key subtest,
matching the coverage already present in the dedicated
auth-policy-embeddings-webfetch-7785.test.ts suite.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-07-20 10:08:19 -03:00
..
2026-07-07 13:14:06 -03:00
2026-04-30 14:08:50 -03:00
2026-04-19 19:50:30 -03:00
2026-06-11 18:52:29 -03:00
2026-07-13 09:12:40 -03:00
2026-05-10 00:55:06 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-06-19 06:49:01 -03:00
2026-07-06 02:25:17 -03:00
2026-07-13 09:12:40 -03:00
2026-05-26 23:51:47 -03:00
2026-07-13 09:12:40 -03:00
2026-07-04 13:00:30 -03:00
2026-06-23 17:06:18 -03:00
2026-05-26 23:51:47 -03:00
2026-04-22 12:26:21 -03:00
2026-06-11 18:52:29 -03:00
2026-07-13 09:12:40 -03:00
2026-06-26 02:51:06 -03:00
2026-06-12 23:49:22 -03:00
2026-06-30 06:54:29 -03:00
2026-06-27 09:07:12 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-06-23 17:06:18 -03:00
2026-07-13 09:12:40 -03:00
2026-06-11 18:52:29 -03:00
2026-06-04 20:05:38 -03:00
2026-05-26 23:51:47 -03:00
2026-06-27 09:07:12 -03:00
2026-07-07 13:14:06 -03:00
2026-05-26 23:51:47 -03:00
2026-07-13 09:12:40 -03:00
2026-05-26 23:51:47 -03:00
2026-07-13 09:12:40 -03:00
2026-07-02 10:47:13 -03:00
2026-05-26 23:51:47 -03:00
2026-05-26 23:51:47 -03:00
2026-04-30 01:27:03 -03:00
2026-07-07 13:14:06 -03:00
2026-06-30 06:54:29 -03:00