@vercel/board 0.34.0 → 0.36.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.
Files changed (67) hide show
  1. package/dist/{access-CdBcYPQH.mjs → access-BsP0hvcC.mjs} +1 -1
  2. package/dist/access.d.mts +2 -2
  3. package/dist/access.mjs +4 -4
  4. package/dist/{actors-MrIEr9LI.mjs → actors-DFOpTw89.mjs} +2 -2
  5. package/dist/{auth-aaoKt5DK.d.mts → auth-C21V0EK1.d.mts} +1 -1
  6. package/dist/{auth-DjoJygbG.mjs → auth-CrjXLgOb.mjs} +2 -2
  7. package/dist/{backend-u1sVvybh.d.mts → backend-D21q8mdm.d.mts} +3 -3
  8. package/dist/backend-local.d.mts +1 -1
  9. package/dist/backend-local.mjs +1 -1
  10. package/dist/{chat-provider-9hCT654s.mjs → chat-provider-Bb-jeJLY.mjs} +2 -2
  11. package/dist/{chat-provider-De0iDnUB.d.mts → chat-provider-DmZCmBkb.d.mts} +2 -2
  12. package/dist/cli-commands.d.mts +1 -1
  13. package/dist/cli-commands.mjs +1 -1
  14. package/dist/cli-embedded.d.mts +2 -2
  15. package/dist/cli-embedded.mjs +1 -1
  16. package/dist/cli.mjs +5 -5
  17. package/dist/{commands-B8oZEByR.mjs → commands-BLtqSwha.mjs} +324 -26
  18. package/dist/{commands-BkVMdXP1.d.mts → commands-DGID-4Z2.d.mts} +175 -0
  19. package/dist/{conformance-gqYBkXFS.mjs → conformance-CKrwglzA.mjs} +480 -87
  20. package/dist/conformance.d.mts +20 -2
  21. package/dist/conformance.mjs +1 -1
  22. package/dist/{engine-rtOVWsiF.mjs → engine-B_prP0b8.mjs} +4 -4
  23. package/dist/{errors-D8ifv16L.mjs → errors-rYDxZEuN.mjs} +98 -4
  24. package/dist/{events-IQg0k281.mjs → events-AEKh9tJm.mjs} +1 -1
  25. package/dist/exports-BxljH73E.d.mts +4 -0
  26. package/dist/{exports-Bx2dGpzr.mjs → exports-Ck4Xu3OV.mjs} +135 -24
  27. package/dist/{external-CYe424fO.mjs → external-BA2aCC_3.mjs} +1 -1
  28. package/dist/{index-D6mK0Ial.d.mts → index-LREsSZb2.d.mts} +2 -2
  29. package/dist/index.d.mts +6 -6
  30. package/dist/index.mjs +4 -4
  31. package/dist/index.node.d.mts +6 -6
  32. package/dist/index.node.mjs +3 -3
  33. package/dist/inspect/app.js +32 -32
  34. package/dist/{local-CPz22MQ8.mjs → local-DJ_qI9q7.mjs} +10 -10
  35. package/dist/{main-DScDKwQN.mjs → main-Jz4nbNJi.mjs} +409 -24
  36. package/dist/{memory-7RRnLa4X.mjs → memory-DqwXlyK4.mjs} +2 -2
  37. package/dist/{middleware-BjYpk4yq.mjs → middleware-BxgizazV.mjs} +1 -1
  38. package/dist/{provider-hB8QNrwm.d.mts → provider-DEOfc4Ls.d.mts} +21 -3
  39. package/dist/{routes-De4W6lEs.d.mts → routes-BpKdMvgX.d.mts} +19 -8
  40. package/dist/{serve-B1noQRkn.mjs → serve-Puf3I-oI.mjs} +4 -4
  41. package/dist/{server-Ov6GBJ8j.mjs → server-CS-1aeTl.mjs} +6 -6
  42. package/dist/{serving-2s7lqSBS.mjs → serving-6_bhBNAW.mjs} +1 -1
  43. package/dist/{sql-BQzKUqQt.mjs → sql-aetuEBZC.mjs} +1 -1
  44. package/dist/{sqlite-DCtZFEVm.mjs → sqlite-DvsB8ENQ.mjs} +2 -2
  45. package/dist/{sqlite-db-qLTs52Ny.mjs → sqlite-db-BPwRoDI7.mjs} +1 -1
  46. package/dist/sync-chat-sdk.d.mts +2 -2
  47. package/dist/sync-chat-sdk.mjs +2 -2
  48. package/dist/sync-github.d.mts +2 -2
  49. package/dist/sync-github.mjs +2 -2
  50. package/dist/sync-linear.d.mts +3 -3
  51. package/dist/sync-linear.mjs +2 -2
  52. package/dist/sync-slack.d.mts +3 -3
  53. package/dist/sync-slack.mjs +3 -3
  54. package/dist/sync.d.mts +2 -2
  55. package/dist/sync.mjs +2 -2
  56. package/dist/{targets-aMdbp84G.mjs → targets-Dk_xgS9q.mjs} +10 -6
  57. package/dist/{tokens-LHLrnV_P.mjs → tokens-Dn4cPZIr.mjs} +2 -2
  58. package/docs/01-board/01-mounting.md +7 -2
  59. package/docs/01-board/03-identity.md +1 -1
  60. package/docs/01-board/09-access.md +31 -0
  61. package/docs/03-guides/03-ci.md +5 -3
  62. package/docs/04-reference/01-cli.md +98 -14
  63. package/docs/04-reference/02-board.md +28 -3
  64. package/docs/04-reference/03-http.md +1 -1
  65. package/docs/04-reference/05-conformance.md +31 -5
  66. package/package.json +1 -1
  67. package/dist/exports-uwRl5qIj.d.mts +0 -4
@@ -51,6 +51,30 @@ that secret as the credential, as `BOARD_TOKEN` sends it. `vb conformance`
51
51
  passes it. From code, pass your own, which a backend of your own can make with
52
52
  `board({ backend })`, or that check is skipped.
53
53
 
54
+ Every grant it makes is in `conformance/grants/`, the same subtree and the same
55
+ channels each run, so a run leaves no channel behind and no grant reaches
56
+ outside it. It revokes them all when a check ends, and a revoke that fails
57
+ fails the check. Two runs on one board at once see each other's grants there,
58
+ so run one at a time, on a scratch board.
59
+
60
+ The grants checks name a project, a GitHub repository, a person who's a
61
+ viewer, and an app installed on the team. A board that verifies tokens
62
+ itself, as `vb serve` does, takes the made-up IDs they use by default, and
63
+ skips the app's check, since it has no apps. One that looks names up, as a
64
+ board on Vercel's API does, needs real ones on its team, or skips the checks
65
+ that name them: pass `principals`, with a repository no grant names. None may
66
+ be the run's own project, repository, or app, since the checks would change
67
+ what the run itself may do: it throws before it writes anything, or, for a
68
+ project named by name, which only the board can resolve, after one grant that
69
+ changes nothing for the run, which it revokes.
70
+
71
+ ```ts scripts/conformance.ts
72
+ import { board } from '@vercel/board'
73
+ import { conformance } from '@vercel/board/conformance'
74
+
75
+ const report = await conformance(board(), { principals: { project: 'web', repository: 'acme/web', viewer: 'val@acme.com', app: 'ship' } })
76
+ ```
77
+
54
78
  ## What it checks
55
79
 
56
80
  The whole protocol, on every board:
@@ -89,10 +113,10 @@ Then the rest, a group each in the report:
89
113
  | Group | Check |
90
114
  | --- | --- |
91
115
  | `schedules` | schedules a reply a day out, lists it, and cancels it; and keeps a schedule's `noSync`, so its sends stay off every platform |
92
- | `grants` | grants a project that doesn't exist, by ID, lists it, and revokes it twice. Makes a second grant for the same principals, adds a repository and replaces `can` by the grant's ID, removes the project whatever its environments, and refuses to remove one it doesn't name (`not_in_grant`) or the last (`grant_empty`). Keeps `can` as written, a pattern with `[]` included. Skipped when the token can't change the board's grants |
116
+ | `grants` | grants a project, lists it, and revokes it twice. Makes a second grant for the same principals, adds a repository and the project again (joining its environments) by the grant's ID, removes the project whatever its environments, and refuses to remove one it doesn't name (`not_in_grant`) or the last (`grant_empty`). Keeps `can` as written, a pattern with `[]` included. Through `explain`, in `conformance/grants/`: the most specific pattern decides, then the closest principal there, ties add up, `everyone` lets no one in and loses to `all-projects`, and a viewer reads but neither posts nor manages. Names an app and keeps it by client ID, then every app as a group. A token without `manage` changes no grant, and one with it only under `conformance/grants/inner/` only there. A token kept out of a pattern grants no one past it, even once `everyone` is kept out too, and lets no one in while `everyone` gets more than it has somewhere. Skipped when the token can't change the board's grants, when the board mints no tokens (501, 404, or 403), for a caller no grant could keep in a pattern closed to everyone, without a viewer or an app to check (a local board has no apps), for a name the board can't look up, for a member shut out under a lock (a run couldn't lift the lock after), and across teams, which isn't specified yet |
93
117
  | `tokens` | mints a token for an hour that reads the channel, checks its `can` and its expiry, lists it without its secret, and revokes it twice. Then, with another one's secret: `/me` names its minter and only what it may read, it reads the channel and can't post there, and once it's revoked, it's refused with a 401 |
94
118
  | `attachments` | uploads a file, posts it, and downloads it |
95
- | `watchers` | registers a tail, pulls the match for a post, and acks it. Skipped when the token already has watchers or a sync registered there, since registering replaces them |
119
+ | `watchers` | registers a tail, pulls the match for a post, and acks it. Skipped when the token already has watchers or a sync registered there, since registering replaces them, and on a board token Vercel's API won't register watchers for yet (403 `board_token_unsupported`) |
96
120
  | `sync` | imports a message as a platform user of its own (`conformance:user:<id>`), finds it by its platform IDs, imports it again to the same message, refuses a second root from the same platform thread, records a receipt and reads the copy back, lists where the thread is synced with it, answers 404 for a link no sync there knows, and deletes it. Pushes two events on one platform thread to the sync's inbox, and the first again, then leases them one at a time and in order, each once the one before is acked. Pulls the sync's `@sync` match for a post. Each of these is skipped when the token can't register a sync or `sync` in the channel, or already has watchers or a sync registered. Then, registering nothing: reads a post's and a reply's `noSync` back |
97
121
 
98
122
  Every board answers all of them: see
@@ -100,12 +124,14 @@ Every board answers all of them: see
100
124
  schedules, grants, or files, or issue no tokens, and say so: one that answers
101
125
  one of those groups' checks with a 501 has it skipped, `not kept here`, with
102
126
  what the board said. A board that's meant to keep them and doesn't yet answers
103
- otherwise, and fails: Vercel's boards fail both groups until Vercel's API keeps
104
- grants and tokens. A
127
+ otherwise, and fails: Vercel's boards fail the tokens group until Vercel's API
128
+ keeps tokens. A
105
129
  [backend of your own](../01-board/01-mounting.md#a-backend-of-your-own) that
106
130
  keeps no grants, schedules, or files answers 501 `no_grants`, `no_scheduler`,
107
131
  or `no_files`.
108
- `vb serve` keeps everything, so it passes every check.
132
+ `vb serve` keeps everything, so it passes every check but four: it has no
133
+ team roles to cap anyone with and no apps, no run can check a member shut out
134
+ under a lock, and grants across teams aren't specified yet.
109
135
 
110
136
  ## The report
111
137
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/board",
3
- "version": "0.34.0",
3
+ "version": "0.36.0",
4
4
  "description": "A message board you mount in one route: one durable log, verified authors, live tail, and two-way sync.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,4 +0,0 @@
1
- import "./routes-De4W6lEs.mjs";
2
- import "./auth-aaoKt5DK.mjs";
3
- import "./backend-u1sVvybh.mjs";
4
- import "./provider-hB8QNrwm.mjs";