Skip to content

Conversation

@hippolin
Copy link

@hippolin hippolin commented Nov 6, 2025

Summary

This PR adds GitHub App authentication support to the resource, providing an alternative to the traditional Personal Access Token authentication method. Users can now authenticate using GitHub App installation credentials instead of personal tokens.

Key Changes

  • New Authentication Method: Added GitHub App authentication using github_app_id, github_app_installation_id, and github_app_private_key
  • Authentication Logic: Implemented GitHub App JWT token generation and authentication flow using bradleyfalzon/ghinstallation library
  • Documentation: Updated README with comprehensive examples showing:
    • Personal Access Token authentication (existing method)
    • GitHub App authentication (new method)
    • GitHub App authentication with Git submodules support
  • Dependencies: Updated Go dependencies:
    • Upgraded google/go-github from v28 to v75
    • Added bradleyfalzon/ghinstallation/v2 for GitHub App JWT authentication
    • Updated other dependencies to the latest compatible versions
  • Code Quality:
    • Fixed code generation issues in fake objects
    • Updated go.mod to Go 1.24.0
    • Enhanced test coverage for GitHub App authentication scenarios

Backward Compatibility

  • Personal Access Token authentication remains fully supported
  • No breaking changes to existing functionality
  • Users can choose between authentication methods

Testing

  • Added comprehensive unit tests for GitHub App authentication
  • Verified existing functionality still works with Personal Access Token
  • Tested authentication flow and token generation

hippolin and others added 3 commits November 5, 2025 10:40
Signed-off-by: Hippo Lin <hippo@hippo.idv.tw>
- Update GitHub App authentication models
- Refactor fake implementations in models/fakes
- Update dependency versions in go.mod and go.sum
- Fix and refactor tests in prlist package
- Update README documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add unit tests covering GitHub App authentication feature:

- models/github_test.go: Tests for GitHub client factory with GitHub App
  support, including private key handling, endpoint configuration, and
  authentication routing between OAuth2 and GitHub App methods

- models/git_test.go: Tests for Git client factory with GitHub App support,
  including token generation, environment variable setup, and option handling

- pr/models_test.go: Tests for PR source validation ensuring proper
  authentication method configuration and mutual exclusivity

- prlist/models_test.go: Tests for PRList source validation with same
  authentication checks plus PR state filtering validation

All 55+ test cases pass with no regressions on existing functionality.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@hippolin hippolin changed the title feat(auth): add GitHub App authentication supportGitHub apps auth feat(auth): add GitHub App authentication Nov 6, 2025
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.

1 participant