Skip to content

Conversation

Copy link

Copilot AI commented Jul 3, 2025

This PR implements GitHub's authentication mechanism for GitHub.com instead of requiring users to manually create and manage personal access tokens (PATs), while maintaining full backward compatibility for GitHub Enterprise Server instances.

Changes Made

🔐 Authentication Improvements

  • GitHub.com: Now uses IntelliJ's built-in GitHub authentication automatically
  • GHES: Continues to use PAT-based authentication (no change in behavior)
  • Better UX: Clear error messages guide users to proper authentication setup

🏗️ Core Implementation

  • Added GitHubAuthenticationService to handle authentication logic
  • Updated GitHubInstance with useBuiltInAuth flag to differentiate authentication methods
  • Modified SarifService to use the new authentication service
  • Updated SarifViewerWindowFactory to handle the new authentication flow

🎨 UI Updates

  • Simplified settings UI for GitHub.com (no more manual PAT field)
  • Added informational text directing users to IntelliJ's GitHub settings
  • Preserved GHES PAT configuration interface

📚 Documentation

  • Updated README with new authentication instructions
  • Added comprehensive testing guide (TESTING.md)
  • Updated plugin description to reflect authentication changes

Before & After

Before:

GitHub PAT: [____________] (required for github.com)
GHES PAT:   [____________] (required for GHES)

After:

GitHub.com Authentication
Authentication is handled automatically through IntelliJ's GitHub integration.
Go to Settings > Version Control > GitHub to configure authentication.

GHES PAT: [____________] (still required for GHES)

Benefits

No more manual PAT creation for GitHub.com users
Leverages IntelliJ's secure OAuth flow instead of token management
Full backward compatibility - existing GHES workflows unchanged
Better security - no more storing tokens in plugin settings for GitHub.com
Improved user experience - seamless authentication for GitHub.com

Testing

  • Added unit tests for authentication service
  • Created comprehensive manual testing guide
  • Verified backward compatibility with existing configurations
  • Tested both GitHub.com and GHES authentication flows

Fixes #35.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cache-redirector.jetbrains.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:+HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en -Duser.variant -cp /home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/gradle-launcher-8.5.jar -javaagent:/home/REDACTED/.gradle/wrapper/dists/gradle-8.5-bin/5t9huq95ubn472n8rpzujfbqh/gradle-8.5/lib/agents/gradle-instrumentation-agent-8.5.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.5 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 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.

Copilot AI and others added 2 commits July 3, 2025 13:30
Co-authored-by: adrienpessu <7055334+adrienpessu@users.noreply.github.com>
Co-authored-by: adrienpessu <7055334+adrienpessu@users.noreply.github.com>
Copilot AI changed the title [WIP] Use a GitHub app to connect Implement GitHub authentication mechanism for github.com Jul 3, 2025
Copilot AI requested a review from adrienpessu July 3, 2025 13:34
Copilot finished work on behalf of adrienpessu July 3, 2025 13:34
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.

Use a GitHub app to connect

2 participants