Add GitHub and Bitbucket OAuth login for all accessible repos - #19
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (23)
📝 WalkthroughWalkthroughAdded GitHub and Bitbucket OAuth authentication, protected SCM endpoints, remote repository listing, local workspace mapping, MCP support, and UI controls for repository selection and account management. Added provider, API, browser-security, integration-test, and documentation coverage. ChangesSCM authentication and repository workflows
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant LoadpathUI
participant LoadpathAPI
participant OAuthProvider
participant SCMProvider
LoadpathUI->>LoadpathAPI: Start OAuth or request repositories
LoadpathAPI->>OAuthProvider: Exchange or poll credentials
OAuthProvider-->>LoadpathAPI: Return access and refresh tokens
LoadpathAPI->>SCMProvider: List repositories and current user
SCMProvider-->>LoadpathAPI: Return repository metadata
LoadpathAPI-->>LoadpathUI: Return profile and repositories
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Sign in from Settings (GitHub device flow, Bitbucket authorization code), keep PATs as a fallback, and pick from the account's repositories on the Pull requests tab. Co-authored-by: zord.lack.net <zord.lack.net@gmail.com>
Keep GitHub/Bitbucket sign-in, disconnect, and repo listing on loopback; allowlist GitHub device URLs; refresh Bitbucket tokens from MCP; and leave app-password usernames in place on disconnect. Co-authored-by: zord.lack.net <zord.lack.net@gmail.com>
59ee606 to
062308f
Compare
Yes. Loadpath can sign in with GitHub and Bitbucket OAuth and then list every repository that account can access.
What changed
/user/repos, Bitbucketrole=member). If a registered workspace has a matchinggit remote, reviewing a PR fills the local path.~/.loadpath/settings.json. Bitbucket access tokens are refreshed automatically (UI and MCP).OAuth app setup
GitHub needs an OAuth App with Device Flow enabled (
repo read:user read:org). SetLOADPATH_GITHUB_CLIENT_IDor paste the client ID in Settings.Bitbucket needs an OAuth consumer whose callback is
http://127.0.0.1:7345/api/oauth/bitbucket/callback. SetLOADPATH_BITBUCKET_CLIENT_ID/LOADPATH_BITBUCKET_CLIENT_SECRETor paste the key and secret in Settings.Review still runs against a local clone; OAuth is for listing remotes, PRs, and posting the brief.
Adversarial review
Addressed:
/api/scm/reposare loopback-only, so a tunneled MCP server or a random website cannot list private repos or complete GitHub device-flow login CSRF.verification_urimust behttps://github.com/login/device; the UI onlywindow.opens GitHub/Bitbucket OAuth URLs.Left as existing product threat model (not introduced as a new bypass):
/api/settingsand/api/prswere already unauthenticated on the local server; CORS*remains for browser MCP connectors. Tightening those is a follow-up, not a blocker for this login feature.Tests
Summary by CodeRabbit
New Features
Security
Documentation
Tests