|
|
|
|
@ -46,7 +46,17 @@ async fn put_settings_without_auth_returns_401() {
|
|
|
|
|
"max_age_days": 7,
|
|
|
|
|
"categories": ["Cat"],
|
|
|
|
|
"max_items_per_category": 4,
|
|
|
|
|
"search_agent_behavior": ""
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// PUT without a session cookie
|
|
|
|
|
@ -121,7 +131,17 @@ async fn put_settings_with_valid_data_returns_200() {
|
|
|
|
|
"max_age_days": 14,
|
|
|
|
|
"categories": ["Vulnerabilites", "Patch Tuesday", "Threat Intel"],
|
|
|
|
|
"max_items_per_category": 6,
|
|
|
|
|
"search_agent_behavior": "Focus on CVEs"
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "Focus on CVEs",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
let (status, body) = app
|
|
|
|
|
@ -167,7 +187,17 @@ async fn put_then_get_returns_updated_data() {
|
|
|
|
|
"max_age_days": 30,
|
|
|
|
|
"categories": ["Macro", "Finance"],
|
|
|
|
|
"max_items_per_category": 10,
|
|
|
|
|
"search_agent_behavior": "Francophone sources"
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "Francophone sources",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (put_status, _) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update, &session)
|
|
|
|
|
@ -207,7 +237,17 @@ async fn put_settings_empty_theme_returns_422() {
|
|
|
|
|
"max_age_days": 7,
|
|
|
|
|
"categories": ["Cat"],
|
|
|
|
|
"max_items_per_category": 4,
|
|
|
|
|
"search_agent_behavior": ""
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (status, body) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update, &session)
|
|
|
|
|
@ -239,7 +279,17 @@ async fn put_settings_too_many_categories_returns_422() {
|
|
|
|
|
"max_age_days": 7,
|
|
|
|
|
"categories": categories,
|
|
|
|
|
"max_items_per_category": 4,
|
|
|
|
|
"search_agent_behavior": ""
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (status, body) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update, &session)
|
|
|
|
|
@ -270,7 +320,17 @@ async fn put_settings_empty_categories_returns_422() {
|
|
|
|
|
"max_age_days": 7,
|
|
|
|
|
"categories": [],
|
|
|
|
|
"max_items_per_category": 4,
|
|
|
|
|
"search_agent_behavior": ""
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (status, body) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update, &session)
|
|
|
|
|
@ -302,7 +362,17 @@ async fn put_settings_max_age_days_out_of_range_returns_422() {
|
|
|
|
|
"max_age_days": 0,
|
|
|
|
|
"categories": ["Cat"],
|
|
|
|
|
"max_items_per_category": 4,
|
|
|
|
|
"search_agent_behavior": ""
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (status, _) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update, &session)
|
|
|
|
|
@ -319,7 +389,17 @@ async fn put_settings_max_age_days_out_of_range_returns_422() {
|
|
|
|
|
"max_age_days": 366,
|
|
|
|
|
"categories": ["Cat"],
|
|
|
|
|
"max_items_per_category": 4,
|
|
|
|
|
"search_agent_behavior": ""
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (status2, _) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update2, &session)
|
|
|
|
|
@ -348,7 +428,17 @@ async fn put_settings_max_items_out_of_range_returns_422() {
|
|
|
|
|
"max_age_days": 7,
|
|
|
|
|
"categories": ["Cat"],
|
|
|
|
|
"max_items_per_category": 51,
|
|
|
|
|
"search_agent_behavior": ""
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (status, _) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update, &session)
|
|
|
|
|
@ -385,7 +475,17 @@ async fn settings_are_per_user_isolated() {
|
|
|
|
|
"max_age_days": 3,
|
|
|
|
|
"categories": ["A-Category"],
|
|
|
|
|
"max_items_per_category": 2,
|
|
|
|
|
"search_agent_behavior": "User A behavior"
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "User A behavior",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (status_a, _) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update_a, &session_a)
|
|
|
|
|
@ -398,7 +498,17 @@ async fn settings_are_per_user_isolated() {
|
|
|
|
|
"max_age_days": 14,
|
|
|
|
|
"categories": ["B-Category-1", "B-Category-2"],
|
|
|
|
|
"max_items_per_category": 8,
|
|
|
|
|
"search_agent_behavior": "User B behavior"
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "User B behavior",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (status_b, _) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update_b, &session_b)
|
|
|
|
|
@ -442,7 +552,17 @@ async fn put_settings_boundary_values_succeed() {
|
|
|
|
|
"max_age_days": 1,
|
|
|
|
|
"categories": ["C"],
|
|
|
|
|
"max_items_per_category": 1,
|
|
|
|
|
"search_agent_behavior": ""
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "",
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (status, _) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update_min, &session)
|
|
|
|
|
@ -456,7 +576,17 @@ async fn put_settings_boundary_values_succeed() {
|
|
|
|
|
"max_age_days": 365,
|
|
|
|
|
"categories": categories_max,
|
|
|
|
|
"max_items_per_category": 50,
|
|
|
|
|
"search_agent_behavior": "a".repeat(2000)
|
|
|
|
|
"max_articles_per_source": 3,
|
|
|
|
|
"use_llm_for_source_links": false,
|
|
|
|
|
"use_brave_search": false,
|
|
|
|
|
"article_history_days": 90,
|
|
|
|
|
"batch_size": 5,
|
|
|
|
|
"search_agent_behavior": "a".repeat(2000),
|
|
|
|
|
"ai_provider": "",
|
|
|
|
|
"ai_model": "",
|
|
|
|
|
"ai_model_websearch": "",
|
|
|
|
|
"rate_limit_max_requests": null,
|
|
|
|
|
"rate_limit_time_window_seconds": null
|
|
|
|
|
});
|
|
|
|
|
let (status2, _) = app
|
|
|
|
|
.put_with_session("/api/v1/settings", &update_max, &session)
|
|
|
|
|
|