Skip to content
Merged
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
9 changes: 8 additions & 1 deletion pkg/workflow/allowed_domains_sanitization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,9 @@ Test workflow with GITHUB_COPILOT_BASE_URL in engine.env.
// The copilot API target should be derived from the env var and present in the
// AWF JSON config (apiProxy.targets.copilot.host) rather than as a --copilot-api-target
// CLI flag, since network/proxy settings are now expressed via --config JSON file.
if !strings.Contains(lockStr, `"copilot":{"host":"copilot-proxy.corp.example.com"}`) {
copilotHostUnescaped := `"copilot":{"host":"copilot-proxy.corp.example.com"}`
copilotHostEscaped := `\"copilot\":{\"host\":\"copilot-proxy.corp.example.com\"}`
if !strings.Contains(lockStr, copilotHostUnescaped) && !strings.Contains(lockStr, copilotHostEscaped) {
t.Error("Expected copilot API target to be derived from GITHUB_COPILOT_BASE_URL in AWF config JSON")
}

Expand All @@ -716,7 +718,12 @@ Test workflow with GITHUB_COPILOT_BASE_URL in engine.env.
// We search for the allowDomains key followed by its opening "[" and verify the hostname
// appears before the closing "]" of that specific array.
allowDomainsPrefix := `"allowDomains":[`
allowDomainsPrefixEscaped := `\"allowDomains\":[`
allowDomainsIdx := strings.Index(lockStr, allowDomainsPrefix)
if allowDomainsIdx < 0 {
allowDomainsPrefix = allowDomainsPrefixEscaped
allowDomainsIdx = strings.Index(lockStr, allowDomainsPrefixEscaped)
Comment on lines +721 to +725
}
if allowDomainsIdx < 0 {
t.Fatal("allowDomains key not found in compiled lock file")
}
Expand Down