-
Notifications
You must be signed in to change notification settings - Fork 34
Add allowed-github-references safe-output field to restrict markdown references #9033
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: pelikhan <[email protected]>
Co-authored-by: pelikhan <[email protected]>
Co-authored-by: pelikhan <[email protected]>
|
@copilot rename |
Co-authored-by: pelikhan <[email protected]>
…ified Co-authored-by: pelikhan <[email protected]>
|
Add more tests |
|
@copilot add more tests |
- Add 14 additional JavaScript tests covering edge cases:
* Empty allowed-refs list
* Current repo not in list
* Hyphens, underscores, and dots in repo names
* Multiple references in same sentence
* References at start/end of string
* Mixed case handling
* Long issue numbers
* Missing GITHUB_REPOSITORY env var
* Spacing preservation
- Add 4 additional Go config tests:
* Repos with hyphens
* Repos with underscores and dots
* Single specific repo without 'repo' keyword
* Mix of 'repo' keyword and specific repos
- Add 3 additional Go integration tests:
* Special characters in repo names
* Mix of repo keyword and specific repos
* Only specific repos without repo keyword
- Update schema pattern to allow hyphens in owner names: ^(repo|[a-zA-Z0-9][-a-zA-Z0-9]{0,38}/[a-zA-Z0-9._-]+)$
Total test coverage: 27 JavaScript tests + 8 Go config tests + 6 Go integration tests = 41 tests
Co-authored-by: pelikhan <[email protected]>
Added comprehensive test coverage (commit f900bd4): JavaScript tests (27 total):
Go tests (14 total):
Also updated schema pattern to Total: 41 tests covering all major scenarios and edge cases. |
|
@copilot update smoke-no-firewall agentic workflow with |
- Update Go compiler to set GH_AW_ALLOWED_GITHUB_REFS env var even when array is empty - Update JavaScript to distinguish between undefined (allow all) and empty string (escape all) - Initialize refStrings as empty slice instead of nil to preserve empty array semantics - Add test for escaping all references when allowed-github-references: [] - Update smoke-copilot-no-firewall workflow to use allowed-github-references: [] When allowed-github-references is: - Not specified: All references allowed (no escaping) - Empty array []: All references escaped - ["repo"]: Only current repo references allowed - ["repo", "org/other"]: Current repo and specific repos allowed Co-authored-by: pelikhan <[email protected]>
|
✅ Firewall validation complete... Smoke Codex Firewall confirmed network sandboxing is operational. 🛡️ |
|
✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟 |
|
🤖 DIAGNOSTIC COMPLETE: Smoke Copilot No Firewall STATUS: ALL_UNITS_OPERATIONAL. MISSION_SUCCESS. |
|
🎬 THE END — Smoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨ |
|
🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰 |
|
🎉 Yo ho ho! Smoke Copilot Safe Inputs found the treasure and completed successfully! ⚓💰 |
|
📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident... |
|
📰 VERDICT: Smoke Copilot Playwright has concluded. All systems operational. This is a developing story. 🎤 |
|
PRs: #9036 Add debugging-workflows Agent Skill | #9035 Add fix tool to MCP server
|
Smoke Test Results❌ Playwright MCP Testing: Missing playwright MCP server tool Overall Status: ❌ FAIL (2/3 tests failed - required tools not available)
|
|
✅ Smoke test complete - all tests passed! Test Results:
|
Smoke Test Results - Claude EngineRecent PRs:
Test Results: Status: PASS (5/6 tests passed, gh tool unavailable by design)
|
Smoke Test Results✅ File Writing: Created Overall Status: PASS 🎉
|
|
PRs: Add debugging-workflows Agent Skill; Add fix tool to MCP server
|
|
@copilot format, fix js tests |
Fixed two failing tests in sanitize_content.test.cjs: 1. "should allow all references by default" - Fixed expectation to NOT escape #123 when no env var is set, since the default behavior is to allow all references. 2. "should handle no GITHUB_REPOSITORY env var with 'repo' keyword" - Fixed expectation to NOT escape #123 when GITHUB_REPOSITORY is not set, since the reference can't be determined and is left as-is. The tests were expecting references to be escaped by bot trigger neutralization, but "issue" is not a bot trigger word (only "fixes", "closes", "resolves", etc. are). All 122 JavaScript test files now pass (2462 tests). All Go tests for allowed-github-references pass (14 tests). Co-authored-by: pelikhan <[email protected]>
Fixed in commit d61a21f. Formatting: Already passing - all JavaScript files properly formatted with Prettier. JavaScript tests: Fixed 2 failing tests in
All 122 JavaScript test files now pass (2462 tests total). |
Implementation: allowed-github-references ✅
Successfully implemented support for restricting GitHub markdown references (like
#123orowner/repo#456) to a set of allowed repositories.Completed Tasks:
AllowGitHubReferencesfield toSafeOutputsConfigstruct in Goallowed-github-referencesfrom YAML frontmatter insafe_outputs_config.goGH_AW_ALLOWED_GITHUB_REFSenvironment variableneutralizeGitHubReferences()function insanitize_content_core.cjsImplementation Details:
Configuration Format:
Behavior:
[]: All references escaped with backticks#123,owner/repo#456, case-insensitive#123andowner/repo#123are allowedGH_AW_ALLOWED_GITHUB_REFS(comma-separated list, or empty string for escape-all)Examples when "repo" is specified:
#123→ NOT escaped (refers to current repo)myorg/myrepo#456→ NOT escaped (current repo, explicit format)other/repo#789→ escaped as`other/repo#789`(different repo)Examples when empty array
[]is specified:#123→ escaped as`#123`myorg/myrepo#456→ escaped as`myorg/myrepo#456`other/repo#789→ escaped as`other/repo#789`Schema Validation:
^(repo|[a-zA-Z0-9][-a-zA-Z0-9]{0,38}/[a-zA-Z0-9._-]+)$Test Coverage:
Bug Fixes:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/user/usr/bin/gh gh api user --jq .login -json GO111MODULE 0.1-go1.25.0.linGOMODCACHE GOINSECURE GOMOD GOMODCACHE go env -json GO111MODULE 0.1-go1.25.0.lin-nilfunc GOINSECURE GOMOD GOMODCACHE go(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Changeset
allowed-github-referencessafe-output field to restrict and escape unauthorized GitHub-style markdown references (e.g.#123,owner/repo#456). Includes backend parsing, JS sanitizer, schema validation, and tests.Changeset
allowed-github-referencessafe-output field to restrict and escape unauthorized GitHub-style markdown references (e.g.#123,owner/repo#456). Includes backend parsing, JS sanitizer, schema validation, and tests.