MCPcopy Create free account
hub / github.com/chainreactors/spray / LoadProtonRules

Function LoadProtonRules

pkg/load.go:153–173  ·  view source on GitHub ↗

LoadProtonRules loads embedded proton YAML templates. The data is a YAML array of template objects produced by recuLoadPoc.

()

Source from the content-addressed store, hash-verified

151// LoadProtonRules loads embedded proton YAML templates.
152// The data is a YAML array of template objects produced by recuLoadPoc.
153func LoadProtonRules() error {
154 rulesData := LoadConfig("proton_rules")
155 if len(rulesData) == 0 {
156 return nil
157 }
158
159 var templates []interface{}
160 if err := yaml.Unmarshal(rulesData, &templates); err != nil {
161 return err
162 }
163
164 docs := make([][]byte, 0, len(templates))
165 for _, tmpl := range templates {
166 doc, err := yaml.Marshal(tmpl)
167 if err != nil {
168 continue
169 }
170 docs = append(docs, doc)
171 }
172 return LoadProtonTemplates(docs)
173}
174
175// LoadFoundKeys loads embedded found/keys templates (credential detection).
176func LoadFoundKeys() error {

Callers 1

LoadTemplatesFunction · 0.85

Calls 2

LoadProtonTemplatesFunction · 0.85
LoadConfigFunction · 0.70

Tested by

no test coverage detected