mirror of
https://github.com/BaaRai/ARTEX.git
synced 2026-11-18 06:00:54 +08:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75efc29323 | ||
|
|
6337341602 | ||
|
|
b452b13989 | ||
|
|
0ec264ddeb |
@@ -143,6 +143,8 @@ func (c *ChatAgent) Chat(ctx context.Context, agentKey, sessionID, message strin
|
||||
WebSearchBackend: ws.Backend,
|
||||
BraveSearchAPIKey: ws.BraveKey,
|
||||
TavilySearchAPIKey: ws.TavilyKey,
|
||||
KeenableSearchAPIKey: ws.KeenableKey,
|
||||
KeenableSearchTitle: KeenableSearchTitle,
|
||||
DeepSeekSearchBaseURL: ws.DeepSeekBaseURL,
|
||||
DeepSeekSearchAPIKey: ws.DeepSeekAPIKey,
|
||||
DeepSeekSearchModel: ws.DeepSeekModel,
|
||||
|
||||
@@ -148,6 +148,8 @@ func (m *MainAgent) Chat(ctx context.Context, taskID int64, mainSeg int, as *db.
|
||||
WebSearchBackend: m.webSearch.Backend,
|
||||
BraveSearchAPIKey: m.webSearch.BraveKey,
|
||||
TavilySearchAPIKey: m.webSearch.TavilyKey,
|
||||
KeenableSearchAPIKey: m.webSearch.KeenableKey,
|
||||
KeenableSearchTitle: KeenableSearchTitle,
|
||||
DeepSeekSearchBaseURL: m.webSearch.DeepSeekBaseURL,
|
||||
DeepSeekSearchAPIKey: m.webSearch.DeepSeekAPIKey,
|
||||
DeepSeekSearchModel: m.webSearch.DeepSeekModel,
|
||||
|
||||
@@ -541,6 +541,8 @@ func (p *Planner) Plan(ctx context.Context, taskID int64, as *db.AssetStore, ts
|
||||
WebSearchBackend: p.webSearch.Backend,
|
||||
BraveSearchAPIKey: p.webSearch.BraveKey,
|
||||
TavilySearchAPIKey: p.webSearch.TavilyKey,
|
||||
KeenableSearchAPIKey: p.webSearch.KeenableKey,
|
||||
KeenableSearchTitle: KeenableSearchTitle,
|
||||
DeepSeekSearchBaseURL: p.webSearch.DeepSeekBaseURL,
|
||||
DeepSeekSearchAPIKey: p.webSearch.DeepSeekAPIKey,
|
||||
DeepSeekSearchModel: p.webSearch.DeepSeekModel,
|
||||
|
||||
+12
-5
@@ -40,12 +40,17 @@ import (
|
||||
// messages API (the web_search_20250305 server tool), so each search consumes one
|
||||
// model call, and the search request is issued by DeepSeek's servers — it does NOT
|
||||
// go through the local Proxy, nor into the traffic recording.
|
||||
// KeenableSearchTitle is the X-Keenable-Title value ARTEX sends. Fixed in v1:
|
||||
// the title identifies the calling application to the provider.
|
||||
const KeenableSearchTitle = "ARTEX"
|
||||
|
||||
type WebSearchOpts struct {
|
||||
Enabled bool
|
||||
Backend string
|
||||
BraveKey string
|
||||
TavilyKey string
|
||||
Proxy string
|
||||
Enabled bool
|
||||
Backend string
|
||||
BraveKey string
|
||||
TavilyKey string
|
||||
KeenableKey string
|
||||
Proxy string
|
||||
// DeepSeek* comes from the currently active LLM config (only the official
|
||||
// DeepSeek endpoint in anthropic format) — not configured separately; it follows
|
||||
// the LLM config switch.
|
||||
@@ -505,6 +510,8 @@ func (w *Worker) execute(ctx context.Context, name string, taskID int64, as *db.
|
||||
WebSearchBackend: w.webSearch.Backend,
|
||||
BraveSearchAPIKey: w.webSearch.BraveKey,
|
||||
TavilySearchAPIKey: w.webSearch.TavilyKey,
|
||||
KeenableSearchAPIKey: w.webSearch.KeenableKey,
|
||||
KeenableSearchTitle: KeenableSearchTitle,
|
||||
DeepSeekSearchBaseURL: w.webSearch.DeepSeekBaseURL,
|
||||
DeepSeekSearchAPIKey: w.webSearch.DeepSeekAPIKey,
|
||||
DeepSeekSearchModel: w.webSearch.DeepSeekModel,
|
||||
|
||||
@@ -509,6 +509,38 @@ func (d *DB) SetFindingStatusWithNotify(ctx context.Context, id int64, status st
|
||||
return from, found, notified, err
|
||||
}
|
||||
|
||||
// FindingStatusBatchResult is one id's outcome in a bulk status update.
|
||||
type FindingStatusBatchResult struct {
|
||||
ID int64 `json:"id"`
|
||||
From string `json:"from,omitempty"`
|
||||
Found bool `json:"found"`
|
||||
Changed bool `json:"changed"`
|
||||
Notified bool `json:"notified"`
|
||||
}
|
||||
|
||||
// SetFindingStatusesWithNotify updates several findings to the same status in one
|
||||
// transaction. It returns a result per id, so an unknown id is reported as
|
||||
// found=false instead of hiding the others; a database error rolls the whole
|
||||
// batch back. Notification semantics stay identical to the single-row path: one
|
||||
// delivery event per finding whose status actually changed, none for a no-op.
|
||||
func (d *DB) SetFindingStatusesWithNotify(ctx context.Context, ids []int64, status string) ([]FindingStatusBatchResult, error) {
|
||||
out := make([]FindingStatusBatchResult, 0, len(ids))
|
||||
err := d.WithEvidenceTx(ctx, func(tx *sql.Tx) error {
|
||||
for _, id := range ids {
|
||||
from, found, changed, notified, err := SetFindingStatusTx(ctx, tx, id, status)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
out = append(out, FindingStatusBatchResult{ID: id, From: from, Found: found, Changed: changed, Notified: notified})
|
||||
}
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SetFindingStatusTx updates a finding's status and registers a status-change delivery
|
||||
// event inside the **caller's transaction**.
|
||||
//
|
||||
|
||||
@@ -607,6 +607,69 @@ func TestSetFindingStatusWithNotifyOnlyEmitsOnRealChange(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// A bulk update is one transaction with a per-id result: unknown ids are
|
||||
// reported, not fatal, and a second call is a no-op that emits no event.
|
||||
func TestSetFindingStatusesWithNotify(t *testing.T) {
|
||||
d := notifyTestDB(t)
|
||||
ctx := context.Background()
|
||||
|
||||
tk, err := d.CreateTask("bulk status test", "goal", nil, 0, 0)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer d.DeleteTask(tk.ID)
|
||||
es := d.Exploration(tk.ExplorationID)
|
||||
record := func(name string) int64 {
|
||||
fi, err := es.RecordFinding(ctx, RecordFindingInput{
|
||||
TaskID: tk.ID, Worker: "test", VulnClass: "XSS", Name: name,
|
||||
Severity: "medium", Summary: "summary",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Cleanup(func() { d.Exec(`DELETE FROM notification_events WHERE finding_id=$1`, fi.FindingID) })
|
||||
return fi.FindingID
|
||||
}
|
||||
first, second := record("bulk one"), record("bulk two")
|
||||
const missingID = int64(999999999)
|
||||
|
||||
results, err := d.SetFindingStatusesWithNotify(ctx, []int64{first, second, missingID}, FindingConfirmed)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(results) != 3 {
|
||||
t.Fatalf("want 3 results, got %d", len(results))
|
||||
}
|
||||
for i, want := range []int64{first, second} {
|
||||
r := results[i]
|
||||
if r.ID != want || !r.Found || !r.Changed || !r.Notified || r.From != FindingPending {
|
||||
t.Fatalf("result %d: %+v", i, r)
|
||||
}
|
||||
}
|
||||
if r := results[2]; r.Found || r.Changed || r.Notified {
|
||||
t.Fatalf("a missing id should be found=false with no change: %+v", r)
|
||||
}
|
||||
for _, id := range []int64{first, second} {
|
||||
var status string
|
||||
if err := d.QueryRow(`SELECT status FROM findings WHERE id=$1`, id).Scan(&status); err != nil || status != FindingConfirmed {
|
||||
t.Fatalf("finding %d status = %q (%v)", id, status, err)
|
||||
}
|
||||
var events int
|
||||
if err := d.QueryRow(`SELECT count(*) FROM notification_events WHERE finding_id=$1 AND kind=$2`, id, notify.EventFindingStatusChanged).Scan(&events); err != nil || events != 1 {
|
||||
t.Fatalf("finding %d status events = %d (%v)", id, events, err)
|
||||
}
|
||||
}
|
||||
|
||||
// Same status again: no change, so no push.
|
||||
again, err := d.SetFindingStatusesWithNotify(ctx, []int64{first}, FindingConfirmed)
|
||||
if err != nil || len(again) != 1 {
|
||||
t.Fatalf("second batch: %v %v", again, err)
|
||||
}
|
||||
if again[0].Changed || again[0].Notified {
|
||||
t.Fatalf("a no-op batch should neither change nor notify: %+v", again[0])
|
||||
}
|
||||
}
|
||||
|
||||
func TestNotificationStatsSnapshot(t *testing.T) {
|
||||
d := notifyTestDB(t)
|
||||
ctx := context.Background()
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ var (
|
||||
|
||||
// secretSettingKeys are the settings stored encrypted, AAD "settings.<key>".
|
||||
// Every other setting stays in clear.
|
||||
var secretSettingKeys = []string{"brave_search_api_key", "tavily_search_api_key", "web_search_proxy", "global_proxy"}
|
||||
var secretSettingKeys = []string{"brave_search_api_key", "tavily_search_api_key", "keenable_search_api_key", "web_search_proxy", "global_proxy"}
|
||||
|
||||
func secretSettingColumns() []secretColumn {
|
||||
out := make([]secretColumn, 0, len(secretSettingKeys))
|
||||
|
||||
+8
-7
@@ -56,19 +56,20 @@ func TestSecretBoxCrypto(t *testing.T) {
|
||||
type secretRows struct{ llm, mcp, cred, ch, task int64 }
|
||||
|
||||
var plainSecrets = []string{"sk-plain-llm", "mcp-plain-tok", "plain-pass", "hook-plain-secret", "llmproxy-plain-pass",
|
||||
"brave-plain", "tavily-plain", "wsproxy-plain-pass", "gproxy-plain-pass"}
|
||||
"brave-plain", "tavily-plain", "keenable-plain", "wsproxy-plain-pass", "gproxy-plain-pass"}
|
||||
|
||||
// secretSettingValues are the four secret settings written by the fixture.
|
||||
// secretSettingValues are the five secret settings written by the fixture.
|
||||
var secretSettingValues = map[string]string{
|
||||
"brave_search_api_key": "brave-plain",
|
||||
"tavily_search_api_key": "tavily-plain",
|
||||
"web_search_proxy": "socks5://u:wsproxy-plain-pass@ws.example:1080",
|
||||
"global_proxy": "http://u:gproxy-plain-pass@gp.example:3128",
|
||||
"brave_search_api_key": "brave-plain",
|
||||
"tavily_search_api_key": "tavily-plain",
|
||||
"keenable_search_api_key": "keenable-plain",
|
||||
"web_search_proxy": "socks5://u:wsproxy-plain-pass@ws.example:1080",
|
||||
"global_proxy": "http://u:gproxy-plain-pass@gp.example:3128",
|
||||
}
|
||||
|
||||
const llmProxyPlain = "http://u:llmproxy-plain-pass@llm-proxy.example:3128"
|
||||
|
||||
const deleteSecretSettings = `DELETE FROM settings WHERE key IN ('brave_search_api_key','tavily_search_api_key','web_search_proxy','global_proxy')`
|
||||
const deleteSecretSettings = `DELETE FROM settings WHERE key IN ('brave_search_api_key','tavily_search_api_key','keenable_search_api_key','web_search_proxy','global_proxy')`
|
||||
|
||||
// secretFixture writes one secret to each location, through the db API or, for
|
||||
// a legacy database, as raw plaintext SQL.
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
// The bulk endpoint validates the whole request before touching the database, so
|
||||
// a malformed body, an unknown status and an empty id list are client errors.
|
||||
func TestBulkFindingStatusValidation(t *testing.T) {
|
||||
s := &Server{m: &Manager{}}
|
||||
cases := []struct {
|
||||
name string
|
||||
body string
|
||||
want int
|
||||
}{
|
||||
{"bad json", `{`, http.StatusBadRequest},
|
||||
{"unknown status", `{"ids":[1],"status":"nope"}`, http.StatusBadRequest},
|
||||
{"empty ids", `{"ids":[],"status":"confirmed"}`, http.StatusBadRequest},
|
||||
{"non-positive ids", `{"ids":[0,-3],"status":"confirmed"}`, http.StatusBadRequest},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
rec := httptest.NewRecorder()
|
||||
req := httptest.NewRequest(http.MethodPost, "/api/exploration/findings/bulk-status", strings.NewReader(tc.body))
|
||||
s.bulkPatchFindingStatus(rec, req)
|
||||
if rec.Code != tc.want {
|
||||
t.Fatalf("status %d, want %d: %s", rec.Code, tc.want, rec.Body.String())
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
+30
-13
@@ -277,12 +277,14 @@ type Manager struct {
|
||||
active string
|
||||
trafficOn bool // traffic capture switch (off by default; settings.traffic_capture)
|
||||
llmRecOn bool // LLM recording switch (off by default; settings.llm_record)
|
||||
// Web search switch and source (off by default; settings.web_search_*). brave-free needs braveKey; tavily needs tavilyKey.
|
||||
// Web search switch and source (off by default; settings.web_search_*). brave-free needs braveKey; tavily needs tavilyKey;
|
||||
// keenable works keyless or with keenableKey.
|
||||
// webSearchProxy is a separate egress proxy (http/https/socks5), unrelated to the MITM proxy that records traffic.
|
||||
webSearchOn bool
|
||||
webSearchBackend string
|
||||
braveKey string
|
||||
tavilyKey string
|
||||
keenableKey string
|
||||
webSearchProxy string
|
||||
// globalProxy is the egress proxy all target traffic routes through
|
||||
// (http/https/socks5, optional user:pass). Empty = direct. When traffic
|
||||
@@ -299,6 +301,7 @@ const (
|
||||
settingWebSearchBackend = "web_search_backend"
|
||||
settingBraveKey = "brave_search_api_key"
|
||||
settingTavilyKey = "tavily_search_api_key"
|
||||
settingKeenableKey = "keenable_search_api_key"
|
||||
settingWebSearchProxy = "web_search_proxy"
|
||||
// settingGlobalProxy is the global egress proxy for all target traffic
|
||||
// (http/https/socks5). Empty = direct. Distinct from web_search_proxy (which
|
||||
@@ -483,6 +486,9 @@ func NewManager(dir, proxyAddr string) (*Manager, error) {
|
||||
if v, ok, _ := pg.GetSetting(settingTavilyKey); ok {
|
||||
m.tavilyKey = v
|
||||
}
|
||||
if v, ok, _ := pg.GetSetting(settingKeenableKey); ok {
|
||||
m.keenableKey = v
|
||||
}
|
||||
if v, ok, _ := pg.GetSetting(settingWebSearchProxy); ok {
|
||||
m.webSearchProxy = v
|
||||
}
|
||||
@@ -594,30 +600,32 @@ func (m *Manager) SetLLMPoolBindFallback(on bool) error {
|
||||
}
|
||||
|
||||
// WebSearch returns the current web-search config: whether it is enabled, the
|
||||
// backend ("ddgs" | "brave-free" | "tavily"), the Brave API key, the Tavily API
|
||||
// key (each empty unless set), and the dedicated egress proxy (empty = direct).
|
||||
func (m *Manager) WebSearch() (on bool, backend, braveKey, tavilyKey, proxy string) {
|
||||
// backend ("ddgs" | "brave-free" | "tavily" | "keenable" | "deepseek"), the
|
||||
// Brave, Tavily and Keenable API keys (each empty unless set), and the
|
||||
// dedicated egress proxy (empty = direct). The Keenable key is optional: empty
|
||||
// selects the keyless public endpoint.
|
||||
func (m *Manager) WebSearch() (on bool, backend, braveKey, tavilyKey, keenableKey, proxy string) {
|
||||
m.mu.RLock()
|
||||
defer m.mu.RUnlock()
|
||||
backend = m.webSearchBackend
|
||||
if backend == "" {
|
||||
backend = defaultWebSearchBackend
|
||||
}
|
||||
return m.webSearchOn, backend, m.braveKey, m.tavilyKey, m.webSearchProxy
|
||||
return m.webSearchOn, backend, m.braveKey, m.tavilyKey, m.keenableKey, m.webSearchProxy
|
||||
}
|
||||
|
||||
// WebSearchOpts returns the config as the agent-package struct the server pushes
|
||||
// into each agent. Disabled when off, or when a keyed backend is selected without
|
||||
// its key (so a half-configured backend never silently drops the tool at session build).
|
||||
func (m *Manager) WebSearchOpts() agent.WebSearchOpts {
|
||||
on, backend, braveKey, tavilyKey, proxy := m.WebSearch()
|
||||
on, backend, braveKey, tavilyKey, keenableKey, proxy := m.WebSearch()
|
||||
if on && backend == "brave-free" && strings.TrimSpace(braveKey) == "" {
|
||||
on = false
|
||||
}
|
||||
if on && backend == "tavily" && strings.TrimSpace(tavilyKey) == "" {
|
||||
on = false
|
||||
}
|
||||
o := agent.WebSearchOpts{Enabled: on, Backend: backend, BraveKey: braveKey, TavilyKey: tavilyKey, Proxy: proxy}
|
||||
o := agent.WebSearchOpts{Enabled: on, Backend: backend, BraveKey: braveKey, TavilyKey: tavilyKey, KeenableKey: keenableKey, Proxy: proxy}
|
||||
if backend == deepSeekWebSearchBackend {
|
||||
o.DeepSeekBaseURL, o.DeepSeekAPIKey, o.DeepSeekModel = m.deepSeekSearchCreds()
|
||||
}
|
||||
@@ -639,11 +647,11 @@ func (m *Manager) deepSeekSearchCreds() (baseURL, apiKey, model string) {
|
||||
return p.BaseURL, p.APIKey, p.Model
|
||||
}
|
||||
|
||||
// SetWebSearch persists and applies the web-search settings. braveKey, tavilyKey, and
|
||||
// proxy are each left untouched when nil (so toggling the switch doesn't wipe a saved
|
||||
// key/proxy; pass a pointer to "" to clear). Callers must rebuild agents (applyLLM)
|
||||
// afterwards so the settings take effect.
|
||||
func (m *Manager) SetWebSearch(on bool, backend string, braveKey, tavilyKey, proxy *string) error {
|
||||
// SetWebSearch persists and applies the web-search settings. braveKey, tavilyKey,
|
||||
// keenableKey and proxy are each left untouched when nil (so toggling the switch
|
||||
// doesn't wipe a saved key/proxy; pass a pointer to "" to clear). Callers must
|
||||
// rebuild agents (applyLLM) afterwards so the settings take effect.
|
||||
func (m *Manager) SetWebSearch(on bool, backend string, braveKey, tavilyKey, keenableKey, proxy *string) error {
|
||||
backend = strings.TrimSpace(backend)
|
||||
if backend == "" {
|
||||
backend = defaultWebSearchBackend
|
||||
@@ -674,6 +682,14 @@ func (m *Manager) SetWebSearch(on bool, backend string, braveKey, tavilyKey, pro
|
||||
m.tavilyKey = *tavilyKey
|
||||
m.mu.Unlock()
|
||||
}
|
||||
if keenableKey != nil {
|
||||
if err := m.pg.SetSetting(settingKeenableKey, *keenableKey); err != nil {
|
||||
return err
|
||||
}
|
||||
m.mu.Lock()
|
||||
m.keenableKey = *keenableKey
|
||||
m.mu.Unlock()
|
||||
}
|
||||
if proxy != nil {
|
||||
p := strings.TrimSpace(*proxy)
|
||||
if err := m.pg.SetSetting(settingWebSearchProxy, p); err != nil {
|
||||
@@ -926,6 +942,7 @@ var searchBackendEndpoints = map[string]string{
|
||||
"ddgs": "https://html.duckduckgo.com",
|
||||
"brave-free": "https://api.search.brave.com",
|
||||
"tavily": "https://api.tavily.com",
|
||||
"keenable": "https://api.keenable.ai",
|
||||
}
|
||||
|
||||
// targetGateEndpoints lists the endpoints of the platform's own services, which
|
||||
@@ -939,7 +956,7 @@ func (m *Manager) targetGateEndpoints() []string {
|
||||
for _, p := range profiles {
|
||||
out = append(out, p.BaseURL, p.Proxy)
|
||||
}
|
||||
on, backend, _, _, searchProxy := m.WebSearch()
|
||||
on, backend, _, _, _, searchProxy := m.WebSearch()
|
||||
if on {
|
||||
out = append(out, searchBackendEndpoints[backend])
|
||||
}
|
||||
|
||||
@@ -152,10 +152,10 @@ func TestProxySecretsAPI(t *testing.T) {
|
||||
s, _, request := trafficEvidenceServer(t)
|
||||
pg := s.m.PG()
|
||||
t.Cleanup(func() {
|
||||
pg.Exec(`DELETE FROM settings WHERE key IN ('brave_search_api_key','tavily_search_api_key','web_search_proxy','global_proxy')`)
|
||||
pg.Exec(`DELETE FROM settings WHERE key IN ('brave_search_api_key','tavily_search_api_key','keenable_search_api_key','web_search_proxy','global_proxy')`)
|
||||
pg.Exec(`DELETE FROM llm_profiles WHERE name='t-proxy'`)
|
||||
})
|
||||
secrets := []string{"brave-api-0007", "tavily-api-0008", "wsp-pass-0009", "gp-pass-0010", "llmp-pass-0011"}
|
||||
secrets := []string{"brave-api-0007", "tavily-api-0008", "keenable-api-0012", "wsp-pass-0009", "gp-pass-0010", "llmp-pass-0011"}
|
||||
put := func(body string) {
|
||||
t.Helper()
|
||||
resp := request("PUT", "/api/settings", body)
|
||||
@@ -177,7 +177,7 @@ func TestProxySecretsAPI(t *testing.T) {
|
||||
}
|
||||
return v
|
||||
}
|
||||
put(`{"brave_search_api_key":"brave-api-0007","tavily_search_api_key":"tavily-api-0008",
|
||||
put(`{"brave_search_api_key":"brave-api-0007","tavily_search_api_key":"tavily-api-0008","keenable_search_api_key":"keenable-api-0012",
|
||||
"web_search_proxy":"socks5://u:wsp-pass-0009@ws.example:1080","global_proxy":"http://u:gp-pass-0010@gp.example:3128"}`)
|
||||
var got map[string]any
|
||||
resp := request("GET", "/api/settings", "")
|
||||
@@ -191,9 +191,10 @@ func TestProxySecretsAPI(t *testing.T) {
|
||||
t.Fatalf("proxies not masked with a presence flag: %v", got)
|
||||
}
|
||||
|
||||
put(`{"web_search_proxy":"__masked__","global_proxy":"__masked__","brave_search_api_key":"__masked__"}`)
|
||||
put(`{"web_search_proxy":"__masked__","global_proxy":"__masked__","brave_search_api_key":"__masked__","keenable_search_api_key":"__masked__"}`)
|
||||
if setting("web_search_proxy") != "socks5://u:wsp-pass-0009@ws.example:1080" || setting("global_proxy") != "http://u:gp-pass-0010@gp.example:3128" ||
|
||||
setting("brave_search_api_key") != "brave-api-0007" || setting("tavily_search_api_key") != "tavily-api-0008" {
|
||||
setting("brave_search_api_key") != "brave-api-0007" || setting("tavily_search_api_key") != "tavily-api-0008" ||
|
||||
setting("keenable_search_api_key") != "keenable-api-0012" {
|
||||
t.Fatal("a masked placeholder replaced a stored secret")
|
||||
}
|
||||
put(`{"global_proxy":"http://gp2.example:3128","web_search_proxy":""}`)
|
||||
|
||||
+77
-13
@@ -801,6 +801,7 @@ func (s *Server) Handler() http.Handler {
|
||||
mux.HandleFunc("GET /api/exploration/findings/retests/active", s.listActiveFindingRetests)
|
||||
mux.HandleFunc("POST /api/exploration/findings/{id}/retests", s.startFindingRetest)
|
||||
mux.HandleFunc("PATCH /api/exploration/findings/{id}", s.patchFinding)
|
||||
mux.HandleFunc("POST /api/exploration/findings/bulk-status", s.bulkPatchFindingStatus)
|
||||
mux.HandleFunc("DELETE /api/exploration/findings/{id}", s.deleteFinding)
|
||||
mux.HandleFunc("GET /api/exploration/intents", s.intents)
|
||||
mux.HandleFunc("GET /api/exploration/graph", s.explorationGraph)
|
||||
@@ -2565,6 +2566,61 @@ func (s *Server) patchFinding(w http.ResponseWriter, r *http.Request) {
|
||||
writeJSON(w, 200, findingFromDB(f, s.resolveAssetIDs(f.AssetIDs)))
|
||||
}
|
||||
|
||||
// maxBulkFindingStatus caps one bulk status request. The UI acts on a page at a
|
||||
// time, so this is far above a normal selection and still bounds the work.
|
||||
const maxBulkFindingStatus = 500
|
||||
|
||||
// bulkPatchFindingStatus sets the same triage status on a batch of findings in
|
||||
// one transaction. Ids that do not exist are reported per id, not as a batch
|
||||
// failure, and the notification semantics are the single-row ones: one event per
|
||||
// finding whose status actually changed. The node payload mirror (#289) runs in
|
||||
// the same transaction, so the per-task view stays in sync.
|
||||
func (s *Server) bulkPatchFindingStatus(w http.ResponseWriter, r *http.Request) {
|
||||
var body struct {
|
||||
IDs []int64 `json:"ids"`
|
||||
Status string `json:"status"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
|
||||
writeErr(w, 400, "bad json: "+err.Error())
|
||||
return
|
||||
}
|
||||
if !db.ValidFindingStatus(body.Status) {
|
||||
writeErr(w, 400, "bad status: "+body.Status)
|
||||
return
|
||||
}
|
||||
seen := make(map[int64]bool, len(body.IDs))
|
||||
ids := make([]int64, 0, len(body.IDs))
|
||||
for _, id := range body.IDs {
|
||||
if id <= 0 || seen[id] {
|
||||
continue
|
||||
}
|
||||
seen[id] = true
|
||||
ids = append(ids, id)
|
||||
if len(ids) == maxBulkFindingStatus {
|
||||
break
|
||||
}
|
||||
}
|
||||
if len(ids) == 0 {
|
||||
writeErr(w, 400, "no finding ids")
|
||||
return
|
||||
}
|
||||
results, err := s.m.pg.SetFindingStatusesWithNotify(r.Context(), ids, body.Status)
|
||||
if err != nil {
|
||||
writeErr(w, 500, err.Error())
|
||||
return
|
||||
}
|
||||
updated, missing := 0, 0
|
||||
for _, res := range results {
|
||||
if res.Changed {
|
||||
updated++
|
||||
}
|
||||
if !res.Found {
|
||||
missing++
|
||||
}
|
||||
}
|
||||
writeJSON(w, 200, map[string]any{"updated": updated, "missing": missing, "results": results})
|
||||
}
|
||||
|
||||
// deleteFinding removes a finding (findings row + originating exploration node).
|
||||
// id is the standalone findings-table id (DTO finding_id).
|
||||
func (s *Server) deleteFinding(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -3599,7 +3655,7 @@ func (s *Server) getSettings(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func (s *Server) settingsPayload() map[string]any {
|
||||
on, backend, braveKey, tavilyKey, proxy := s.m.WebSearch()
|
||||
on, backend, braveKey, tavilyKey, keenableKey, proxy := s.m.WebSearch()
|
||||
pyStored, _, _ := s.m.pg.GetSetting(settingPythonInterp)
|
||||
concOn, concLimit := s.m.ConcurrencyLimit()
|
||||
if concLimit == 0 {
|
||||
@@ -3614,6 +3670,7 @@ func (s *Server) settingsPayload() map[string]any {
|
||||
"web_search_backend": backend,
|
||||
"brave_key_set": strings.TrimSpace(braveKey) != "",
|
||||
"tavily_key_set": strings.TrimSpace(tavilyKey) != "",
|
||||
"keenable_key_set": strings.TrimSpace(keenableKey) != "",
|
||||
"web_search_proxy": maskedSecret(proxy), // proxies may carry user:pass: masked when set, "" = direct
|
||||
"web_search_proxy_set": proxy != "",
|
||||
"global_proxy": maskedSecret(s.m.GlobalProxy()), // global egress proxy, masked when set, "" = direct
|
||||
@@ -3687,12 +3744,14 @@ func (s *Server) putSettings(w http.ResponseWriter, r *http.Request) {
|
||||
TrafficCapture *bool `json:"traffic_capture"`
|
||||
AgentTrafficBinding *bool `json:"agent_traffic_binding"`
|
||||
LLMRecord *bool `json:"llm_record"` // LLM recording switch (default off); takes effect immediately, no agent rebuild needed
|
||||
// Web search. WebSearchEnabled/Backend toggle the tool + backend; BraveKey/TavilyKey
|
||||
// are optional — omit (null) to leave a stored key untouched, send "" to clear.
|
||||
// Web search. WebSearchEnabled/Backend toggle the tool + backend; BraveKey/TavilyKey/KeenableKey
|
||||
// are optional — omit (null) to leave a stored key untouched, send "" to clear. The Keenable
|
||||
// key is optional even when its backend is selected: empty uses the keyless public endpoint.
|
||||
WebSearchEnabled *bool `json:"web_search_enabled"`
|
||||
WebSearchBackend *string `json:"web_search_backend"`
|
||||
BraveKey *string `json:"brave_search_api_key"`
|
||||
TavilyKey *string `json:"tavily_search_api_key"`
|
||||
KeenableKey *string `json:"keenable_search_api_key"`
|
||||
WebSearchProxy *string `json:"web_search_proxy"` // dedicated egress proxy (http/https/socks5); null = keep, "" = clear
|
||||
GlobalProxy *string `json:"global_proxy"` // global egress proxy (http/https/socks5); null = keep, "" = clear (direct)
|
||||
PythonInterp *string `json:"python_interpreter"` // python interpreter path for the custom script tool
|
||||
@@ -3739,7 +3798,7 @@ func (s *Server) putSettings(w http.ResponseWriter, r *http.Request) {
|
||||
egress.SetProfile(noise)
|
||||
}
|
||||
// A masked placeholder echoed back keeps the stored secret, like null.
|
||||
req.BraveKey, req.TavilyKey = keepIfMasked(req.BraveKey), keepIfMasked(req.TavilyKey)
|
||||
req.BraveKey, req.TavilyKey, req.KeenableKey = keepIfMasked(req.BraveKey), keepIfMasked(req.TavilyKey), keepIfMasked(req.KeenableKey)
|
||||
req.WebSearchProxy, req.GlobalProxy = keepIfMasked(req.WebSearchProxy), keepIfMasked(req.GlobalProxy)
|
||||
if req.ConstraintsInjectPlanner != nil {
|
||||
if err := s.m.pg.SetBool(settingConstraintsInjectPlanner, *req.ConstraintsInjectPlanner); err != nil {
|
||||
@@ -3891,16 +3950,16 @@ func (s *Server) putSettings(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
changed = true // capture-off egress is baked into agents at build time → rebuild
|
||||
}
|
||||
if req.WebSearchEnabled != nil || req.WebSearchBackend != nil || req.BraveKey != nil || req.TavilyKey != nil || req.WebSearchProxy != nil {
|
||||
if req.WebSearchEnabled != nil || req.WebSearchBackend != nil || req.BraveKey != nil || req.TavilyKey != nil || req.KeenableKey != nil || req.WebSearchProxy != nil {
|
||||
// Fill unspecified fields from current state so a partial PUT doesn't reset them.
|
||||
on, backend, _, _, _ := s.m.WebSearch()
|
||||
on, backend, _, _, _, _ := s.m.WebSearch()
|
||||
if req.WebSearchEnabled != nil {
|
||||
on = *req.WebSearchEnabled
|
||||
}
|
||||
if req.WebSearchBackend != nil {
|
||||
backend = *req.WebSearchBackend
|
||||
}
|
||||
if err := s.m.SetWebSearch(on, backend, req.BraveKey, req.TavilyKey, req.WebSearchProxy); err != nil {
|
||||
if err := s.m.SetWebSearch(on, backend, req.BraveKey, req.TavilyKey, req.KeenableKey, req.WebSearchProxy); err != nil {
|
||||
writeErr(w, 500, err.Error())
|
||||
return
|
||||
}
|
||||
@@ -3928,17 +3987,18 @@ func (s *Server) putSettings(w http.ResponseWriter, r *http.Request) {
|
||||
// not retype them. Always 200 with {ok, error?, count?, backend?}.
|
||||
func (s *Server) testWebSearch(w http.ResponseWriter, r *http.Request) {
|
||||
var req struct {
|
||||
Backend string `json:"web_search_backend"`
|
||||
Proxy string `json:"web_search_proxy"`
|
||||
BraveKey string `json:"brave_search_api_key"`
|
||||
TavilyKey string `json:"tavily_search_api_key"`
|
||||
Backend string `json:"web_search_backend"`
|
||||
Proxy string `json:"web_search_proxy"`
|
||||
BraveKey string `json:"brave_search_api_key"`
|
||||
TavilyKey string `json:"tavily_search_api_key"`
|
||||
KeenableKey string `json:"keenable_search_api_key"`
|
||||
}
|
||||
// Empty body is fine — fall back entirely to the saved config below.
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil && err != io.EOF {
|
||||
writeErr(w, 400, err.Error())
|
||||
return
|
||||
}
|
||||
_, backend, storedBraveKey, storedTavilyKey, storedProxy := s.m.WebSearch()
|
||||
_, backend, storedBraveKey, storedTavilyKey, storedKeenableKey, storedProxy := s.m.WebSearch()
|
||||
if strings.TrimSpace(req.Backend) != "" {
|
||||
backend = req.Backend
|
||||
}
|
||||
@@ -3958,7 +4018,11 @@ func (s *Server) testWebSearch(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.TrimSpace(req.TavilyKey) != "" {
|
||||
tavilyKey = req.TavilyKey
|
||||
}
|
||||
cfg := actool.WebSearchConfig{Backend: backend, BraveAPIKey: braveKey, TavilyAPIKey: tavilyKey, Proxy: proxy}
|
||||
keenableKey := storedKeenableKey
|
||||
if strings.TrimSpace(req.KeenableKey) != "" {
|
||||
keenableKey = req.KeenableKey
|
||||
}
|
||||
cfg := actool.WebSearchConfig{Backend: backend, BraveAPIKey: braveKey, TavilyAPIKey: tavilyKey, KeenableAPIKey: keenableKey, KeenableTitle: agent.KeenableSearchTitle, Proxy: proxy}
|
||||
// Hard cap so a slow/blocked proxy can't hang the request.
|
||||
wall := 30 * time.Second
|
||||
// deepseek's credentials are not in the form; they come from the currently active LLM profile. Each search also runs one
|
||||
|
||||
@@ -156,14 +156,14 @@ func TestTargetGateEndpointsFollowConfig(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
on, backend, _, _, proxy := g.m.WebSearch()
|
||||
on, backend, _, _, _, proxy := g.m.WebSearch()
|
||||
globalProxy := g.m.GlobalProxy()
|
||||
t.Cleanup(func() {
|
||||
_ = g.m.SetWebSearch(on, backend, nil, nil, &proxy)
|
||||
_ = g.m.SetWebSearch(on, backend, nil, nil, nil, &proxy)
|
||||
_ = g.m.SetGlobalProxy(globalProxy)
|
||||
})
|
||||
searchProxy := "http://search-proxy.example.net:8118"
|
||||
if err := g.m.SetWebSearch(true, "tavily", nil, nil, &searchProxy); err != nil {
|
||||
if err := g.m.SetWebSearch(true, "tavily", nil, nil, nil, &searchProxy); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := g.m.SetGlobalProxy("socks5://egress.example.net:1080"); err != nil {
|
||||
@@ -176,7 +176,7 @@ func TestTargetGateEndpointsFollowConfig(t *testing.T) {
|
||||
}
|
||||
// The configuration changes: so do the exemptions.
|
||||
none := ""
|
||||
if err := g.m.SetWebSearch(true, "ddgs", nil, nil, &none); err != nil {
|
||||
if err := g.m.SetWebSearch(true, "ddgs", nil, nil, nil, &none); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := g.m.SetGlobalProxy(""); err != nil {
|
||||
@@ -194,7 +194,7 @@ func TestTargetGateEndpointsFollowConfig(t *testing.T) {
|
||||
}
|
||||
}
|
||||
// Search off: its backend is not exempt.
|
||||
if err := g.m.SetWebSearch(false, "ddgs", nil, nil, nil); err != nil {
|
||||
if err := g.m.SetWebSearch(false, "ddgs", nil, nil, nil, nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if has("html.duckduckgo.com:443") {
|
||||
|
||||
@@ -260,6 +260,7 @@ export default function FindingsPage() {
|
||||
|
||||
// Export selection: tracked by finding_id (the standalone table's id), preserved across pages.
|
||||
const [selectedIds, setSelectedIds] = React.useState<Set<string>>(() => new Set());
|
||||
const [bulkBusy, setBulkBusy] = React.useState(false);
|
||||
// Export dialog state: scope (current filter / all / selected) × format (single md / per-finding md zip / csv / json).
|
||||
const [exportOpen, setExportOpen] = React.useState(false);
|
||||
const [exportScope, setExportScope] = React.useState<"filtered" | "all" | "selected">("filtered");
|
||||
@@ -656,6 +657,36 @@ export default function FindingsPage() {
|
||||
[refreshAfterMutation, setFindings, status],
|
||||
);
|
||||
|
||||
// applyBulkStatus sets the same triage status on every selected finding, then
|
||||
// reloads the current view so rows hidden by the status filter disappear.
|
||||
const applyBulkStatus = React.useCallback(
|
||||
async (next: FindingStatus) => {
|
||||
if (selectedIds.size === 0 || bulkBusy) return;
|
||||
setBulkBusy(true);
|
||||
try {
|
||||
const r = await api.bulkSetFindingStatus([...selectedIds], next);
|
||||
setSelectedIds(new Set());
|
||||
const label = statusMeta("finding", next).label;
|
||||
toast.success(
|
||||
r.updated === 1 ? `Marked 1 finding as "${label}"` : `Marked ${r.updated} findings as "${label}"`,
|
||||
);
|
||||
void loadFlat();
|
||||
if (view === "asset") void loadAssetTree();
|
||||
api
|
||||
.findingStats()
|
||||
.then(setStats)
|
||||
.catch(() => {
|
||||
// The list reload remains valid even if the aggregate refresh fails.
|
||||
});
|
||||
} catch (e) {
|
||||
toast.error(`Bulk update failed: ${(e as Error).message}`);
|
||||
} finally {
|
||||
setBulkBusy(false);
|
||||
}
|
||||
},
|
||||
[bulkBusy, loadAssetTree, loadFlat, selectedIds, view],
|
||||
);
|
||||
|
||||
// The inline expanded detailed-report cache is keyed by the globally stable row key. report is long-form
|
||||
// Markdown the list query doesn't include, so it is fetched once by finding_id on expand; done with empty text = no report yet.
|
||||
const [reports, setReports] = React.useState<Record<string, FindingReport>>({});
|
||||
@@ -995,7 +1026,27 @@ export default function FindingsPage() {
|
||||
|
||||
<div className="ml-auto flex items-center gap-3">
|
||||
{selectedIds.size > 0 && (
|
||||
<span className="text-xs text-muted-foreground tabular-nums">{selectedIds.size} selected</span>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="text-xs text-muted-foreground tabular-nums">{selectedIds.size} selected</span>
|
||||
<Select
|
||||
value=""
|
||||
onValueChange={(v) => {
|
||||
if (v) void applyBulkStatus(v as FindingStatus);
|
||||
}}
|
||||
disabled={bulkBusy}
|
||||
>
|
||||
<SelectTrigger size="sm" className="w-40" aria-label="Set the status of the selected findings">
|
||||
<SelectValue placeholder={bulkBusy ? "Updating…" : "Set status"} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
{FINDING_STATUSES.map((st) => (
|
||||
<SelectItem key={st} value={st}>
|
||||
{statusMeta("finding", st).label}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
)}
|
||||
<Button size="sm" variant="outline" onClick={openExport}>
|
||||
<DownloadIcon /> Export
|
||||
|
||||
@@ -27,6 +27,9 @@ export default function SystemSettingsPage() {
|
||||
const [tavilyKeySet, setTavilyKeySet] = React.useState(false);
|
||||
const [tavilyKeyInput, setTavilyKeyInput] = React.useState("");
|
||||
const [savingTavilyKey, setSavingTavilyKey] = React.useState(false);
|
||||
const [keenableKeySet, setKeenableKeySet] = React.useState(false);
|
||||
const [keenableKeyInput, setKeenableKeyInput] = React.useState("");
|
||||
const [savingKeenableKey, setSavingKeenableKey] = React.useState(false);
|
||||
const [proxyInput, setProxyInput] = React.useState("");
|
||||
const [savingProxy, setSavingProxy] = React.useState(false);
|
||||
const [globalProxyInput, setGlobalProxyInput] = React.useState("");
|
||||
@@ -53,6 +56,7 @@ export default function SystemSettingsPage() {
|
||||
setBackend(s.web_search_backend || "ddgs");
|
||||
setBraveKeySet(!!s.brave_key_set);
|
||||
setTavilyKeySet(!!s.tavily_key_set);
|
||||
setKeenableKeySet(!!s.keenable_key_set);
|
||||
setProxyInput(s.web_search_proxy ?? "");
|
||||
setGlobalProxyInput(s.global_proxy ?? "");
|
||||
setPyInterp(s.python_interpreter ?? "");
|
||||
@@ -208,6 +212,19 @@ export default function SystemSettingsPage() {
|
||||
.finally(() => setSavingTavilyKey(false));
|
||||
};
|
||||
|
||||
const saveKeenableKey = () => {
|
||||
setSavingKeenableKey(true);
|
||||
api
|
||||
.setSettings({ keenable_search_api_key: keenableKeyInput })
|
||||
.then((s) => {
|
||||
apply(s);
|
||||
setKeenableKeyInput("");
|
||||
toast.success("Saved Keenable API Key");
|
||||
})
|
||||
.catch((e) => toast.error("Save failed: " + (e as Error).message))
|
||||
.finally(() => setSavingKeenableKey(false));
|
||||
};
|
||||
|
||||
const saveProxy = () => {
|
||||
setSavingProxy(true);
|
||||
api
|
||||
@@ -242,6 +259,7 @@ export default function SystemSettingsPage() {
|
||||
web_search_proxy: proxyInput.trim(),
|
||||
brave_search_api_key: braveKeyInput,
|
||||
tavily_search_api_key: tavilyKeyInput,
|
||||
keenable_search_api_key: keenableKeyInput,
|
||||
})
|
||||
.then((r) => {
|
||||
if (r.ok) toast.success(`Search test succeeded · ${r.backend} returned ${r.count} results`);
|
||||
@@ -483,6 +501,7 @@ export default function SystemSettingsPage() {
|
||||
<SelectItem value="ddgs">DuckDuckGo (ddgs · free, no key)</SelectItem>
|
||||
<SelectItem value="brave-free">Brave (free tier · requires key)</SelectItem>
|
||||
<SelectItem value="tavily">Tavily (requires key)</SelectItem>
|
||||
<SelectItem value="keenable">Keenable (keyless, optional key)</SelectItem>
|
||||
<SelectItem value="deepseek">DeepSeek (official)</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
@@ -576,6 +595,39 @@ export default function SystemSettingsPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{webSearch && backend === "keenable" && (
|
||||
<div className="flex flex-col gap-2">
|
||||
<Label htmlFor="keenable-key" className="text-sm font-normal text-muted-foreground">
|
||||
Keenable Search API Key (optional)
|
||||
{keenableKeySet && <span className="ml-2 text-xs text-emerald-500">Configured</span>}
|
||||
</Label>
|
||||
<div className="flex items-center gap-2">
|
||||
<Input
|
||||
id="keenable-key"
|
||||
type="password"
|
||||
autoComplete="off"
|
||||
placeholder={keenableKeySet ? "Configured (leave empty to keep)" : "Optional: leave empty for the keyless endpoint"}
|
||||
value={keenableKeyInput}
|
||||
disabled={!loaded || savingKeenableKey}
|
||||
onChange={(e) => setKeenableKeyInput(e.target.value)}
|
||||
/>
|
||||
<Button
|
||||
type="button"
|
||||
onClick={saveKeenableKey}
|
||||
disabled={!loaded || savingKeenableKey || keenableKeyInput.trim() === ""}
|
||||
>
|
||||
Save
|
||||
</Button>
|
||||
</div>
|
||||
<p className="text-muted-foreground text-xs leading-relaxed">
|
||||
Queries leave this instance and go to api.keenable.ai. The request carries{" "}
|
||||
<b>X-Keenable-Title: ARTEX</b> so the provider can identify the caller. With no key, the
|
||||
public endpoint is rate-limited per IP; a key raises the limit, but the backend works
|
||||
without one.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{webSearch && (
|
||||
<div className="flex flex-col gap-2">
|
||||
<Label htmlFor="ws-proxy" className="text-sm font-normal text-muted-foreground">
|
||||
|
||||
@@ -698,6 +698,13 @@ export const api = {
|
||||
// Vulnerability lineage: the subgraph (nodes + edges) from the vulnerability node back to the task's initial node.
|
||||
findingLineage: (id: string) => get<{ nodes: TaskNode[]; edges: Edge[] }>(`/exploration/findings/${id}/lineage`),
|
||||
setFindingStatus: (id: string, status: FindingStatus) => patch<Finding>(`/exploration/findings/${id}`, { status }),
|
||||
// Bulk triage: one transaction server-side, with a per-id result. Unknown ids
|
||||
// come back as found=false instead of failing the whole batch.
|
||||
bulkSetFindingStatus: (ids: string[], status: FindingStatus) =>
|
||||
post<{ updated: number; missing: number; results: { id: number; found: boolean; changed: boolean }[] }>(
|
||||
"/exploration/findings/bulk-status",
|
||||
{ ids: ids.map(Number), status },
|
||||
),
|
||||
setFindingSeverity: (id: string, severity: Severity) => patch<Finding>(`/exploration/findings/${id}`, { severity }),
|
||||
// Save a vulnerability's name/class/severity in one call (inline edit in the findings list); only present fields are sent.
|
||||
updateFinding: (
|
||||
@@ -875,6 +882,7 @@ export const api = {
|
||||
web_search_proxy?: string;
|
||||
brave_search_api_key?: string;
|
||||
tavily_search_api_key?: string;
|
||||
keenable_search_api_key?: string;
|
||||
}) => post<{ ok: boolean; error?: string; count?: number; backend?: string }>(`/settings/web-search/test`, patch),
|
||||
|
||||
// ---- Vulnerability IM push ----
|
||||
|
||||
@@ -3335,6 +3335,7 @@ export const settings: Settings = {
|
||||
web_search_backend: "ddgs",
|
||||
brave_key_set: false,
|
||||
tavily_key_set: true,
|
||||
keenable_key_set: false,
|
||||
web_search_proxy: "",
|
||||
global_proxy: "",
|
||||
python_interpreter: "/usr/bin/python3",
|
||||
|
||||
@@ -977,15 +977,17 @@ export interface Settings {
|
||||
traffic_capture: boolean;
|
||||
agent_traffic_binding: boolean; // agents auto-bind traffic evidence, off by default; does not affect manual binding
|
||||
llm_record: boolean; // LLM recording switch (off by default); when off no LLM calls are recorded
|
||||
// Web search. brave_key_set / tavily_key_set reflect whether a key is stored
|
||||
// Web search. brave_key_set / tavily_key_set / keenable_key_set reflect whether a key is stored
|
||||
// (the values are never returned). On PUT, send the corresponding field to set/clear.
|
||||
web_search_enabled: boolean;
|
||||
web_search_backend: string; // "ddgs" | "brave-free" | "tavily" | "deepseek"
|
||||
web_search_backend: string; // "ddgs" | "brave-free" | "tavily" | "keenable" | "deepseek"
|
||||
brave_key_set: boolean;
|
||||
tavily_key_set: boolean;
|
||||
keenable_key_set: boolean;
|
||||
// write-only: only sent on PUT to store/clear the key.
|
||||
brave_search_api_key?: string;
|
||||
tavily_search_api_key?: string;
|
||||
keenable_search_api_key?: string;
|
||||
// Dedicated egress proxy (http/https/socks5) for reaching search endpoints; unrelated to the MITM proxy that records traffic. Empty = direct.
|
||||
web_search_proxy?: string;
|
||||
// Global egress proxy (http/https/socks5, may carry user:pass) that all target traffic goes
|
||||
|
||||
Reference in New Issue
Block a user