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

Function validateSafeOutputsURLs

pkg/workflow/safe_outputs_validation.go:18–34  ·  view source on GitHub ↗

validateSafeOutputsURLs validates the urls policy in safe-outputs.

(config *SafeOutputsConfig)

Source from the content-addressed store, hash-verified

16
17// validateSafeOutputsURLs validates the urls policy in safe-outputs.
18func validateSafeOutputsURLs(config *SafeOutputsConfig) error {
19 if config == nil || config.URLs == "" {
20 return nil
21 }
22
23 switch config.URLs {
24 case SafeOutputsURLsPolicyAllowedOnly, SafeOutputsURLsPolicyAllowedOrCodeRegion:
25 return nil
26 default:
27 return fmt.Errorf(
28 "safe-outputs.urls: invalid value %q (expected one of: %q, %q)",
29 config.URLs,
30 SafeOutputsURLsPolicyAllowedOnly,
31 SafeOutputsURLsPolicyAllowedOrCodeRegion,
32 )
33 }
34}
35
36// validateSafeOutputsAllowedDomains validates the allowed-domains configuration in safe-outputs.
37// Supports ecosystem identifiers (e.g., "python", "node", "default-safe-outputs") like network.allowed.

Callers 2

Calls 1

ErrorfMethod · 0.45

Tested by 1