Uh oh!
There was an error while loading. Please reload this page.
feat: Add connection test command for SSO login flow - #177
feat: Add connection test command for SSO login flow#177jonatascastro12 wants to merge 5 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Original prompt from jonatas
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
❌ Cannot revive Devin session - the session is too old. Please start a new session instead. |
Summary
Adds
workos connection test <id>— an end-to-end SSO smoke test for a connection, run entirely from the CLI:http://localhost:<port>/callbackas an environment redirect URI automatically via the existingPOST /user_management/redirect_uriswrapper (client.redirectUris.add). If registration fails (e.g. insufficient permissions), it prints the URI and asks the user to add it in the Dashboard before continuing (errors out in agent/CI mode instead of prompting).sso.getAuthorizationUrl({ clientId, redirectUri, connection, state }), whereclientIdresolves from--client-id→WORKOS_CLIENT_ID→ the active environment's stored client ID.--no-opento disable), waits for the IdP redirect (default 300s timeout,--timeoutto override), validatesstate, exchanges the code viasso.getProfileAndToken, and prints the authenticated profile.Flags:
--client-id,--port(default 4807),--timeout,--open/--no-open, plus the usual--api-key/--json.JSON mode outputs
{ connectionId, redirectUri, redirectUriRegistered, authorizationUrl, profile }.Also registered in
bin.tsand thehelp-json.tscommand registry, with spec coverage for the happy path, flag overrides, IdP error callbacks, state mismatch, registration fallback prompts, agent-mode behavior, and JSON output.Test plan
pnpm test(2102 passed),pnpm typecheck,pnpm lint,pnpm format:check,pnpm buildall passsrc/commands/connection.spec.tsmock the HTTP server, browser open, and SDK to exercise the full callback flowLink to Devin session: https://app.devin.ai/sessions/68e059345eaa4022851eb4f324d9c361
Requested by: @jonatascastro12