Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions internal/tools/tool_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,28 @@ func TestToolSearch_FinancialObliqueDiscoverability(t *testing.T) {
}
}

// TestToolSearch_CloudCredentialDiscoverability locks in that the
// cloud-platform credential decoders, which name themselves by the
// platform contraction (kubeconfig_decode, gcp_service_account_decode),
// are reachable by an operator's full-word phrasing. These returned
// nothing before the kubernetes/k8s/google synonyms were added.
func TestToolSearch_CloudCredentialDiscoverability(t *testing.T) {
cases := map[string]string{
"kubernetes config": "kubeconfig_decode",
"k8s credentials": "kubeconfig_decode",
"google cloud service account": "gcp_service_account_decode",
}
for q, want := range cases {
out, err := toolSearchHandler(context.Background(), nil, map[string]any{"query": q, "limit": 8})
if err != nil {
t.Fatalf("%q: handler: %v", q, err)
}
if !strings.Contains(out, `"name": "`+want+`"`) {
t.Errorf("query %q did not surface %s in the top results:\n%s", q, want, out)
}
}
}

// TestToolSearch_AirTagDiscoverability locks in that the Apple Continuity
// decoders (the AirTag / Find My BLE-tracker sweep) are reachable by the
// consumer terms operators actually use. All of these returned nothing
Expand Down
10 changes: 10 additions & 0 deletions internal/toolsearch/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ var synonyms = map[string][]string{ //nolint:gochecknoglobals
"rfid": {"rfid", "em4100", "t5577", "indala"},
"card": {"nfc", "mifare", "rfid", "emv"},
"badge": {"nfc", "rfid", "wiegand", "pacs"},
// Cloud-platform credential triage: the secret-bearing config decoders
// name themselves by the platform contraction (kubeconfig_decode,
// gcp_service_account_decode), so an operator's full-word phrasing
// ("kubernetes config", "google cloud service account") ranked them out
// of the top results. These route the spoken platform name to the
// contraction the tool name uses. Platform-specific (low collision).
"kubernetes": {"kubeconfig"},
"k8s": {"kubeconfig"},
"google": {"gcp"},
"gcloud": {"gcp"},
// Financial-data triage: the IBAN / LEI / ISIN / ABA-routing decoder family
// (iban_decode, lei_decode, isin_decode, aba_routing_decode) handles the
// account / entity / security / US-bank identifiers found in BEC lures,
Expand Down
Loading