-
Notifications
You must be signed in to change notification settings - Fork 267
Support for Authentication Schemes - Decouple user auth from GitHub API credentials #245
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
base: main
Are you sure you want to change the base?
Conversation
@karpikpl 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs. I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review. |
Co-authored-by: karpikpl <[email protected]>
…iple OAuth providers Co-authored-by: karpikpl <[email protected]>
Co-authored-by: karpikpl <[email protected]>
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 implements a new authentication architecture that decouples user authentication from GitHub API credentials, providing enhanced security and flexibility. The changes introduce GitHub App authentication as the preferred method while maintaining backward compatibility with existing authentication schemes.
Key Changes
- New GitHub App authentication module with JWT generation and token caching
- Support for multiple OAuth providers (Google, Microsoft) beyond GitHub
- Optional user authorization system with configurable access control
- Enhanced authentication priority system with three tiers of authentication methods
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
server/modules/github-app-auth.ts |
Core GitHub App authentication module with JWT generation and token management |
server/modules/authorization.ts |
User authorization logic for access control |
server/modules/authentication.ts |
Enhanced authentication flow with priority-based scheme selection |
server/routes/auth/github.get.ts |
Updated GitHub OAuth handler with authorization checks |
server/routes/auth/google.get.ts |
New Google OAuth authentication handler |
server/routes/auth/microsoft.get.ts |
New Microsoft OAuth authentication handler |
nuxt.config.ts |
Configuration updates for new authentication schemes |
package.json |
Added JWT library dependencies |
README.md |
Comprehensive documentation for new authentication features |
.env |
Environment variable templates for new authentication options |
tests/github-app-auth.spec.ts |
Basic test placeholder for GitHub App authentication |
tests/authorization.spec.ts |
Basic test placeholder for authorization module |
@copilot can you merge main into this branch? |
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
…hentication features Co-authored-by: karpikpl <[email protected]>
✅ Completed all requested items:
Test Results: All 140 tests now pass (improved from 87), with comprehensive coverage of the new authentication features including edge cases, error scenarios, and multi-provider OAuth support. Commit: Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR implements a new authentication architecture that decouples user authentication from GitHub API credentials, addressing the security and flexibility concerns raised in the issue.
Problem
Previously, the application tightly coupled user authentication with GitHub API access:
Solution
Implemented a flexible authentication scheme with three priority levels:
1. GitHub App Authentication (Recommended - New)
Uses GitHub App credentials for API calls while supporting multiple OAuth providers for user authentication:
2. Personal Access Token (Legacy - Existing)
Continues to work as before for backward compatibility.
3. User OAuth Token (Deprecated - Existing)
Legacy GitHub OAuth mode continues to work but is now deprecated.
Key Features
🔐 Enhanced Security
🌍 Multiple Identity Providers
/auth/github
/auth/google
/auth/microsoft
👥 Flexible Authorization
NUXT_AUTHORIZED_USERS
🔄 Backward Compatibility
Implementation Details
Testing
Migration Guide
For existing deployments using
NUXT_PUBLIC_USING_GITHUB_AUTH=true
:NUXT_AUTHORIZED_USERS
for access controlNUXT_PUBLIC_USING_GITHUB_AUTH
(defaults to false)The new system provides better security, more flexibility, and easier user management while maintaining full backward compatibility.
Fixes #244.
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:
api.fontshare.com
node (vitest)
(dns block)node /home/REDACTED/work/copilot-metrics-viewer/copilot-metrics-viewer/node_modules/.bin/nuxt build
(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js
(dns block)api.fontsource.org
node (vitest)
(dns block)node /home/REDACTED/work/copilot-metrics-viewer/copilot-metrics-viewer/node_modules/.bin/nuxt build
(dns block)fonts.bunny.net
node (vitest)
(dns block)node /home/REDACTED/work/copilot-metrics-viewer/copilot-metrics-viewer/node_modules/.bin/nuxt build
(dns block)fonts.google.com
node (vitest)
(dns block)node /home/REDACTED/work/copilot-metrics-viewer/copilot-metrics-viewer/node_modules/.bin/nuxt build
(dns block)fonts.googleapis.com
node (vitest 2)
(dns block)node (vitest 1)
(dns block)node (vitest 3)
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.