feat: Add connection test command for SSO login flow#177
Open
jonatascastro12 wants to merge 5 commits into
Open
feat: Add connection test command for SSO login flow#177jonatascastro12 wants to merge 5 commits into
jonatascastro12 wants to merge 5 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Original prompt from jonatas
|
Contributor
🤖 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:
|
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>
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>
Contributor
|
❌ Cannot revive Devin session - the session is too old. Please start a new session instead. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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