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
2 changes: 1 addition & 1 deletion docs/self-host/check-your-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Install admins (`admins` in the config) who are team admins can call these while
}
```

`status` is `pass`, `warn`, `fail` or `skip` (an optional integration that isn't set up). `fix` has `text` and any of `command` (to copy), `url` (outside CoderHelm) and `href` (a dashboard page). `ready` is true when nothing fails. Keys: `url`, `domain`, `github_keys`, `github_app`, `github_permissions`, `github_installations`, `github_webhook`, `github_sign_in`, `email_sender`, `email_identity`, `email_sandbox`, `email_cognito`, `model`, `dlq`, `updates`, `slack`, `teams`, `jira`, `aws_connections`. A self-hosted install has no Google sign-in, so there is no `google_sign_in` check. On an install that uses CoderHelm's GitHub App (hybrid), `github_app` and `github_installations` say whether the app is linked instead, and never block an update. `github_sign_in` warns when the install's own GitHub App has no OAuth client id and secret stored (or only one of them): without both, the sign-in page doesn't offer Continue with GitHub. On an install that uses CoderHelm's GitHub App it is `skip`, since CoderHelm's app can't sign anyone in to the install; people sign in with email and password. It never blocks an update.
`status` is `pass`, `warn`, `fail` or `skip` (an optional integration that isn't set up). `fix` has `text` and any of `command` (to copy), `url` (outside CoderHelm) and `href` (a dashboard page). `ready` is true when nothing fails. Keys: `url`, `domain`, `github_keys`, `github_app`, `github_permissions`, `github_installations`, `github_webhook`, `github_sign_in`, `email_sender`, `email_identity`, `email_sandbox`, `email_cognito`, `model`, `dlq`, `updates`, `slack`, `teams`, `jira`, `aws_connections`. A self-hosted install has no Google sign-in, so there is no `google_sign_in` check. On an install that uses CoderHelm's GitHub App (hybrid), `github_app` and `github_installations` say whether the app is linked instead, and never block an update. `github_sign_in` passes when the install's own GitHub App has its OAuth client id and secret stored, or when the install has neither and is registered with CoderHelm (GitHub sign-in then goes through CoderHelm's app, [Sign in with GitHub through CoderHelm](./hybrid.md#sign-in-with-github-through-coderhelm)). It warns when only one of the two is stored, when the install's own app has neither, and when an install on CoderHelm's GitHub App isn't registered yet: the sign-in page doesn't offer Continue with GitHub until then. It never blocks an update.

### `GET /api/system/domain`, `PUT /api/system/domain`, `DELETE /api/system/domain`

Expand Down
26 changes: 23 additions & 3 deletions docs/self-host/hybrid.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Your code, runs, plans, reviews, memory, knowledge and secrets stay in your AWS
| Token broker | the short-lived installation token it mints for your install (scoped to the repositories you chose, never more than the app's permissions) | no tokens; a record of each mint for 14 days |
| Jira app relay | each issue event, in transit, unchanged | as for GitHub. The Forge app's secret is checked by your install, so CoderHelm can't make an event up |
| Jira site link | each event of the linked site (the Jira app's and a plain Jira webhook's), in transit, without the app's secret; your install's calls to the site's Jira app (comments, tickets, release notes), in transit, through CoderHelm's Jira proxy | as for GitHub; the link itself (which team's site, who linked it, when). The site's Jira app secret and links stay with CoderHelm |
| GitHub sign-in (when your install has no GitHub OAuth client of its own) | GitHub's one-time code on its way to your install, and the person's GitHub token twice: in the answer to your install's exchange, and when your install has it revoked moments later | no codes and no tokens: the code's hash for at most 5 minutes, and an audit line that a sign-in happened (no name, no account) |
| Notion, Confluence, Google Drive | the sign-in, once | the provider sign-in, encrypted with a key only CoderHelm's services can use, so it can hand your install access tokens. Disconnecting revokes it. Notion's tokens don't expire by themselves: a copy your install holds stays valid until Notion's own integration page removes it |
| Email through CoderHelm (opt-in, [Email](./email.md#send-through-coderhelm)) | each email's recipient address, template id and parameters (names, PR titles and run links in the weekly summary), in transit; CoderHelm writes the email from its own templates | delivery metadata only: template id, a shortened address and the status, for 3 days. Salted hashes of the addresses your install listed, and your install admins' addresses sealed with a key only CoderHelm's services can use, to tell them if email pauses |
| Sharing with support (opt-in) | metadata of failed deliveries, and payload previews only if you also choose that | for 14 days, so support can see what failed |
Expand All @@ -53,6 +54,7 @@ How the pieces are protected:
- **Signed both ways, each call once.** Every call from your install is signed (`X-CoderHelm-Signature: v2=…`) over the time, a single-use request id (`X-CoderHelm-Request-Id`), the method, the path with its query, and the body. CoderHelm takes each request id once, so a copy of a call (from a log, a proxy or a HAR file) is refused even within the 5 minutes it would otherwise be fresh. Releases before `v2` sign with `v1=`, which covers neither an id nor the query: CoderHelm accepts those only until **2026-11-17 00:00 UTC**, never with a query, and takes each one once by its own signature, so it can't be replayed either. Update before then (Settings, System, Update now). Every relayed event is signed with your relay key (`X-CoderHelm-Relay-Signature: t=,d=,v1=,v2=`; `v2` also covers the source and event headers, and an event without it is refused). Your install refuses anything older than 5 minutes and any delivery id it has already taken, and refuses an event it couldn't record as taken.
- **Linking proves both sides.** Linking CoderHelm's GitHub App needs your install (its setup key in the guide, or an install admin in Settings), a GitHub sign-in that shows the installation is yours, and a press of **Link** on a CoderHelm page that names your install's address. A GitHub redirect or a link someone sends you can't link anything by itself.
- **Scoped tokens.** The broker mints tokens only for installations linked to your install, narrowed to the repositories you chose and, within those, to the repositories the person who linked it can push to on GitHub. GitHub itself enforces both: they are part of the token request.
- **Your install decides who signs in.** GitHub sign-in through CoderHelm's app is bound to the browser and the install that started it, and your install asks GitHub itself whose account it is. See [Sign in with GitHub through CoderHelm](#sign-in-with-github-through-coderhelm).
- **Sign-ins are yours only once your install takes them.** A Notion, Confluence or Google Drive sign-in is held apart until your install redeems it with its secret and its PKCE verifier, so nobody else can put their account in place of yours.
- **Revocable.** CoderHelm can turn an install's access off (its name and records go, its GitHub links are removed, the relay and broker refuse it, and the same CloudFront can't register again), and every action is in an audit log.
- **Email only as itself.** See [Email threat model](#email-threat-model) below.
Expand Down Expand Up @@ -104,7 +106,25 @@ A name can change five times a day. [Uninstalling](./uninstall.md#hybrid-install
3. CoderHelm shows which install the organization is about to be linked to. Check the address and press **Link**.
4. You come back linked. Tokens reach only the repositories you can push to on GitHub; someone with more access can link it again to widen that. From then on GitHub sends events to CoderHelm, which forwards each one to `https://<your CloudFront>/webhooks/relay`, and your install asks the broker for tokens when it works on a repository.

A forward that fails is retried with growing waits for about 24 hours. Both sides show it on their **Deliveries** page with each attempt, the answer and the next retry. Choose your own GitHub App again any time; signing in with GitHub on your install needs your own app.
A forward that fails is retried with growing waits for about 24 hours. Both sides show it on their **Deliveries** page with each attempt, the answer and the next retry. Choose your own GitHub App again any time.

## Sign in with GitHub through CoderHelm

An install on CoderHelm's GitHub App has no GitHub OAuth client of its own, and GitHub only sends people back to addresses registered on CoderHelm's app. So once your install is registered, **Continue with GitHub** on its sign-in page goes through CoderHelm, and your install still makes the decision:

1. Your install makes a random state and a secret PKCE verifier, keeps them in a sealed cookie in the person's browser, and asks CoderHelm (signed with its registration secret) to start a sign-in that comes back to its own address. CoderHelm refuses any address that isn't your install's verified CloudFront address or CoderHelm address.
2. The person signs in on GitHub's own page, with CoderHelm's app.
3. GitHub sends the browser to CoderHelm with a one-time code, and CoderHelm sends it straight on to your install with that code. CoderHelm doesn't exchange it.
4. Your install checks the state against the cookie (so a sign-in started in another browser, or for another install, is refused), then asks CoderHelm (signed) to exchange the code with its verifier. GitHub checks the verifier too: without it the code is useless. Each code is taken once.
5. Your install asks GitHub, with the person's token, whose account it is, then applies its own rules: only members, invited people and allowed domains get in (no new sign-ups), and two-factor is asked for as on every sign-in. Then it has CoderHelm revoke the token at GitHub, so it lives for seconds.

What CoderHelm sees and can do:

- **Sees:** that someone on your install started a GitHub sign-in, the one-time code on its way through, and the person's GitHub token for the few seconds between the exchange and the revoke. It keeps neither, and it doesn't ask GitHub who the person is. It keeps the code's hash for at most 5 minutes and an audit line with no name.
- **Can't:** start a session on your install, pick who signs in, or get past your install's rules. Your install reads the GitHub account from GitHub, not from CoderHelm, and the second factor is your install's own.
- **Could, in principle:** use the token in those few seconds for what CoderHelm's GitHub App may do as that person, since it passes through CoderHelm's servers. If that matters to you, give the install its own GitHub App (Settings, System, Hybrid, **Use my own GitHub App (fully private)**); sign-in then never touches CoderHelm.

Signing in through CoderHelm doesn't link GitHub organizations: that only happens through [CoderHelm's GitHub App](#coderhelms-github-app) linking. It works on your CloudFront address and your CoderHelm address; an install that answers on a domain of its own uses one of those for GitHub sign-in. The `github_sign_in` check in **Settings, Setup** says whether it's on.

## Jira through CoderHelm

Expand Down Expand Up @@ -145,7 +165,7 @@ The Setup checks show the link as `hybrid_jira` (in Settings, Setup and the inst
| 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 |
| 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 | no | it would hand your people's identities to CoderHelm; use email and password |
| 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)) |

## Turn hybrid off
Expand All @@ -154,7 +174,7 @@ The Setup checks show the link as `hybrid_jira` (in Settings, Setup and the inst

## For CoderHelm's operators

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. 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`.
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`.

**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.

Expand Down
4 changes: 2 additions & 2 deletions docs/self-host/sign-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ An install that had Google sign-in on loses it at its next update, which removes

## GitHub accounts

People connect their GitHub account in their own settings, so pull requests and reviews are credited to them. Signing in with GitHub follows the same rules as everything else: it lands on the organization only for someone already in it, invited, or at an allowed domain (by the email on their GitHub account). It uses the GitHub App's own OAuth client, which the GitHub App step stores; nothing to set up. The sign-in page offers **Continue with GitHub** only while that client's id and secret are both stored (it asks the API, `GET /auth/methods`). An install on CoderHelm's GitHub App (hybrid) has no client of its own, so its sign-in page shows email and password only: signing in through CoderHelm would hand your people's identities to CoderHelm. The `github_sign_in` check in **Settings, Setup** says which applies.
People connect their GitHub account in their own settings, so pull requests and reviews are credited to them. Signing in with GitHub follows the same rules as everything else: it lands on the organization only for someone already in it, invited, or at an allowed domain (by the email on their GitHub account). It uses the GitHub App's own OAuth client, which the GitHub App step stores; nothing to set up. An install on CoderHelm's GitHub App (hybrid) has no client of its own: once it is registered with CoderHelm, GitHub sign-in goes through CoderHelm's app, and the install still checks the account with GitHub itself and applies these same rules and two-factor ([Sign in with GitHub through CoderHelm](./hybrid.md#sign-in-with-github-through-coderhelm)). The sign-in page offers **Continue with GitHub** only when one of the two works (it asks the API, `GET /auth/methods`). The `github_sign_in` check in **Settings, Setup** says which applies.

## Single sign-on (SAML, OIDC)

Not available yet: CoderHelm's sign-in page offers email and password, and GitHub when the install has its own GitHub App. The Cognito user pool is in your account, so an identity provider added there by hand is not shown on the sign-in page and isn't supported.
Not available yet: CoderHelm's sign-in page offers email and password, and GitHub. The Cognito user pool is in your account, so an identity provider added there by hand is not shown on the sign-in page and isn't supported.

## Install admins and team roles

Expand Down
Loading
Loading