Skip to content

🔒(security): Refactor GitHub repository fetching to use server route #1431

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MH4GF
Copy link
Member

@MH4GF MH4GF commented Apr 21, 2025

Issue

  • resolve: Enhance security for GitHub repository access

Why is this change needed?

This refactoring improves security by moving GitHub repository API calls from client-side to server-side. Previously, Supabase client credentials were exposed to the browser, making it easier for attackers to access sensitive data. With this change, all repository data is now fetched through a dedicated API route with proper authentication checks.

What would you like reviewers to focus on?

  • Verify API route security implementation (authentication, error handling)
  • Check if the UX remains consistent with the previous implementation
  • Review the form-based approach for importing repositories

Testing Verification

  • Tested repository fetching with valid and invalid installation IDs
  • Verified authentication is properly enforced
  • Confirmed error states are handled and displayed correctly
  • Tested project import flow with various repositories

What was done

pr_agent:summary

Detailed Changes

pr_agent:walkthrough

Additional Notes

This change is part of ongoing security improvements to reduce client-side credential exposure.

Copy link

changeset-bot bot commented Apr 21, 2025

⚠️ No Changeset found

Latest commit: 31838b7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Apr 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
liam-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 9:07am
liam-erd-sample ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 24, 2025 9:07am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
liam-docs ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2025 9:07am

Copy link

supabase bot commented Apr 21, 2025

Updates to Preview Branch (refactor-installation-selector) ↗︎

Deployments Status Updated
Database Thu, 24 Apr 2025 08:52:31 UTC
Services Thu, 24 Apr 2025 08:52:31 UTC
APIs Thu, 24 Apr 2025 08:52:31 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Thu, 24 Apr 2025 08:52:38 UTC
Migrations Thu, 24 Apr 2025 08:52:39 UTC
Seeding Thu, 24 Apr 2025 08:52:40 UTC
Edge Functions Thu, 24 Apr 2025 08:52:40 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

…lation ID and refactor ProjectNewPage components

- Added a new API route to fetch GitHub repositories based on the installation ID.
- Updated ProjectNewPage to require organizationId as a mandatory prop.
- Refactored InstallationSelector to utilize a new RepositoriesPanel component for displaying repositories.
- Removed redundant repository fetching logic from InstallationSelector and centralized it in RepositoriesPanel.
- Updated RepositoryItem to handle form submissions for adding projects.
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