Skip to content

feat: add protocol-specific domain allowlisting (http/https)#115

Merged
Mossaka merged 4 commits intomainfrom
copilot/split-http-and-https
Dec 19, 2025
Merged

feat: add protocol-specific domain allowlisting (http/https)#115
Mossaka merged 4 commits intomainfrom
copilot/split-http-and-https

Conversation

Copy link
Contributor

Copilot AI commented Dec 19, 2025

Adds ability to restrict domains to HTTP-only or HTTPS-only traffic, rather than allowing both by default.

Usage

# HTTPS only
--allow-domains 'https://secure.example.com'

# HTTP only  
--allow-domains 'http://legacy-api.example.com'

# Both (default, backward compatible)
--allow-domains 'example.com'

# Mixed
--allow-domains 'example.com,https://secure.example.com,http://legacy.example.com'

Works with wildcards: https://*.secure.example.com

Changes

  • src/domain-patterns.ts: Added parseDomainWithProtocol() and updated types (DomainProtocol, PlainDomainEntry, DomainPattern) to carry protocol info through the parsing pipeline
  • src/squid-config.ts: Generates separate Squid ACLs per protocol:
    • allowed_http_only with !CONNECT rule for HTTP
    • allowed_https_only with CONNECT rule for HTTPS
    • allowed_domains for both (existing behavior)
  • src/cli.ts: Updated help text
  • README.md: Added documentation section

Generated Squid Config Example

acl allowed_http_only dstdomain .legacy.example.com
acl allowed_https_only dstdomain .secure.example.com
acl allowed_domains dstdomain .example.com

http_access allow !CONNECT allowed_http_only
http_access allow CONNECT allowed_https_only
http_access deny !allowed_domains
Original prompt

This section details on the original issue you should resolve

<issue_title>Split HTTP and HTTPS</issue_title>
<issue_description></issue_description>

<agent_instructions>the allowdomains should be able to split http and https and should be able to allow only http not https, or vice versa</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Dec 19, 2025
Copilot AI and others added 2 commits December 19, 2025 08:36
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to split HTTP and HTTPS domains feat: add protocol-specific domain allowlisting (http/https) Dec 19, 2025
Copilot AI requested a review from Mossaka December 19, 2025 08:43
@Mossaka Mossaka added the smoke label Dec 19, 2025
@Mossaka Mossaka marked this pull request as ready for review December 19, 2025 17:52
Resolved conflicts to merge both:
- Protocol-specific domain allowlisting (http-only, https-only)
- Blocklist support for domain filtering

Access rules order:
1. Blocklist deny rules (blocklist takes precedence)
2. Protocol-specific allow rules
3. Deny rule for non-allowed domains

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Test Coverage Report

Metric Coverage Covered/Total
Lines 67.73% 806/1190
Statements 67.84% 827/1219
Functions 71.2% 89/125
Branches 63.88% 283/443
Coverage Thresholds

The project has the following coverage thresholds configured:

  • Lines: 38%
  • Statements: 38%
  • Functions: 35%
  • Branches: 30%

Coverage report generated by `npm run test:coverage`

@Mossaka Mossaka merged commit 1235c2a into main Dec 19, 2025
10 checks passed
@Mossaka Mossaka deleted the copilot/split-http-and-https branch December 19, 2025 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split HTTP and HTTPS

2 participants