MCPcopy Create free account
hub / github.com/github/gh-aw / validateAliasKey

Function validateAliasKey

pkg/workflow/model_alias_validation.go:161–173  ·  view source on GitHub ↗

─── V-MAF-005: alias key validation ───────────────────────────────────────── validateAliasKey validates a single alias map key (V-MAF-005). The empty string key ("") is allowed (default policy).

(key, markdownPath string)

Source from the content-addressed store, hash-verified

159// validateAliasKey validates a single alias map key (V-MAF-005).
160// The empty string key ("") is allowed (default policy).
161func validateAliasKey(key, markdownPath string) error {
162 if key == "" {
163 return nil // empty string is the default policy — permitted
164 }
165 for _, forbidden := range []string{"/", "?", "&"} {
166 if strings.Contains(key, forbidden) {
167 return formatCompilerError(markdownPath, "error",
168 fmt.Sprintf("models: alias key %q must not contain %q (V-MAF-005)", key, forbidden),
169 nil)
170 }
171 }
172 return nil
173}
174
175// ─── V-MAF-001, 002, 003, 006: identifier syntax & param validation ───────────
176

Callers 2

validateModelAliasMapMethod · 0.85
TestValidateAliasKeyFunction · 0.85

Calls 1

formatCompilerErrorFunction · 0.85

Tested by 1

TestValidateAliasKeyFunction · 0.68