Skip to content

Commit 3380d81

Browse files
authored
Rebuild Connectors docs from first principles for Public Beta (#144)
* Update Connectors docs for Public Beta on Go, Pro, and Enterprise * Rebuild Connectors docs from first principles for Public Beta * Address Connectors docs review findings * Fix denied approval, connection allowlist, and updateSpace overlay docs * Align API and CLI run-approval read guidance with getConnectorRun
1 parent 681cda7 commit 3380d81

14 files changed

Lines changed: 635 additions & 464 deletions

File tree

‎content/(account)/api-keys.mdx‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Your own browser session has no stored policy. Spacefast compiles one per team f
6969
|---|---|
7070
| `owner` | Every action (`*`) |
7171
| `admin` | Every action (`*`) |
72-
| `member` | A fixed list: read, create, update, rename, and publish spaces; read, promote, and download versions; read, attach, and verify domains; read, trigger, and create builds; read the team; read billing |
72+
| `member` | A fixed list: read, create, update, rename, and publish spaces; read, promote, and download versions; read, attach, and verify domains; read, trigger, and create builds; read and run team connectors (`connectors:read`, `connectors:execute`); read the team; read billing |
7373

7474
Two rules follow from that:
7575

@@ -78,6 +78,18 @@ Two rules follow from that:
7878

7979
Keys created through the API can also be scoped to a single Space instead of the whole team, which narrows the policy to exactly that Space.
8080

81+
## Limit connector access
82+
83+
By default, a key with connector scopes (such as `team_admin`) can reach every team connection. Narrow it to specific connections when an integration should only touch one account:
84+
85+
```bash
86+
sf api-keys create --name linear-bot --preset team_admin --connection cxn_abc123
87+
sf api-keys update key_0123456789abcdef --connection cxn_abc123 --connection cxn_def456
88+
sf api-keys update key_0123456789abcdef --all-connections
89+
```
90+
91+
Over the API, pass `connectorAccess: { connectionIds: ["cxn_abc123"] }` on `POST /v1/api-keys` or `PATCH /v1/api-keys/{apiKeyId}`, or `connectorAccess: null` to remove the limit. For OAuth apps and CLI logins, choose specific connections under **Choose Connections** on the consent screen, or edit them later on **Connected apps**. See [Connectors](/connectors).
92+
8193
## What an agent grant cannot do
8294

8395
Some actions are reserved for a signed-in person, at every permission level. No API key, agent grant, or OAuth token can do them:

‎content/(concepts)/teams.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ Things that catch people out:
9393

9494
On **Members**, each row has role and removal actions for owners and admins. Removing someone takes away their access to the team and every Space in it. Anything they published stays where it is, and you can invite them back later.
9595

96+
If the team uses [Connectors](/connectors), the removal review lists the departing member's connector dependencies. Their personal connections disconnect automatically along with any Space bindings pointing to them. Team connections they created stay active while their existing Space bindings stay in place; if an owner or admin rebinds a role on a public, link-shared, or password-protected Space, restore its public-serving allowance before expecting calls to succeed.
97+
9698
Two guards you cannot talk your way past:
9799

98100
- The last owner cannot be removed, and cannot be demoted. Add another owner first.

‎content/(dynamic)/connectors.mdx‎

Lines changed: 156 additions & 229 deletions
Large diffs are not rendered by default.

‎content/(dynamic)/functions.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Outbound requests from a worker leave from Cloudflare's shared network addresses
130130

131131
`env` carries the space's environment variables. See [Environment variables](/environment-variables) for how to set them.
132132

133-
`env.CONNECTORS` calls your Space's [connector roles](/connectors#call-it-from-functions) when the version declares any.
133+
`env.CONNECTORS` calls your Space's [connector roles](/space-connectors#call-it-from-functions) when the version declares any.
134134

135135
`env.DB` is always there. It is D1-shaped, so `env.DB.prepare(sql).bind(...).all()` is the call you already know. It reaches the space's own database through a broker, so no connection string ever lands in the bundle.
136136

‎content/(dynamic)/meta.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ export default defineMeta({
44
title: "Dynamic",
55
collapsed: false,
66
order: 5,
7-
pages: ["zero-runtime", "functions", "connectors", "team-connectors", "database", "environment-variables", "crons", "object-storage", "logs", "wordpress"],
7+
pages: ["zero-runtime", "functions", "connectors", "space-connectors", "database", "environment-variables", "crons", "object-storage", "logs", "wordpress"],
88
});

‎content/(dynamic)/space-connectors.mdx‎

Lines changed: 307 additions & 0 deletions
Large diffs are not rendered by default.

‎content/(dynamic)/team-connectors.mdx‎

Lines changed: 0 additions & 201 deletions
This file was deleted.

‎content/(reference)/config-file.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ The project config is the only writer. See [Crons](/crons) for the schedule gram
379379
| --- | --- | --- | --- |
380380
| `connectors` | object, up to 32 roles | none | Connector roles your pages call at `/__spacefast/connectors/<role>/<tool>` |
381381

382-
See [Connectors](/connectors) for each role's keys.
382+
See [Connectors in Spaces](/space-connectors) for each role's keys.
383383

384384
<a id="access" />
385385

‎content/api/authentication.mdx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,15 @@ const created = await client.post("/v1/api-keys", {
6969
| `ipAllowlist` | up to 100 strings, each ≤ 255 chars | Restrict the key to these addresses. Optional, nullable. |
7070
| `expiresAt` | ISO 8601 | When the key stops working. Optional, nullable. Omit for no expiry. |
7171
| `notBefore` | ISO 8601 | When the key starts working. Optional, nullable. |
72+
| `connectorAccess` | `{ connectionIds: string[] }` or `null` | Limit the key to specific connector connections (`cxn_…`). Omit or pass `null` to allow every team connection. |
7273

7374
Three rules the code enforces:
7475

7576
- **The secret appears once.** `POST /v1/api-keys` is the only response carrying `secret`. Every other API-key response carries `secretPreview` (first 8 characters, then the last 4).
7677
- **A key can never exceed its creator.** The derived policy must be a subset of the calling credential's policy. A wider request fails with `policy_exceeds_grantor`.
7778
- **Secrets are immutable.** There is no rotate-in-place. Create a new key, move traffic, then revoke the old one with `DELETE /v1/api-keys/{apiKeyId}`. That returns `204` and keeps the record for audit.
7879

79-
`PATCH /v1/api-keys/{apiKeyId}` changes name, scope, permissions, allowlist, and expiry. `scope` and `permissions` must be sent together or both omitted.
80+
`PATCH /v1/api-keys/{apiKeyId}` changes name, scope, permissions, allowlist, expiry, and `connectorAccess`. `scope` and `permissions` must be sent together or both omitted.
8081

8182
In the dashboard, keys live on the team's **Agents** page under **API keys**. The create form asks for **Name**, a **Policy preset**, and an optional **Expires**, then shows the secret once behind **Copy this key now. It won't be shown again.**
8283

@@ -115,7 +116,7 @@ Creating, rotating, and revoking a machine credential all need an API key or a s
115116

116117
## Sessions and OAuth
117118

118-
A signed-in browser session works as a cookie and as `Authorization: Bearer <session token>`. A session has no stored policy. It compiles one per team from the caller's live role, so an owner or admin gets everything the team can do and a member gets read, create, write, rename, publish, promote, download, and build actions.
119+
A signed-in browser session works as a cookie and as `Authorization: Bearer <session token>`. A session has no stored policy. It compiles one per team from the caller's live role, so an owner or admin gets everything the team can do and a member gets read, create, write, rename, publish, promote, download, build, and connector read/execute actions.
119120

120121
For third-party apps, Spacefast is an OAuth 2.0 authorization server.
121122

0 commit comments

Comments
 (0)