feat(08-02): add 25 GitHub dorks for frontier and specialized categories
- frontier.yaml: 15 dorks covering Tier 1/2 providers (OpenAI, Anthropic, Google AI, Azure OpenAI, AWS Bedrock, xAI, Cohere, Mistral, Groq, Together, Replicate) - specialized.yaml: 10 dorks covering Tier 3 providers (Perplexity, Voyage, Jina, AssemblyAI, Deepgram, ElevenLabs, Stability, HuggingFace) - Extend loader to accept YAML list format in addition to single-dork mapping, enabling multi-dork files for Wave 2+ plans - Mirror all YAMLs into dorks/github/ (user-visible) and pkg/dorks/definitions/github/ (go:embed target)
This commit is contained in:
@@ -43,10 +43,27 @@ func loadDorks() ([]Dork, error) {
|
||||
if err != nil {
|
||||
return fmt.Errorf("reading dork file %s: %w", path, err)
|
||||
}
|
||||
// Support two YAML shapes:
|
||||
// 1. A top-level list of Dork entries (preferred, used by Wave 2+ plans).
|
||||
// 2. A single Dork as a top-level mapping (legacy one-per-file form).
|
||||
var list []Dork
|
||||
if err := yaml.Unmarshal(data, &list); err == nil && len(list) > 0 {
|
||||
for _, dk := range list {
|
||||
if err := dk.Validate(); err != nil {
|
||||
return fmt.Errorf("validating dork %s (%s): %w", path, dk.ID, err)
|
||||
}
|
||||
dorks = append(dorks, dk)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
var dk Dork
|
||||
if err := yaml.Unmarshal(data, &dk); err != nil {
|
||||
return fmt.Errorf("parsing dork %s: %w", path, err)
|
||||
}
|
||||
if strings.TrimSpace(dk.ID) == "" {
|
||||
// Empty file or placeholder (e.g., .gitkeep-adjacent empty YAML) — ignore.
|
||||
return nil
|
||||
}
|
||||
if err := dk.Validate(); err != nil {
|
||||
return fmt.Errorf("validating dork %s: %w", path, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user