mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-08-05 19:05:28 +00:00
Two changes close the cross-tenant topic leak in /api/conversations/topics. The route at routes/history_routes.py:478 used get_current_user, which returns None when no auth middleware has set request.state.current_user (loopback-bypass, AUTH_ENABLED=false, or any path that short-circuits the middleware). It then forwarded owner=None to analyze_topics. The helper at src/topic_analyzer.py:21 used an 'if owner:' short-circuit in its owner filter, so the None owner took the no-filter path and the helper silently aggregated topic frequencies and per-snippet session_id, session_name, role, and snippet text across every user's sessions. analyze_topics now returns an empty result when owner is falsy. The inner short-circuit is removed because the filter is now strict by construction. The route is switched to require_user, which raises 401 when auth_manager.is_configured is True and the caller is anonymous, matching the pattern used by calendar_routes, skills_routes, and other authenticated routes. The test test_history_topics_owner_scope.py was rewritten to drive the real route through FastAPI's TestClient with a stub AuthMiddleware that mirrors the loopback-bypass branch, and now asserts a strict 401 from the route and an empty result from the helper. The previous version of the test accepted either a 200-with-empty-topics or a 401; the strict assertion means a future regression that drops the require_user wrapper or re-adds the inner short-circuit is caught immediately. |
||
|---|---|---|
| .. | ||
| bombadil-spec.ts | ||
| conftest.py | ||
| test_action_intents.py | ||
| test_agent_loop.py | ||
| test_app.py | ||
| test_app_static_mime.py | ||
| test_auth_event_loop.py | ||
| test_auth_regressions.py | ||
| test_auth_session_revocation.py | ||
| test_backup_cli_security.py | ||
| test_calendar_owner_scope.py | ||
| test_calendar_recurrence.py | ||
| test_chat_stream_scope.py | ||
| test_chroma_client.py | ||
| test_companion_readonly.py | ||
| test_compare_js.py | ||
| test_context_compactor.py | ||
| test_cookbook_helpers.py | ||
| test_deep_research_extraction_controls.py | ||
| test_document_tool_owner_scope.py | ||
| test_endpoint_resolver.py | ||
| test_esc_menu_stack_js.py | ||
| test_gallery_image_privileges.py | ||
| test_history_topics_owner_scope.py | ||
| test_hwfit_macos.py | ||
| test_keybind_altgr_js.py | ||
| test_llm_core_anthropic_cache.py | ||
| test_llm_core_concurrency.py | ||
| test_llm_core_ollama.py | ||
| test_llm_core_sanitize_tool_calls.py | ||
| test_markitdown_runtime.py | ||
| test_memory_extractor_vector_degraded.py | ||
| test_model_context.py | ||
| test_model_routes.py | ||
| test_null_owner_gates.py | ||
| test_pdf_runtime.py | ||
| test_personal_docs_office_index.py | ||
| test_personal_docs_pdf_index.py | ||
| test_personal_upload_isolation.py | ||
| test_provider_detection.py | ||
| test_rate_limiter.py | ||
| test_reply_recipients_js.py | ||
| test_research_query_fallback.py | ||
| test_research_service.py | ||
| test_research_session_id_validation.py | ||
| test_research_utils.py | ||
| test_reserved_username_admin_escalation.py | ||
| test_review_regressions.py | ||
| test_search_cache_invalidation.py | ||
| test_search_query.py | ||
| test_search_ranking.py | ||
| test_security_regressions.py | ||
| test_session_mode_helpers.py | ||
| test_settings_scrub.py | ||
| test_setup_admin_user.py | ||
| test_shell_routes.py | ||
| test_skill_index_prompt_injection.py | ||
| test_skills_manager_owner_isolation.py | ||
| test_speech_service_toggles.py | ||
| test_task_scheduler_session_delivery.py | ||
| test_vision_model_detection.py | ||
| test_visual_report.py | ||
| test_webhook_trigger_auth_exempt.py | ||