Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add fine-grained permissions support and tool permissions docs (Phase 2)#1486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
SamMorrowDrums wants to merge1 commit intoSamMorrowDrums/oauth-scopes
base:SamMorrowDrums/oauth-scopes
Choose a base branch
Loading
fromSamMorrowDrums/oauth-scopes-phase2

Conversation

@SamMorrowDrums
Copy link
Collaborator

Summary

This PR adds fine-grained permission types to the scopes package and creates comprehensive tool permissions documentation.

Changes

Extendedpkg/scopes/scopes.go

Added support for fine-grained personal access token permissions:

New Types:

  • Permission - Fine-grained permission constants (e.g.,PermActions,PermContents,PermIssues,PermPullRequests)
  • PermissionLevel - Access levels (PermissionRead,PermissionWrite,PermissionAdmin)
  • FineGrainedPermission - Struct combining permission and level

New Functions:

  • WithScopesAndPermissions() - Create Meta with both OAuth scopes and fine-grained permissions
  • AddPermissions() - Add permissions to existing Meta map
  • GetPermissionsFromMeta() - Extract permissions from tool Meta
  • ReadPerm(),WritePerm(),AdminPerm() - Convenience constructors
  • Perm() - General permission constructor

Newdocs/tool-permissions.md

Comprehensive documentation covering:

  • OAuth Scope Hierarchy - Shows which scopes include others
  • Fine-Grained Permission Levels - Explains read/write/admin levels
  • Tools by Category - Tables mapping each tool to required:
    • OAuth scope (for classic PATs)
    • Fine-grained permission (for fine-grained PATs)
  • Minimum Required Scopes - Quick reference by use case
  • Notes - Metadata permissions, notification limitations, etc.

Categories documented:

  • Repository Tools (19 tools)
  • Issue Tools (9 tools)
  • Pull Request Tools (18 tools)
  • Git Tools (2 tools)
  • Actions Tools (14 tools)
  • Label Tools (3 tools)
  • Notification Tools (6 tools)
  • Discussion Tools (4 tools)
  • Project Tools (9 tools)
  • Gist Tools (4 tools)
  • Search Tools (4 tools)
  • Security Tools (10 tools)
  • Context Tools (3 tools)

Updated README.md

Added links to the new permissions documentation:

  • In Prerequisites section (for PAT creation guidance)
  • Before Tools section (callout note)

Testing

  • All existing tests pass
  • Added comprehensive tests for new fine-grained permission functions:
    • TestFineGrainedPermissionString
    • TestWithScopesAndPermissions
    • TestAddPermissions
    • TestAddPermissionsToNilMeta
    • TestGetPermissionsFromMeta
    • TestPermHelperFunctions

Part of OAuth Scopes Work (Phase 2 of 4)

  • Phase 1 (PRfeat: Add OAuth scopes to tool metadata (Phase 1) #1485): Add OAuth scopes to tool metadata ✅
  • Phase 2 (this PR): Add fine-grained permissions and documentation ✅
  • Phase 3: Create script to list required scopes for enabled tools
  • Phase 4: Export Go map for library usage

Phase 2 of OAuth scopes work:- Extend pkg/scopes package with fine-grained permission types:  - Permission type with constants (actions, contents, issues, etc.)  - PermissionLevel type (read, write, admin)  - FineGrainedPermission struct and helper functions  - WithScopesAndPermissions(), AddPermissions(), GetPermissionsFromMeta()  - ReadPerm(), WritePerm(), AdminPerm() convenience functions- Create comprehensive docs/tool-permissions.md:  - OAuth scope hierarchy reference  - Fine-grained permission levels explanation  - Tool-by-category permission tables for all ~90 tools  - Minimum required scopes by use case  - Notes about limitations and special cases- Update README.md with links to permissions docs:  - Link in Prerequisites section for PAT creation  - Callout note before Tools section- Add tests for all new fine-grained permission functionality
CopilotAI review requested due to automatic review settingsNovember 25, 2025 13:18
@SamMorrowDrumsSamMorrowDrums requested a review froma team as acode ownerNovember 25, 2025 13:18
Copilot finished reviewing on behalf ofSamMorrowDrumsNovember 25, 2025 13:20
Copy link
Contributor

CopilotAI 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 adds comprehensive support for fine-grained personal access token permissions alongside existing OAuth scope support, and provides detailed documentation to help users understand authentication requirements for each tool.

Key Changes:

  • Extended the scopes package with fine-grained permission types, levels, and utility functions
  • Created comprehensive tool permissions documentation mapping 100+ tools to their required OAuth scopes and fine-grained permissions
  • Updated README to link to the new permissions documentation

Reviewed changes

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

FileDescription
pkg/scopes/scopes.goAdded fine-grained permission types (Permission,PermissionLevel,FineGrainedPermission) with 20+ permission constants, and 7 new functions for working with permissions in tool metadata
pkg/scopes/scopes_test.goAdded 5 comprehensive test functions covering all new permission functionality including helper functions, metadata operations, and edge cases
docs/tool-permissions.mdCreated new 312-line documentation file organizing all tools by category with OAuth scopes and fine-grained permissions, plus permission hierarchy explanations and use-case guides
README.mdAdded two strategic links to the new tool permissions documentation in the Prerequisites and Tools sections

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp