-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for enterprise installation tokens #10
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: tspascoal <7847935+tspascoal@users.noreply.github.com>
Co-authored-by: tspascoal <7847935+tspascoal@users.noreply.github.com>
Co-authored-by: tspascoal <7847935+tspascoal@users.noreply.github.com>
Co-authored-by: tspascoal <7847935+tspascoal@users.noreply.github.com>
Fix implementation. App was incorrectly searched in the enterprise and not looking at the actual app. - Fix pagination - Improved rate limit support - Improved inputs validation - Bumped extension and task version
There was a problem hiding this 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 GitHub App installation tokens at the enterprise level, addressing the limitation that there is no direct API endpoint to retrieve enterprise installation IDs. The implementation uses pagination through the /app/installations API as a workaround and includes intelligent rate limiting and enterprise-specific validations.
- Adds
enterpriseas a new account type option with mandatory owner field requirement - Implements pagination-based enterprise installation lookup with rate limiting protection
- Adds comprehensive validation for enterprise-specific restrictions (no repository scoping, no forceRepoScope)
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vss-extension.json | Updates version and enhances forceRepoScope description for enterprise restrictions |
| create-github-app-token/task.json | Adds enterprise option to accountType field and updates help text |
| create-github-app-token/src/utils/constants.ts | Adds ACCOUNT_TYPE_ENTERPRISE constant and JWT_CLOCK_DRIFT_SECONDS |
| create-github-app-token/src/utils/validation.ts | Updates validation to include enterprise account type |
| create-github-app-token/src/tasks/run.ts | Implements enterprise-specific validation logic and error handling |
| create-github-app-token/src/core/github-service.ts | Adds getEnterpriseInstallationId method with pagination and rate limiting |
| create-github-app-token/package.json | Updates axios dependency version |
| README.md | Adds comprehensive enterprise documentation and usage examples |
| test files | Extensive test coverage for enterprise functionality |
Files not reviewed (1)
- create-github-app-token/package-lock.json: Language not supported
Comments suppressed due to low confidence (2)
create-github-app-token/package.json:17
- Axios version 1.11.0 does not exist. As of my knowledge cutoff in January 2025, the latest axios version was around 1.7.x. Please verify this version exists or use a valid version.
"axios": "^1.11.0",
|
Minimum allowed coverage is Generated by 🐒 cobertura-action against 960bd7e |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR adds comprehensive support for GitHub App installation tokens at the enterprise level, addressing the limitation that there is no direct API endpoint to retrieve enterprise installation IDs.
🚀 Key Features
Enterprise Account Type Support
enterpriseas a new account type option alongside existingorgandusertypes/app/installationsAPI as a workaround for the missing direct endpointtarget_type === "Enterprise"with case-insensitive name matchingIntelligent Rate Limiting
Enterprise-Specific Validations
📋 Usage Examples
Basic Enterprise Token Generation
Enterprise with Direct Certificate
🔧 Technical Implementation
Core Infrastructure Changes
ACCOUNT_TYPE_ENTERPRISE = 'enterprise'validateAccountType()to include enterprisegetEnterpriseInstallationId()with comprehensive error handlinggetInstallationId()now acceptsaccountTypestring instead of booleanisOrgConfiguration Updates
🧪 Testing & Quality
📚 Documentation
Updated Input Parameters
accountTypeenterpriseoptionownerrepositoriesforceRepoScopeEnterprise vs Organization/User Comparison
*Owner is optional for org/user if using GitHub repository provider (auto-extracted from Build.Repository.Name)
Troubleshooting Guide
organduseraccount types remains unchangedFixes #9.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.