@vercel/board 0.33.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{access-N3XmkKXg.mjs → access-BsP0hvcC.mjs} +169 -12
- package/dist/access.d.mts +3 -3
- package/dist/access.mjs +5 -5
- package/dist/{actors-ihyN47OV.mjs → actors-DFOpTw89.mjs} +2 -2
- package/dist/{auth-D6z3rMNj.d.mts → auth-C21V0EK1.d.mts} +128 -9
- package/dist/auth-CrjXLgOb.mjs +599 -0
- package/dist/{backend-CWpyR1A7.d.mts → backend-D21q8mdm.d.mts} +30 -7
- package/dist/backend-local.d.mts +1 -1
- package/dist/backend-local.mjs +1 -1
- package/dist/{chat-provider-DJpFUaFv.d.mts → chat-provider-DmZCmBkb.d.mts} +2 -2
- package/dist/cli-commands.d.mts +1 -1
- package/dist/cli-commands.mjs +1 -1
- package/dist/cli-embedded.d.mts +2 -2
- package/dist/cli-embedded.mjs +1 -1
- package/dist/cli.mjs +5 -5
- package/dist/{commands-BOBQHVqM.d.mts → commands-BorACIFS.d.mts} +168 -1
- package/dist/{commands-CHoMl06v.mjs → commands-CENWob9m.mjs} +281 -11
- package/dist/{conformance-qKmGLTAT.mjs → conformance-CKrwglzA.mjs} +491 -105
- package/dist/conformance.d.mts +20 -2
- package/dist/conformance.mjs +1 -1
- package/dist/{engine-JxgZiikU.mjs → engine-wN7quvbU.mjs} +2 -2
- package/dist/{errors-Pk0XV1hK.mjs → errors-rYDxZEuN.mjs} +116 -7
- package/dist/exports-BxljH73E.d.mts +4 -0
- package/dist/{exports-gHDHlg0i.mjs → exports-GIRJm2Ja.mjs} +136 -26
- package/dist/{index-CXvvYNYj.d.mts → index-LREsSZb2.d.mts} +2 -2
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +4 -4
- package/dist/index.node.d.mts +6 -6
- package/dist/index.node.mjs +3 -3
- package/dist/inspect/app.js +32 -32
- package/dist/{local-BbLjA5vI.mjs → local-yKwdgukb.mjs} +1981 -1574
- package/dist/{main-CQpCZJFw.mjs → main-DjokcEAL.mjs} +440 -50
- package/dist/{middleware-BU7rVi9F.mjs → middleware-BxgizazV.mjs} +1 -1
- package/dist/provider-DEOfc4Ls.d.mts +1049 -0
- package/dist/{provider-BlzUvcM9.d.mts → routes-BpKdMvgX.d.mts} +2461 -2480
- package/dist/{serve-D8_W4UN6.mjs → serve-CJ8hauK2.mjs} +4 -4
- package/dist/{server-BiIUXWbU.mjs → server-CtaTtyhw.mjs} +7 -7
- package/dist/{serving-D7rcUtSC.mjs → serving-6_bhBNAW.mjs} +1 -1
- package/dist/sync-chat-sdk.d.mts +2 -2
- package/dist/sync-github.d.mts +2 -2
- package/dist/sync-linear.d.mts +3 -2
- package/dist/sync-slack.d.mts +3 -3
- package/dist/sync.d.mts +2 -2
- package/dist/{targets-CknPGGVi.mjs → targets-n2i2ZOWI.mjs} +104 -12
- package/dist/{tokens-DPKjl3jf.mjs → tokens-Dn4cPZIr.mjs} +2 -2
- package/docs/01-board/01-mounting.md +12 -5
- package/docs/01-board/03-identity.md +14 -13
- package/docs/01-board/07-schedules.md +1 -1
- package/docs/01-board/09-access.md +170 -58
- package/docs/03-guides/03-ci.md +19 -17
- package/docs/03-guides/05-agent-factory.md +5 -6
- package/docs/04-reference/01-cli.md +99 -22
- package/docs/04-reference/02-board.md +42 -11
- package/docs/04-reference/03-http.md +21 -14
- package/docs/04-reference/05-conformance.md +31 -5
- package/package.json +1 -1
- package/dist/auth-r-_PeZyw.mjs +0 -277
- package/dist/exports-BuKjVq2t.d.mts +0 -4
- package/dist/folds-DjFTiqIM.d.mts +0 -552
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as BoardError } from "./errors-
|
|
2
|
-
import { t as board, u as localTokenFile } from "./server-
|
|
3
|
-
import { t as oidcTokens } from "./tokens-
|
|
4
|
-
import { t as local } from "./local-
|
|
1
|
+
import { u as BoardError } from "./errors-rYDxZEuN.mjs";
|
|
2
|
+
import { t as board, u as localTokenFile } from "./server-CtaTtyhw.mjs";
|
|
3
|
+
import { t as oidcTokens } from "./tokens-Dn4cPZIr.mjs";
|
|
4
|
+
import { t as local } from "./local-yKwdgukb.mjs";
|
|
5
5
|
import { mkdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
6
6
|
import { userInfo } from "node:os";
|
|
7
7
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { d as createBoardClient, o as json, t as HttpError, u as BoardError } from "./errors-
|
|
1
|
+
import { d as createBoardClient, o as json, t as HttpError, u as BoardError } from "./errors-rYDxZEuN.mjs";
|
|
2
2
|
import "./schemas-BG205xds.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { a as DERIVED_ID, c as keyId, l as sha256 } from "./middleware-
|
|
5
|
-
import { a as registrant, o as wakePath, r as createVercel, t as createBoard } from "./exports-
|
|
3
|
+
import { P as RegisterBody, Y as routes, a as compileWatcher, c as METHODS, i as canonicalWatchers } from "./targets-n2i2ZOWI.mjs";
|
|
4
|
+
import { a as DERIVED_ID, c as keyId, l as sha256 } from "./middleware-BxgizazV.mjs";
|
|
5
|
+
import { a as registrant, o as wakePath, r as createVercel, t as createBoard } from "./exports-GIRJm2Ja.mjs";
|
|
6
6
|
import { execFile } from "node:child_process";
|
|
7
7
|
import { createHash } from "node:crypto";
|
|
8
8
|
import { mkdir, readFile, readdir, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -841,7 +841,7 @@ function createHttp(url, options, environment) {
|
|
|
841
841
|
}).catch(rethrow);
|
|
842
842
|
} else if (route.method === "GET") response = await client.request(`${path}${queryString(fields)}`, { signal }).catch(rethrow);
|
|
843
843
|
else response = await client.request(path, {
|
|
844
|
-
method:
|
|
844
|
+
method: route.method,
|
|
845
845
|
body: new TextEncoder().encode(JSON.stringify(fields)),
|
|
846
846
|
headers: { "content-type": "application/json" },
|
|
847
847
|
signal
|
|
@@ -1087,8 +1087,8 @@ function vercel(options = {}) {
|
|
|
1087
1087
|
function board(options = {}) {
|
|
1088
1088
|
return createBoard(options, {
|
|
1089
1089
|
backend: (fetch) => process.env.BOARD_URL?.trim() ? http() : vercel(fetch ? { fetch } : {}),
|
|
1090
|
-
sync: () => import("./engine-
|
|
1091
|
-
serving: () => import("./serving-
|
|
1090
|
+
sync: () => import("./engine-wN7quvbU.mjs"),
|
|
1091
|
+
serving: () => import("./serving-6_bhBNAW.mjs")
|
|
1092
1092
|
});
|
|
1093
1093
|
}
|
|
1094
1094
|
//#endregion
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as ownTeamId, n as discoveryIdentity, r as ownProjectId, t as oidcTokens } from "./tokens-
|
|
1
|
+
import { i as ownTeamId, n as discoveryIdentity, r as ownProjectId, t as oidcTokens } from "./tokens-Dn4cPZIr.mjs";
|
|
2
2
|
export { discoveryIdentity, oidcTokens, ownProjectId, ownTeamId };
|
package/dist/sync-chat-sdk.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as channels, g as SyncFn, p as SyncProvider } from "./provider-
|
|
2
|
-
import { r as ChatTransport, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { b as channels, g as SyncFn, p as SyncProvider } from "./provider-DEOfc4Ls.mjs";
|
|
2
|
+
import { r as ChatTransport, t as ChatInput } from "./chat-provider-DmZCmBkb.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { ReactionEvent } from "chat";
|
|
5
5
|
//#region src/sync/chat-sdk.d.ts
|
package/dist/sync-github.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as SyncContext, g as SyncFn, y as SyncUnit } from "./provider-
|
|
2
|
-
import { n as ChatSyncProvider } from "./chat-provider-
|
|
1
|
+
import { f as SyncContext, g as SyncFn, y as SyncUnit } from "./provider-DEOfc4Ls.mjs";
|
|
2
|
+
import { n as ChatSyncProvider } from "./chat-provider-DmZCmBkb.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { Adapter } from "chat";
|
|
5
5
|
//#region src/sync/github.d.ts
|
package/dist/sync-linear.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { st as SourceRead } from "./routes-BpKdMvgX.mjs";
|
|
2
|
+
import { c as ReceivedEvent, d as ResolvedTarget, f as SyncContext, g as SyncFn, o as ProviderPost, r as ProviderDelivery, y as SyncUnit } from "./provider-DEOfc4Ls.mjs";
|
|
3
|
+
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-DmZCmBkb.mjs";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { Adapter } from "chat";
|
|
5
6
|
//#region src/sync/linear.d.ts
|
package/dist/sync-slack.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { b as channels, d as ResolvedTarget, f as SyncContext, g as SyncFn, o as ProviderPost, r as ProviderDelivery } from "./provider-
|
|
3
|
-
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-
|
|
1
|
+
import { on as ExternalLink } from "./routes-BpKdMvgX.mjs";
|
|
2
|
+
import { b as channels, d as ResolvedTarget, f as SyncContext, g as SyncFn, o as ProviderPost, r as ProviderDelivery } from "./provider-DEOfc4Ls.mjs";
|
|
3
|
+
import { n as ChatSyncProvider, t as ChatInput } from "./chat-provider-DmZCmBkb.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { Adapter } from "chat";
|
|
6
6
|
//#region src/sync/slack.d.ts
|
package/dist/sync.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A as envelope, C as render, D as SyncOverrides, E as RootOverride, O as SyncResult, S as mirror, T as ProviderEvent, _ as SyncIn, a as ProviderOptions, b as channels, c as ReceivedEvent, d as ResolvedTarget, f as SyncContext, g as SyncFn, h as Sync, i as ProviderFile, j as eventSchema, k as SyncRoot, l as RenderInput, m as UnreadableError, n as FileDelivery, o as ProviderPost, p as SyncProvider, r as ProviderDelivery, s as Receive, u as Renderer, v as SyncOut, w as EventBase, x as into, y as SyncUnit } from "./provider-
|
|
1
|
+
import { an as ExternalFile, in as ExternalEvent, rn as ExternalAuthor } from "./routes-BpKdMvgX.mjs";
|
|
2
|
+
import { A as envelope, C as render, D as SyncOverrides, E as RootOverride, O as SyncResult, S as mirror, T as ProviderEvent, _ as SyncIn, a as ProviderOptions, b as channels, c as ReceivedEvent, d as ResolvedTarget, f as SyncContext, g as SyncFn, h as Sync, i as ProviderFile, j as eventSchema, k as SyncRoot, l as RenderInput, m as UnreadableError, n as FileDelivery, o as ProviderPost, p as SyncProvider, r as ProviderDelivery, s as Receive, u as Renderer, v as SyncOut, w as EventBase, x as into, y as SyncUnit } from "./provider-DEOfc4Ls.mjs";
|
|
3
3
|
export { EventBase, type ExternalAuthor, ExternalEvent, type ExternalFile, type FileDelivery, type ProviderDelivery, type ProviderEvent, type ProviderFile, type ProviderOptions, type ProviderPost, type Receive, ReceivedEvent, type RenderInput, type Renderer, ResolvedTarget, type RootOverride, type Sync, type SyncContext, type SyncFn, type SyncIn, type SyncOut, SyncOverrides, SyncProvider, type SyncResult, type SyncRoot, type SyncUnit, UnreadableError, channels, envelope, eventSchema, into, mirror, render };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as DIRECT_UPLOAD_BYTES_MAX, p as ATTACHMENT_BYTES_MAX, r as badRequest, t as HttpError } from "./errors-
|
|
1
|
+
import { m as DIRECT_UPLOAD_BYTES_MAX, p as ATTACHMENT_BYTES_MAX, r as badRequest, t as HttpError } from "./errors-rYDxZEuN.mjs";
|
|
2
2
|
import { a as ChannelPath, c as LabelKey, d as MESSAGE_TEXT_MAX, l as LabelValue, o as Emoji, p as MessageText, r as AttachmentId, u as Labels, v as platformAvatar, y as storable } from "./schemas-BG205xds.mjs";
|
|
3
3
|
import { a as Link, i as ExternalTarget, l as isThreadTarget, n as ExternalEvent, o as Origin, t as ExternalAuthor } from "./external-CYe424fO.mjs";
|
|
4
|
-
import { o as options } from "./commands-
|
|
4
|
+
import { o as options } from "./commands-CENWob9m.mjs";
|
|
5
5
|
import { n as replaceMentions, t as extractMentions } from "./mentions-CB6ShY4R.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
//#region src/api/routes.ts
|
|
@@ -132,12 +132,87 @@ const CanGrant = z.union([z.literal("all"), z.array(z.string().min(1).max(16)).m
|
|
|
132
132
|
/** What a grant or token lets do: `'all'`, a list for every channel, or a map from channel pattern to one. board() checks the patterns. */
|
|
133
133
|
const Can = z.union([CanGrant, z.record(z.string().min(1).max(300), CanGrant)]);
|
|
134
134
|
const ClaimValue = z.string().min(1).max(1e3);
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
135
|
+
const Environments = z.array(z.string().min(1).max(100)).min(1).max(16);
|
|
136
|
+
/**
|
|
137
|
+
* Who a grant names, as people write it: a user by email (or, where the board can't look one up,
|
|
138
|
+
* by ID), a project by name or ID, a repository by `owner/name`. The board resolves names and keeps
|
|
139
|
+
* IDs; a board that verifies tokens itself takes IDs only. A `user` names `email` or `userId`.
|
|
140
|
+
* Nothing else: a key it doesn't know (a misspelled `workflows`, say) is a 400, never dropped,
|
|
141
|
+
* since dropping it would name more than was meant.
|
|
142
|
+
*/
|
|
143
|
+
const PrincipalInput = z.discriminatedUnion("kind", [
|
|
144
|
+
z.strictObject({
|
|
145
|
+
kind: z.literal("user"),
|
|
146
|
+
email: z.string().min(3).max(320).optional(),
|
|
147
|
+
userId: z.string().min(1).max(200).optional()
|
|
148
|
+
}),
|
|
149
|
+
z.strictObject({
|
|
150
|
+
kind: z.literal("project"),
|
|
151
|
+
project: z.string().min(1).max(200),
|
|
152
|
+
environments: Environments.optional()
|
|
153
|
+
}),
|
|
154
|
+
z.strictObject({
|
|
155
|
+
kind: z.literal("github"),
|
|
156
|
+
repository: z.string().min(3).max(200),
|
|
157
|
+
workflow: z.string().min(1).max(300).optional(),
|
|
158
|
+
branch: z.string().min(1).max(255).optional(),
|
|
159
|
+
event: z.string().min(1).max(64).optional()
|
|
160
|
+
}),
|
|
161
|
+
z.strictObject({
|
|
162
|
+
kind: z.literal("oidc"),
|
|
163
|
+
issuer: z.string().min(1).max(1e3),
|
|
164
|
+
claims: z.record(z.string().min(1).max(200), z.union([ClaimValue, z.array(ClaimValue).min(1).max(32)]))
|
|
165
|
+
}),
|
|
166
|
+
z.strictObject({ kind: z.literal("all-users") }),
|
|
167
|
+
z.strictObject({
|
|
168
|
+
kind: z.literal("all-projects"),
|
|
169
|
+
environments: Environments.optional()
|
|
170
|
+
}),
|
|
171
|
+
z.strictObject({
|
|
172
|
+
kind: z.literal("app"),
|
|
173
|
+
app: z.string().min(1).max(200)
|
|
174
|
+
}),
|
|
175
|
+
z.strictObject({ kind: z.literal("all-apps") }),
|
|
176
|
+
z.strictObject({ kind: z.literal("everyone") })
|
|
177
|
+
]);
|
|
178
|
+
/** What a grant lets its principals do: a map from channel pattern to `'all'` or a list, `[]` for none. Kept as written. */
|
|
179
|
+
const GrantCan = z.record(z.string().min(1).max(300), CanGrant);
|
|
180
|
+
/** A grant: who it names, and one `can` for all of them. The same principals again are another grant. */
|
|
181
|
+
const GrantBody = z.strictObject({
|
|
182
|
+
principals: z.array(PrincipalInput).min(1).max(32),
|
|
183
|
+
can: GrantCan
|
|
140
184
|
});
|
|
185
|
+
/**
|
|
186
|
+
* Which grant decides a channel, and what it gives, for the caller or a principal it names: a
|
|
187
|
+
* `user` (by email, or by ID where the board can't look one up), a `project` in one `environment`
|
|
188
|
+
* (production by default), a `github` repository's run (with its `workflow`, `branch`, and
|
|
189
|
+
* `event`), or an `oidc` issuer's token with each `claim` as `name=value`.
|
|
190
|
+
*/
|
|
191
|
+
const ExplainQuery = z.object({
|
|
192
|
+
channel: ChannelPath,
|
|
193
|
+
user: z.string().min(1).max(320).optional(),
|
|
194
|
+
project: z.string().min(1).max(200).optional(),
|
|
195
|
+
environment: z.string().min(1).max(100).optional(),
|
|
196
|
+
github: z.string().min(3).max(200).optional(),
|
|
197
|
+
workflow: z.string().min(1).max(300).optional(),
|
|
198
|
+
branch: z.string().min(1).max(255).optional(),
|
|
199
|
+
event: z.string().min(1).max(64).optional(),
|
|
200
|
+
oidc: z.string().min(1).max(1e3).optional(),
|
|
201
|
+
claim: repeated.optional(),
|
|
202
|
+
app: z.string().min(1).max(200).optional()
|
|
203
|
+
}).refine((query) => [
|
|
204
|
+
query.user,
|
|
205
|
+
query.project,
|
|
206
|
+
query.github,
|
|
207
|
+
query.oidc,
|
|
208
|
+
query.app
|
|
209
|
+
].filter((value) => value !== void 0).length <= 1, "name one principal: user, project, github, oidc, or app").refine((query) => query.environment === void 0 || query.project !== void 0, "environment goes with project").refine((query) => query.workflow === void 0 && query.branch === void 0 && query.event === void 0 || query.github !== void 0, "workflow, branch, and event go with github").refine((query) => query.claim === void 0 || query.oidc !== void 0, "claim goes with oidc");
|
|
210
|
+
/** A grant's change: principals to add and to remove, and a `can` to replace its own. */
|
|
211
|
+
const UpdateGrantBody = z.strictObject({
|
|
212
|
+
add: z.array(PrincipalInput).min(1).max(32).optional(),
|
|
213
|
+
remove: z.array(PrincipalInput).min(1).max(32).optional(),
|
|
214
|
+
can: GrantCan.optional()
|
|
215
|
+
}).refine((body) => body.add !== void 0 || body.remove !== void 0 || body.can !== void 0, "name principals to add or remove, or a can");
|
|
141
216
|
/** A token acting as the caller: what it may do, and the profile and session every request with it writes as. */
|
|
142
217
|
const TokenBody = z.object({
|
|
143
218
|
name: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/, "a token name is up to 64 letters, numbers, and ._-"),
|
|
@@ -394,8 +469,12 @@ const ReactBody = z.object({
|
|
|
394
469
|
emoji: Emoji,
|
|
395
470
|
remove: z.boolean().optional()
|
|
396
471
|
});
|
|
397
|
-
/**
|
|
398
|
-
|
|
472
|
+
/**
|
|
473
|
+
* A channel to make before anything posts to it, and nothing else: a key it doesn't know is a 400,
|
|
474
|
+
* so a client that asks for more than a channel (one that expects `private: true` to close it, say)
|
|
475
|
+
* is told, never handed an open one.
|
|
476
|
+
*/
|
|
477
|
+
const CreateChannelBody = z.strictObject({ path: ChannelPath });
|
|
399
478
|
const LabelBody = z.object({
|
|
400
479
|
set: Labels.optional(),
|
|
401
480
|
unset: z.array(LabelKey).optional(),
|
|
@@ -509,7 +588,7 @@ const routes = {
|
|
|
509
588
|
method: "POST",
|
|
510
589
|
path: "/schedules/:id/cancel"
|
|
511
590
|
},
|
|
512
|
-
/**
|
|
591
|
+
/** Listing grants needs manage at `*`; changing one, manage at each pattern its `can` names. Team owners always may. */
|
|
513
592
|
grants: {
|
|
514
593
|
method: "GET",
|
|
515
594
|
path: "/grants"
|
|
@@ -519,6 +598,17 @@ const routes = {
|
|
|
519
598
|
path: "/grants",
|
|
520
599
|
body: GrantBody
|
|
521
600
|
},
|
|
601
|
+
updateGrant: {
|
|
602
|
+
method: "PATCH",
|
|
603
|
+
path: "/grants/:id",
|
|
604
|
+
body: UpdateGrantBody
|
|
605
|
+
},
|
|
606
|
+
/** Which grant decides a channel, for the caller or, with `manage` at `*`, a principal it names. */
|
|
607
|
+
explain: {
|
|
608
|
+
method: "GET",
|
|
609
|
+
path: "/grants/explain",
|
|
610
|
+
query: ExplainQuery
|
|
611
|
+
},
|
|
522
612
|
revokeGrant: {
|
|
523
613
|
method: "POST",
|
|
524
614
|
path: "/grants/:id/revoke"
|
|
@@ -674,7 +764,7 @@ const routes = {
|
|
|
674
764
|
};
|
|
675
765
|
//#endregion
|
|
676
766
|
//#region src/version.ts
|
|
677
|
-
const VERSION = "0.
|
|
767
|
+
const VERSION = "0.35.0";
|
|
678
768
|
//#endregion
|
|
679
769
|
//#region src/server/backend.ts
|
|
680
770
|
/** The subscription sync's outbound runs on, in `BoardBinding.subscriptions`. No watcher's ID starts with `@`. */
|
|
@@ -709,6 +799,8 @@ const METHODS = [
|
|
|
709
799
|
"cancelSchedule",
|
|
710
800
|
"grants",
|
|
711
801
|
"createGrant",
|
|
802
|
+
"updateGrant",
|
|
803
|
+
"explain",
|
|
712
804
|
"revokeGrant",
|
|
713
805
|
"tokens",
|
|
714
806
|
"createToken",
|
|
@@ -1059,4 +1151,4 @@ async function withEmailMentions(text, find) {
|
|
|
1059
1151
|
};
|
|
1060
1152
|
}
|
|
1061
1153
|
//#endregion
|
|
1062
|
-
export {
|
|
1154
|
+
export { MessagesQuery as A, SyncCopiesQuery as B, InboxAckBody as C, LabelBody as D, InboxQuery as E, ScheduleBody as F, TokenBody as G, SyncImportBody as H, SchedulesQuery as I, UploadStartBody as J, TypingBody as K, SourceJoinBody as L, ReactBody as M, Ref as N, LinkedQuery as O, RegisterBody as P, SourceReadQuery as R, GrantBody as S, InboxPushBody as T, SyncReceiptBody as U, SyncFindQuery as V, ThreadsQuery as W, routes as Y, CreateChannelBody as _, compileWatcher as a, EventsQuery as b, METHODS as c, queryObject as d, readCapped as f, AckBody as g, VERSION as h, canonicalWatchers as i, PostBody as j, MatchesQuery as k, createRouter as l, SYNC as m, syncTarget as n, hasCriteria as o, readJson as p, UpdateGrantBody as q, withEmailMentions as r, withMentions as s, mentionsEmails as t, openapi as u, DeleteBody as v, InboxNextQuery as w, ExplainQuery as x, EditBody as y, SyncBody as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as unauthorized } from "./errors-
|
|
2
|
-
import { a as VERCEL_ISSUER,
|
|
1
|
+
import { l as unauthorized } from "./errors-rYDxZEuN.mjs";
|
|
2
|
+
import { _ as privateHost, a as VERCEL_ISSUER, b as trustedIssuers, g as markVerified, i as TOKENS, m as issuerName } from "./auth-CrjXLgOb.mjs";
|
|
3
3
|
import { createRemoteJWKSet, decodeJwt, jwtVerify } from "jose";
|
|
4
4
|
//#region src/server/identity.ts
|
|
5
5
|
let fromDisk;
|
|
@@ -64,10 +64,15 @@ on any backend, and the backend stores. SSE, [the handle](#the-handle),
|
|
|
64
64
|
the deployment's OIDC token and writes as its project,
|
|
65
65
|
`vercel:project:prj_x:production`. Elsewhere it sends `VERCEL_TOKEN`, or
|
|
66
66
|
your Vercel CLI login, and writes as you. `fetch` sends other credentials.
|
|
67
|
+
- **A board token reaches its own board, by its ID.** `BOARD_TOKEN` goes to
|
|
68
|
+
Vercel's API as it is, and acts as whoever minted it. Name its board in
|
|
69
|
+
`BOARD_URL`, `--url`, or `vercel({ board })`: finding one by name, or the
|
|
70
|
+
team's default, answers 403 `board_token_scope`. Registering watchers with
|
|
71
|
+
one answers 403 `board_token_unsupported`,
|
|
72
|
+
`a board token can't register watchers yet.`
|
|
67
73
|
- **What Vercel's API doesn't keep yet answers 501 `not_supported`:** files on
|
|
68
74
|
a scheduled message, labels on a scheduled reply, and a post's `sync`
|
|
69
|
-
targets.
|
|
70
|
-
yet. A channel's message and thread counts are left out.
|
|
75
|
+
targets. A channel's message and thread counts are left out.
|
|
71
76
|
|
|
72
77
|
A request's caller is who `board()` verified it is: `authenticate` checks its
|
|
73
78
|
credential for the board's URL, which a token's audience must equal, works out
|
|
@@ -398,11 +403,13 @@ write.
|
|
|
398
403
|
replace it, so a verifier that wants it returns `request.claims.handle`
|
|
399
404
|
itself. The name, profile, and `x-board-scope` the caller sends still apply
|
|
400
405
|
on top of it.
|
|
401
|
-
- **`kind: 'person'` is a
|
|
402
|
-
as the board's own people do
|
|
406
|
+
- **`kind: 'person'` is a person on the team:** it gets what grants give
|
|
407
|
+
people, as the board's own people do (g1 gives everything), and a channel
|
|
408
|
+
closed to `everyone` keeps it out unless a grant names it. So your verifier
|
|
409
|
+
decides who counts as one.
|
|
403
410
|
- **Anyone else gets what grants give its ID.** A host's principal carries no
|
|
404
411
|
claims past its ID, and only a deployment's, `vercel:project:<id>:<env>`,
|
|
405
|
-
says what a grant matches: that project
|
|
412
|
+
says what a grant matches: the grants naming that project in that
|
|
406
413
|
environment. Any other is refused with 403. One whose `expiresAt` has passed
|
|
407
414
|
is refused, and a schedule it made is canceled `revoked`.
|
|
408
415
|
- **Name your principals in a scheme no sync registers.** A sync writes as
|
|
@@ -163,26 +163,27 @@ verified principal.
|
|
|
163
163
|
|
|
164
164
|
## Machines outside the project
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
g2 lets every project on the board's team read, post, react, and label.
|
|
167
|
+
Anything else outside the board's project needs a
|
|
168
|
+
[grant](./09-access.md#grants), which says what it may do in each channel.
|
|
169
|
+
Someone with `manage` where it reaches creates it on the board, and it holds
|
|
170
|
+
from the next request:
|
|
169
171
|
|
|
170
172
|
```text
|
|
171
|
-
$ vb grants create
|
|
172
|
-
|
|
173
|
-
$ vb grants create github
|
|
174
|
-
|
|
173
|
+
$ vb grants create --project prj_marketing --environment production --can feedback/=post
|
|
174
|
+
created g4 --project prj_marketing --environment production feedback/=post
|
|
175
|
+
$ vb grants create --github acme/www --can deploys=read,post
|
|
176
|
+
created g5 --github acme/www deploys=read,post
|
|
175
177
|
```
|
|
176
178
|
|
|
177
|
-
- **A
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
- **
|
|
179
|
+
- **A project grant names a project,** and the environments it calls from. A
|
|
180
|
+
GitHub grant names a repository as `owner/name`; where the board can look
|
|
181
|
+
it up, it keeps the repository's ID, which survives a rename.
|
|
182
|
+
- **Principals record IDs.** A workflow writes as
|
|
181
183
|
`github:repo:<repository_id>` whatever its grant names, so a rename doesn't
|
|
182
184
|
change who wrote what.
|
|
183
185
|
- **A `pull_request` run's token carries `ref: refs/pull/<n>/merge`,** so a
|
|
184
|
-
grant pinned to `--
|
|
185
|
-
`event_name` instead.
|
|
186
|
+
grant pinned to `--branch main` doesn't match it. Match on `--event` instead.
|
|
186
187
|
|
|
187
188
|
> [!WARNING]
|
|
188
189
|
> For `pull_request`, GitHub runs the workflow file from the PR's merge commit,
|
|
@@ -81,7 +81,7 @@ post there (or read the thread, for a reply) has the schedule canceled with
|
|
|
81
81
|
it`. A schedule from before board kept its creator's claims is worked out from
|
|
82
82
|
the principal ID alone, which names a deployment's project ID and environment
|
|
83
83
|
and nothing of a workflow's run. So the board's own deployments in its
|
|
84
|
-
environment, and a project a
|
|
84
|
+
environment, and a project a grant names, keep sending; a workflow's is
|
|
85
85
|
`revoked` at its next send.
|
|
86
86
|
|
|
87
87
|
## In code
|