-
Notifications
You must be signed in to change notification settings - Fork 71
fix: service account project creation #635
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
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 enables service accounts to create projects with GitHub App integrations while preventing them from using OAuth integrations. The changes add proper validation to block service accounts from using OAuth tokens and provide clear error messages when this is attempted.
Key changes:
- Added service account detection logic to prevent OAuth token usage
- Implemented special permission handling for service accounts with GitHub App integration
- Enhanced test coverage with mocks for user client describe functionality
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| repository_hub/lib/repository_hub/adapters/github/create_action.ex | Added service account support for GitHub App integration with admin permissions |
| repository_hub/lib/repository_hub/adapters/github_adapter.ex | Added OAuth token validation to block service accounts |
| repository_hub/lib/repository_hub/adapters/gitlab_adapter.ex | Added OAuth token validation to block service accounts |
| repository_hub/lib/repository_hub/adapters/bitbucket_adapter.ex | Added OAuth token validation to block service accounts |
| repository_hub/lib/internal_api/user.pb.ex | Added SERVICE_ACCOUNT enum value for user creation source |
| repository_hub/test/repository_hub/adapters/github/create_action_test.exs | Added tests for service account behavior with different integration types |
| repository_hub/test/repository_hub/adapters/github/list_accessible_repositories_action_test.exs | Added describe mock for user client testing |
| repository_hub/test/support/factories/git_clients/gitlab_client_factory.ex | Added user client mocks for testing |
| repository_hub/test/support/factories/git_clients/bitbucket_client_factory.ex | Added user client mocks for testing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
126f4b3 to
255d60c
Compare
## π Description Allows service account to create a project with `github_app` type of integration and returs better errors for `oauth` integrations. Adressing #632 ## β Checklist - [x] I have tested this change - [ ] This change requires documentation update
π Description
Allows service account to create a project with
github_apptype of integration and returs better errors foroauthintegrations. Adressing #632β Checklist