Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/self-host/hybrid.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ The Setup checks show the link as `hybrid_jira` (in Settings, Setup and the inst
| GitHub | yes | relay and token broker |
| Jira (Forge app) | yes | install CoderHelm's Jira app and enter your install id as the team id, or link a hosted team's site ([Jira through CoderHelm](#jira-through-coderhelm)) |
| Notion, Confluence, Google Drive | yes | one-click sign-in through CoderHelm; tokens brokered |
| Figma | yes | one-click sign-in through CoderHelm's public Figma app (read-only); tokens brokered, your install calls Figma's API |
| Slack and Teams notifications | not needed | your install posts to the incoming webhook you paste |
| Figma, Linear, Sentry, Sanity and other sign-in apps | not needed | your install registers itself with each provider; Figma signs in only apps it approved, so Figma uses your own Figma app or a key |
| Linear, Sentry, Sanity and other sign-in apps | not needed | your install registers itself with each provider |
| Slack and Teams commands | no | there is no shared Slack or Teams app: each team uses its own app's signing secret, as today |
| Sign in with GitHub | yes | CoderHelm's app carries the trip to GitHub; your install checks the account with GitHub and applies its own rules ([Sign in with GitHub through CoderHelm](#sign-in-with-github-through-coderhelm)) |
| Sign in with Google | no | a self-hosted install has no Google sign-in, through CoderHelm or its own ([Sign-in and people](./sign-in.md#no-google-sign-in)) |
Expand All @@ -176,6 +177,8 @@ The Setup checks show the link as `hybrid_jira` (in Settings, Setup and the inst

The hosted side runs in the hosted deployment's API stack when `hybrid.zone` is set in its config (the parent zone is configurable, so moving customer addresses to a separate domain later is a config change). It needs `hybrid_master_key` (32 or more random characters) in the hosted secret, the callback URL `https://api.coderhelm.com/auth/github/callback/hybrid` on CoderHelm's GitHub App, and the GitHub App's setup page (the dashboard's Settings, GitHub) to forward `state=hyb_…` returns. The same callback URL takes installs' GitHub sign-ins (`state=hsi_…`): installs call `POST /hybrid/github/sign-in/start` and `POST /hybrid/github/sign-in/exchange` (signed), and the audit log has `github_sign_in` and `github_sign_in_refused`; no other GitHub App setting is needed. A hosted team links its Jira site with `GET` and `POST /api/hybrid/jira-link/:state` (team admins, from the dashboard's Settings, Integrations, Jira, which opens with `?hybrid_link=hyj_…`); sees and removes the link with `GET` and `DELETE /api/hybrid/jira-link`; installs call `POST /hybrid/jira/link-start`, `DELETE /hybrid/jira/link` and `POST /hybrid/jira/config` (signed), and the Jira proxy at `POST /hybrid/jira/trigger/<install>/<action>/<token>`. Platform admins see every install and the audit log (`jira_link_start`, `link_jira`, `unlink_jira`, `jira_link_refused`, `jira_link_declined`) at `GET /api/admin/hybrid`, and revoke one with `POST /api/admin/hybrid/:install_id/revoke`.

**CoderHelm's Figma app.** A public Figma OAuth app owned by CoderHelm's own Figma team, with the one redirect URL `https://app.coderhelm.com/settings/integrations/mcp-callback/` and the scopes `current_user:read` and `file_content:read`. Its client id and secret go in the hosted secret as `figma_client_id` and `figma_client_secret`; until both are there, hosted teams see no Sign in with Figma and installs aren't offered Figma. Installs sign in through `GET /hybrid/oauth/figma/authorize` like Notion, Confluence and Google Drive: Figma returns to the hosted callback page, the hosted side finishes the sign-in in a holding partition and sends the browser to the install's own callback page with a one-time code, and the code becomes the install's only when the install redeems it with its registration secret and PKCE verifier.

**Approving an install for the mail relay.** An install with a GitHub link may use the relay already. To approve one without, set `relay_approved` to `true` on its `HYBRID#<install>` / `INSTALL` record in the hosted settings table, after checking who runs it.

**Relay brake.** The alarms `<prefix>-relay-bouncebrake` and `<prefix>-relay-complaintbrake` turn sending off for the configuration set `<prefix>-relay` through the function `<prefix>-relay-brake`. To turn it back on after finding the cause (the Deliveries of the install that sent the bounces): `aws sesv2 put-configuration-set-sending-options --configuration-set-name <prefix>-relay --sending-enabled`.
Expand Down
7 changes: 5 additions & 2 deletions docs/self-host/integrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,12 @@ New Relic, Confluence, OpenSearch, REST APIs, SQL databases, CloudWatch metrics
- **What you need**\
Nothing. Servers that support OAuth dynamic client registration register your install by themselves the first time someone signs in. The redirect URI is your install's `https://coderhelm.example.com/settings/integrations/mcp-callback/`, and the add flow shows it for servers that need an app registered by hand.
- **Figma**\
Figma's MCP server signs in only apps Figma approved, so CoderHelm runs Figma's tools with your own Figma app (or a personal access token). Create the app at https://www.figma.com/developers/apps under your Figma team or organization, add the redirect URI above, give it the `current_user:read` and `file_content:read` scopes, and publish it as a private app (no review from Figma; people in that team or organization can sign in). Paste its client id and secret in Settings, Integrations, Figma, Use my own Figma app, then select Connect.
Figma's MCP server signs in only apps Figma approved, so CoderHelm runs Figma's tools against Figma's API with a sign-in (or a personal access token). Three ways, in Settings, Integrations, Figma:
- **Sign in with Figma** (CoderHelm's app): with hybrid, choose CoderHelm's app for Figma (Settings, Version and updates, Hybrid, or on the Figma card) and sign in. Nothing to create. CoderHelm keeps the sign-in (encrypted) and hands your install access tokens that expire within ten minutes; agents call Figma from your install.
- **Use my own Figma app**: create the app at https://www.figma.com/developers/apps under your Figma team or organization, add the redirect URI above, give it the `current_user:read` and `file_content:read` scopes, and publish it as a private app (no review from Figma; people in that team or organization can sign in). Paste its client id and secret there, then select Connect.
- **For every team on the install**: put a Figma app's `figma_client_id` and `figma_client_secret` in the install's secret. The card's Sign in with Figma then uses it, with no hybrid.
- **With hybrid**\
No change: MCP sign-ins always go to your install directly.
MCP sign-ins go to your install directly, except Figma when CoderHelm's app is chosen for it (above).

## Knowledge sources

Expand Down
23 changes: 19 additions & 4 deletions services/common/src/hybrid/integrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ pub const CATALOG: &[Entry] = &[
stays_with_you: "The files your install reads and the index it builds.",
reason: "",
},
Entry {
id: "figma",
name: "Figma",
mode: Mode::Hosted,
through_coderhelm: "You sign in through CoderHelm's Figma app (read-only: your profile and file contents). CoderHelm keeps the sign-in (encrypted) and hands your install access tokens that expire within ten minutes.",
stays_with_you: "The designs your install reads. Agents call Figma's API from your install with those tokens.",
reason: "",
},
Entry {
id: "slack_notifications",
name: "Slack and Teams notifications",
Expand All @@ -90,9 +98,9 @@ pub const CATALOG: &[Entry] = &[
},
Entry {
id: "mcp_apps",
name: "Figma, Linear, Sentry, Sanity and other sign-in apps",
name: "Linear, Sentry, Sanity and other sign-in apps",
mode: Mode::Direct,
through_coderhelm: "Nothing: your install registers itself with each provider's sign-in server and keeps its own tokens. Figma signs in only apps it approved, so Figma uses your own Figma app or a key.",
through_coderhelm: "Nothing: your install registers itself with each provider's sign-in server and keeps its own tokens.",
stays_with_you: "Everything.",
reason: "",
},
Expand Down Expand Up @@ -161,11 +169,18 @@ mod tests {
let ids: Vec<_> = hosted_ids().collect();
assert_eq!(
ids,
vec!["github", "jira", "notion", "confluence", "google_drive"]
vec![
"github",
"jira",
"notion",
"confluence",
"google_drive",
"figma"
]
);
assert_eq!(
app_choice_ids().collect::<Vec<_>>(),
vec!["jira", "notion", "confluence", "google_drive"]
vec!["jira", "notion", "confluence", "google_drive", "figma"]
);
assert!(entry("github").is_some() && entry("nope").is_none());
let j = serde_json::to_value(entry("slack_commands").unwrap()).unwrap();
Expand Down
18 changes: 15 additions & 3 deletions services/common/src/mcp_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -589,15 +589,22 @@ pub struct OwnApp {
pub console: &'static str,
/// The vendor's guide to creating one.
pub guide: &'static str,
/// The keys in the deployment's secret holding CoderHelm's own public
/// app with the vendor (client id, client secret): the one-click
/// sign-in every team gets, and what the hosted broker signs in a
/// self-hosted install with. Never in code.
#[serde(skip)]
pub coderhelm_keys: (&'static str, &'static str),
}

/// The own-app sign-in for a catalog server, when its package takes an
/// OAuth token.
pub fn own_app(id: &str) -> Option<OwnApp> {
match id {
// Figma's REST API takes tokens from any OAuth app, and a private
// app needs no review from Figma for people on the team or
// organization that owns it. The token endpoint wants the client in
// Figma's REST API takes tokens from any OAuth app. A private app
// needs no review from Figma for people on the team or organization
// that owns it; CoderHelm's own public app (`coderhelm_keys`) was
// reviewed by Figma and signs in anyone. The token endpoint wants the client in
// an HTTP Basic header; refreshing has its own address and never
// rotates the refresh token. The package calls GET /v1/files,
// /v1/files/:key/nodes, /v1/images and /v1/files/:key/images (all
Expand All @@ -612,6 +619,7 @@ pub fn own_app(id: &str) -> Option<OwnApp> {
check: "https://api.figma.com/v1/me",
console: "https://www.figma.com/developers/apps",
guide: "https://developers.figma.com/docs/rest-api/oauth-apps/",
coderhelm_keys: ("figma_client_id", "figma_client_secret"),
}),
_ => None,
}
Expand Down Expand Up @@ -687,6 +695,10 @@ mod tests {
assert!(u.starts_with("https://"), "{}: {u}", p.id);
}
assert!(app.refresh.is_empty() || app.refresh.starts_with("https://"));
// CoderHelm's app is read from two keys named after the vendor.
let (id, secret) = app.coderhelm_keys;
assert_eq!(id, format!("{}_client_id", p.id));
assert_eq!(secret, format!("{}_client_secret", p.id));
}
assert!(own_app("sentry").is_none());
}
Expand Down
Loading
Loading