Support custom OAuth redirect_uri by jeremy · Pull Request #186 · basecamp/basecamp-cli
added 2 commits
March 3, 2026 14:28Users with their own OAuth client credentials registered on Launchpad need the CLI's redirect_uri to match their app's registered callback. The CLI previously hardcoded http://127.0.0.1:8976/callback with no way to override it. Add resolveOAuthCallback() with precedence chain: LoginOptions.RedirectURI > BASECAMP_OAUTH_REDIRECT_URI env var > CallbackAddr-derived > hardcoded default Validate all redirect URIs (including default) against RFC 8252 loopback rules: http scheme, loopback host, explicit port, no userinfo/query/fragment. Rename credential env vars to BASECAMP_OAUTH_CLIENT_ID/SECRET with strict pairing (both required when either is set). BC3 DCR clients registered with a custom redirect URI are not persisted to client.json, preventing stale credentials on subsequent runs without the override. Closes #183
Copilot AI review requested due to automatic review settings
March 3, 2026 22:28…est isolation - Remove `customRedirect bool` parameter from `registerBC3Client`; derive it from `opts.RedirectURI != defaultRedirectURI` inside the function - Add `XDG_CONFIG_HOME` override in `TestRegisterBC3Client_UsesResolvedRedirectURI` to prevent writing to the developer's real config dir - Use full env var names in README sentence
jeremy
deleted the
oauth-redirect-uri
branch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters