Skip to content

feat(proxy): Block services#49

Merged
MaciejTe merged 24 commits intomainfrom
feat/block-services
Feb 2, 2026
Merged

feat(proxy): Block services#49
MaciejTe merged 24 commits intomainfrom
feat/block-services

Conversation

@MaciejTe
Copy link
Copy Markdown
Collaborator

PR type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other... Please describe:

@MaciejTe MaciejTe requested a review from Copilot January 21, 2026 11:58
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new tiered decision system for filtering DNS requests, replacing the previous binary status-based approach. The changes enable concurrent filtering stages to produce decisions (none/allow/block) with associated tiers, which are then aggregated deterministically to resolve conflicts—allowing "allow" to win over "block" within the same tier and higher tiers to take precedence overall.

Changes:

  • Introduced StageResult and Decision types to replace direct FilterResult usage in filtering stages
  • Implemented tier-based aggregation logic that prioritizes "allow" over "block" and respects tier hierarchy
  • Refactored IP filtering to correctly handle allow-vs-block precedence across multiple answer records

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
proxy/model/stage_result.go Defines the new Decision enum and StageResult struct with tier and reasons
proxy/filter/aggregate.go Implements tier-based aggregation logic and reason deduplication
proxy/filter/aggregate_test.go Tests the new aggregation logic for various tier and decision scenarios
proxy/filter/ip_custom_rules_precedence_test.go Tests that IP-based allow rules override block rules in custom filtering
proxy/requestcontext/request_context.go Updates PartialFilteringResults field to use StageResult instead of FilterResult
proxy/filter/ip.go Updates IP filter to return StageResult and use the new aggregation approach
proxy/filter/domain.go Updates domain filter to return StageResult and removes old aggregation function
proxy/filter/custom_rules.go Refactors custom rules to return StageResult and properly handle IP allow/block precedence
proxy/filter/default_rule.go Updates default rule to return StageResult with appropriate tier
proxy/filter/blocklists.go Updates blocklist filtering to return StageResult with appropriate tier
proxy/filter/custom_rules_test.go Updates tests to expect StageResult with decision and tier fields
proxy/filter/blocklists_test.go Updates tests to expect StageResult with decision and tier fields

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MaciejTe MaciejTe force-pushed the feat/block-services branch 2 times, most recently from 5b14776 to 4aa6353 Compare January 26, 2026 11:35
@MaciejTe MaciejTe requested a review from Copilot January 26, 2026 13:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 70 out of 78 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread proxy/config/config.go Outdated
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
Signed-off-by: Maciek <tomczukmaciej@gmail.com>
@MaciejTe MaciejTe force-pushed the feat/block-services branch from 0b23c3d to 9e4ab6e Compare February 2, 2026 15:40
@MaciejTe MaciejTe merged commit 84ca469 into main Feb 2, 2026
9 checks passed
@MaciejTe MaciejTe deleted the feat/block-services branch March 10, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants