Repository navigation
Figma signs in with Coderhelm's public Figma app, on hosted and through the broker on hybrid installs - #521
Merged
Merged
Conversation
…gh the broker on hybrid installs
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
Figma signs in with Coderhelm's own public Figma app, the same way Notion, Confluence and Google Drive do: one button on the hosted service, and on a hybrid install through the hosted broker. The team's own Figma app (#518) and a key stay as the other choices.
Figma needs one redirect URL for every team and every install:
https://app.coderhelm.com/settings/integrations/mcp-callback/. An install never sends its own address to Figma. The hosted callback page hands the answer toPOST /hybrid/oauth/callback, which finishes the sign-in in a holding partition and sends the browser to the install's own callback page (checked against the install's origins byredirect_allowed) with a one-time code. The code becomes the install's only when the install redeems it with its registration secret and its PKCE verifier. Figma's refresh token and Coderhelm's client secret stay on the hosted side. The install gets ten-minute access tokens and renews them with a grant handle.Changes
mcp_catalog::OwnAppnames the secret keys of Coderhelm's app (figma_client_id,figma_client_secret); the gateway'sSecretsreads both.mcp_remote::own_app:use_coderhelm_app(directly with the app from the secret, or through the broker),brokered_record, andsource(whose app a record uses). One record per server, so switching apps ends the old sign-in and reconnecting with the same app keeps it.routes/hybrid.rs): aBrokeredprovider is a knowledge source or a catalog app (Figma). Authorize, callback, token and revoke serve Figma unchanged otherwise. Figma is offered to installs only once both keys are in the hosted secret.POST /api/mcp-servers/apps/:catalog_id/coderhelm(integrations capability) starts the sign-in. The Figma card's detail hascoderhelm_app, andown_app.sourcesays whose app signed in. The card says "Signed in with Coderhelm's app."Verification
cargo fmt --check,cargo clippy -D warnings(common, gateway, worker),cargo testfor common, gateway and worker: see the PR checks.