Skip to content

changes from review#4028

Open
yrobla wants to merge 2 commits intomainfrom
issue-3867-v2
Open

changes from review#4028
yrobla wants to merge 2 commits intomainfrom
issue-3867-v2

Conversation

@yrobla
Copy link
Contributor

@yrobla yrobla commented Mar 6, 2026

Simplify code, remove tests and move related packages

Related-to: #3867

Large PR Justification

This is a code refactor, that means moving and deleting files, so that's the reason for the big diff

@yrobla yrobla requested a review from Copilot March 6, 2026 09:40
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Large PR Detected

This PR exceeds 1000 lines of changes and requires justification before it can be reviewed.

How to unblock this PR:

Add a section to your PR description with the following format:

## Large PR Justification

[Explain why this PR must be large, such as:]
- Generated code that cannot be split
- Large refactoring that must be atomic
- Multiple related changes that would break if separated
- Migration or data transformation

Alternative:

Consider splitting this PR into smaller, focused changes (< 1000 lines each) for easier review and reduced risk.

See our Contributing Guidelines for more details.


This review will be automatically dismissed once you add the justification section.

@github-actions github-actions bot added the size/XL Extra large PR: 1000+ lines changed label Mar 6, 2026
Copy link
Contributor

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

Refactors vMCP session token-binding / hijack-prevention code by moving the security implementation into an internal package and centralizing the “compute + persist metadata + wrap session” logic, while also simplifying/reshaping the associated tests and removing prior integration coverage.

Changes:

  • Move token-binding security utilities + hijack-prevention decorator into pkg/vmcp/session/internal/security and introduce PreventSessionHijacking(...) as the single entry point.
  • Update MultiSession factory to apply hijack-prevention via the new internal security helper and remove the old decorator/standalone security package.
  • Reshuffle tests (unit tests moved/updated) and remove the previous server token-binding integration test; simplify v2 server integration fake factory setup.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
pkg/vmcp/session/token_binding_test.go Updates tests to reference internal security metadata keys and changes validation strategy for defensive-copy behavior.
pkg/vmcp/session/security/security.go Removes the previous (non-internal) security utilities package.
pkg/vmcp/session/internal/security/security.go Adds internalized token-binding + hijack-prevention implementation (hashing, salt, decorator, wrapper function).
pkg/vmcp/session/internal/security/security_test.go Updates security unit tests to use the new internal package location and adds tests for ShouldAllowAnonymous.
pkg/vmcp/session/internal/security/hijack_prevention_test.go Adds focused tests for validateCaller edge cases, concurrency, and basic PreventSessionHijacking metadata behavior.
pkg/vmcp/session/hijack_prevention_decorator.go Removes the previous session-level decorator implementation.
pkg/vmcp/session/factory.go Switches factory to internal/security.PreventSessionHijacking(...) and removes in-factory token binding computation/metadata writes.
pkg/vmcp/server/token_binding_integration_test.go Removes end-to-end HTTP integration tests that exercised token binding with Authorization headers.
pkg/vmcp/server/sessionmanager/session_manager.go Replaces use of the removed helper with inline allowAnonymous logic.
pkg/vmcp/server/session_management_v2_integration_test.go Removes fake token-hash metadata population logic from the v2 integration fakes.

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

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 75.80645% with 30 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.60%. Comparing base (27e8d57) to head (8044a49).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
pkg/vmcp/session/internal/security/security.go 76.47% 21 Missing and 7 partials ⚠️
pkg/vmcp/session/factory.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4028      +/-   ##
==========================================
- Coverage   68.61%   68.60%   -0.02%     
==========================================
  Files         444      444              
  Lines       45178    45263      +85     
==========================================
+ Hits        31001    31054      +53     
- Misses      11777    11805      +28     
- Partials     2400     2404       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Simplify code, remove tests and move related packages

Related-to: #3867
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 6, 2026
@github-actions github-actions bot dismissed their stale review March 6, 2026 10:03

Large PR justification has been provided. Thank you!

@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

✅ Large PR justification has been provided. The size review has been dismissed and this PR can now proceed with normal review.

Copy link
Contributor

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 10 out of 10 changed files in this pull request and generated no new comments.


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

@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 6, 2026
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 6, 2026
@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 6, 2026
@yrobla yrobla requested a review from Copilot March 6, 2026 11:37
Copy link
Contributor

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 10 out of 10 changed files in this pull request and generated 5 comments.


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

@github-actions github-actions bot added size/XL Extra large PR: 1000+ lines changed and removed size/XL Extra large PR: 1000+ lines changed labels Mar 6, 2026
@yrobla yrobla requested a review from JAORMX March 6, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XL Extra large PR: 1000+ lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants