| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Introduces explicit OAuth authorization policies with alternative paths, conjunctive requirements, and argument-aware scope resolution.
Changes:
| File | Description |
|---|---|
| pkg/scopes/scopes.go | Implements policy construction and evaluation. |
| pkg/scopes/scopes_test.go | Tests policy semantics and hierarchy expansion. |
| pkg/scopes/map.go | Maps and resolves tool scope policies. |
| pkg/scopes/map_test.go | Tests call-specific policy resolution. |
| pkg/inventory/server_tool.go | Adds policy metadata to tools. |
| pkg/inventory/server_tool_test.go | Verifies path headers are excluded. |
| pkg/http/middleware/scope_challenge.go | Applies resolved policies to OAuth challenges. |
| pkg/http/middleware/scope_challenge_test.go | Tests argument-aware challenges. |
| pkg/github/ui_tools.go | Adds a scope resolver to ui_get. |
| pkg/github/tool_scopes.go | Defines repository/org and UI policies. |
| pkg/github/tool_scopes_test.go | Tests conditional tool policies. |
| pkg/github/scope_filter.go | Filters tools using authorization paths. |
| pkg/github/scope_filter_test.go | Tests compatibility and fail-open behavior. |
| pkg/github/repository_path.go | Validates paths and detects workflow writes. |
| pkg/github/repository_path_test.go | Tests path safety and workflow policies. |
| pkg/github/repositories.go | Applies validation and dynamic write policies. |
| pkg/github/issues.go | Adds issue-type scope resolution. |
| pkg/github/issue_fields.go | Adds issue-field scope resolution. |
| pkg/github/header_params_test.go | Ensures paths remain in MCP arguments. |
| pkg/github/dependencies.go | Initializes legacy-compatible policies. |
| docs/scope-filtering.md | Documents the policy model. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
Let each tool define fixed-token visibility and return the exact scopes for an OAuth challenge based on the current call. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 26e41558-43f9-42b2-8569-8489957c2b0a
| Back | FazBrowse Home | New Git URL |
Summary
Give each tool two straightforward scope checks:
Static tools use small helpers such as RequireAll. Conditional tools use ordinary Go functions over the tool arguments and active token scopes.
Why
Scope requirements can depend on the call. Listing issue fields uses repo for a repository request and read:org for an organization request. File writes need workflow in addition to repo only when changing a workflow file.
Keeping visibility and per-call challenges separate avoids flattening these cases into one scope list or introducing a policy language.
What changed
Related work
Supersedes #2778 and #3092.