ulysses/services/search
Ethan 33bf975597
Stop GET /api/search/config from leaking the Brave API key (#1661) (#1750)
get_search_config returned SEARCH_CONFIG.copy(), and update_search_config
cached the decrypted Brave key into that shared global at startup
(app_initializer), so the unauthenticated /api/search/config route exposed
the operator's key. The cache was dead weight: brave_search reads its key
via _get_provider_key (settings/env), never SEARCH_CONFIG.

- update_search_config: no longer stores the api_key in the shared global
  (accepted for backward compat; provider keys are read on demand).
- get_search_config: scrub any string-valued credential field before
  returning, preserving the has_api_key presence flag.

No schema change; brave_search/_get_provider_key untouched. Adds regression
tests.

Fixes #1661

Co-authored-by: Ethan <23321960+0xLeathery@users.noreply.github.com>
2026-06-03 13:24:17 +09:00
..
__init__.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
analytics.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
cache.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
content.py fix: extract_statistics drops large numbers and trailing % signs (#1153) 2026-06-02 22:35:30 +09:00
core.py Stop GET /api/search/config from leaking the Brave API key (#1661) (#1750) 2026-06-03 13:24:17 +09:00
providers.py Report provider-specific search API keys correctly (#1202) 2026-06-02 23:37:15 +09:00
query.py fix: search query helpers crash on a non-string query (#1604) 2026-06-03 08:36:01 +09:00
ranking.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
service.py Odysseus v1.0 2026-05-31 23:58:26 +09:00