FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Centralise lockdown author checks by kerobbi · Pull Request #2881 · github/github-mcp-server · GitHub

Centralise lockdown author checks - #2881

Merged
SamMorrowDrums merged 5 commits into
mainfrom
kerobbi/lockdown-shared-enforcement
Jul 16, 2026
Merged

Centralise lockdown author checks#2881
SamMorrowDrums merged 5 commits into
mainfrom
kerobbi/lockdown-shared-enforcement

Conversation

kerobbi commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Extracts a single shared helper for lockdown mode author checks and routes GetIssue and GetPullRequest through it, failing closed when the author can't be verified.

Why

Part of https://github.com/github/copilot-mcp-core/issues/1798

What changed

  • Added authorLockdownResult (pkg/github/lockdown.go) - one place that resolves the lockdown decision for content authored by a given login, with shared restriction messages - and routed GetIssue and GetPullRequest through it.
  • Fail closed when the author login is empty (previously an empty login skipped the check); normalised GetPullRequest's error path to a tool-result error to match GetIssue.
  • Added unit tests for the helper and a lockdown test for GetPullRequest.

MCP impact

  • Tool schema or behavior changed - no schema change; behaviour differs only under lockdown mode (empty-author content is now withheld, matching the existing per-item filters).

Prompts tested (tool changes only)

  • "Get issue X from Y" with lockdown mode enabled/disabled
  • "Get PR X from Y" with lockdown mode enabled/disabled

Security / limits

  • Data exposure, filtering, or token/size limits considered - consolidates the lockdown content filtering decision; no change outside this.

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • Not needed

Copilot AI review requested due to automatic review settings July 14, 2026 11:56
kerobbi requested a review from a team as a code owner July 14, 2026 11:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Centralizes lockdown author verification for issue and pull-request reads, failing closed when authors cannot be verified.

Changes:

  • Added a shared lockdown decision helper and restriction messages.
  • Routed issue and pull-request retrieval through the helper.
  • Added helper and pull-request lockdown tests.
Show a summary per file
File Description
pkg/github/lockdown.go Adds shared author lockdown logic.
pkg/github/lockdown_test.go Tests missing-cache and empty-author handling.
pkg/github/issues.go Uses the shared helper for issue reads.
pkg/github/pullrequests.go Uses the shared helper for pull-request reads.
pkg/github/pullrequests_test.go Adds lockdown allow/deny cases.

Review details

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Medium

Comment thread pkg/github/lockdown.go
SamMorrowDrums previously approved these changes Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL