Repository navigation
Expand file tree
/
Copy pathsys-api-key.object.ts
More file actions
549 lines (529 loc) · 27.1 KB
/
Copy pathsys-api-key.object.ts
File metadata and controls
549 lines (529 loc) · 27.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.
import { ObjectSchema, Field } from '@objectstack/spec/data';
/**
* sys_api_key — System API Key Object
*
* API keys for programmatic/machine access to the platform.
*
* Field `key` stores a hashed value and is marked hidden so it never
* leaks into default list/form rendering; the raw token is only
* returned once on creation via the auth plugin API.
*
* @namespace sys
*/
export const SysApiKey = ObjectSchema.create({
name: 'sys_api_key',
label: 'API Key',
pluralLabel: 'API Keys',
icon: 'key-round',
color: 'purple',
isSystem: true,
managedBy: 'better-auth',
// [ADR-0092 D4 / ADR-0103] Declares the generic EDIT affordance, which is
// what lets `enable.apiMethods` keep `update` below: `managedBy` objects run
// through `reconcileManagedApiMethods`, which strips any write verb the
// resolved affordances do not grant. Without this line the declaration and
// the runtime disagree again — silently, one layer deeper than #7727's
// method gate. `create` / `delete` stay bucket-default (off): minting is
// `POST /api/v1/keys` and rows are retired by revoking, not deleting.
//
// The affordance is safe to open only because the enforcement it fronts
// already exists (D4's sequencing rule — affordance never ships ahead of
// the guard): ADR-0092 D2's guard clamps every user-context update on this
// table to the registered column whitelist, which lists `revoked` alone.
// Per D4's form-rendering constraint, every column outside that whitelist
// is marked `readonly` below, so the edit form cannot offer a write the
// server will refuse.
userActions: { edit: true },
// ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
// but may add overlay row-level config. Use `no-overlay` if you need to
// forbid sys_metadata overlays entirely.
protection: {
lock: 'full',
reason: 'Identity table managed by better-auth — see ADR-0010.',
docsUrl: 'https://objectstack.ai/docs/permissions/locked-items',
},
// [#19054] The stamp-only organization declaration that used to sit here
// (`organizationField: 'active_organization_id'`, the stamp-only ruling) is
// GONE from the authorable surface in protocol 18 (ADR-0049 enforce-or-remove;
// maintainer ruling 2026-09-18, verbatim and untranslated:
// 「organizationField 撤出可授权面 同意你的建议」).
//
// ⛔ Nothing about this table's behaviour changed, and ⛔ nothing here needs
// to replace it. The fact it carried — "platform rows about a `sys_api_key`
// row are stamped from `active_organization_id`, not from any wall" — now
// lives in `@objectstack/metadata-core`'s
// `PLATFORM_STAMP_ORGANIZATION_COLUMNS`, keyed by this object's name, read by
// the three sanctioned platform-row writers (audit stamping, the approval-row
// writer, the automation-run recorder) and by nothing else. It was authorable
// by every application and declared, repo-wide, only here; a fact about one
// table we ship is not a knob customers configure.
//
// `enabled: false` states explicitly what this table's shape already
// implies, and is measured behavior-identical to having no `tenancy` block
// for THIS object on every read path: injection bails on
// `managedBy: 'better-auth'` before tenancy is consulted
// (`resolveInjectedSystemColumns`), the SQL driver's `computeTenantField`
// resolves null either way (no `organization_id`, no `tenantField`), the
// Layer 0 wall is exempt either way (no `organization_id` column), and the
// memory/mongo boot guards count only an explicit `enabled: true`. ⛔ Never
// "upgrade" this to `enabled: true` or move the column to
// `tenancy.tenantField`: both wall the credential table on an equality that
// excludes NULL, and every pre-#8287 key vanishes from its own owner's
// "My Keys" list — the defect #8287 exists to have removed (see the
// `active_organization_id` field comment below).
tenancy: { enabled: false },
description: 'API keys for programmatic access',
displayNameField: 'name',
nameField: 'name', // [ADR-0079] canonical primary-title pointer (mirrors deprecated displayNameField)
highlightFields: ['name', 'prefix', 'user_id', 'expires_at', 'revoked'],
// Custom actions — sys_api_key is managed-by 'better-auth' but the
// `revoked` boolean is a column we control via the data API. These row
// actions use the generic PATCH /api/v1/data/sys_api_key/{id} endpoint with
// `bodyExtra` to set the `revoked` flag explicitly. The `target` below is
// the authority on that path; this comment used to omit `/data/`.
actions: [
// "Create Key" mints through the one mint path, `POST /api/v1/keys`
// (`@objectstack/runtime` `domains/keys.ts`) — the same route the console's
// own key-minting surfaces call. Not the data API: `create` stays off in
// `apiMethods` below, and the route pins the row to the CALLER (`user_id`
// and the active organization are never read from the body), so an admin
// on Setup's "All" view mints their own key exactly as a user on the
// Account app's "My Keys" view does. The route answers the raw key ONCE
// (only its hash is stored), so the response is revealed in a
// `resultDialog` the user must close — a toast would lose it.
// `two-factor-one-shot-reveal.test.ts` holds every action on this route to
// that reveal.
{
name: 'create_api_key',
label: 'Create Key',
icon: 'plus-circle',
variant: 'primary',
mode: 'create',
locations: ['list'],
type: 'api',
method: 'POST',
target: '/api/v1/keys',
description: 'Create a key for a script or integration. The key acts as you, with your access, in the organization you are working in now.',
refreshAfter: true,
// The route reads `name` (and an optional `expires_at`) and nothing else;
// a key named nothing is stored as "API Key", so the name is required
// here to keep the list readable.
//
// `expires_at` is offered so the expiry is a choice the admin sees, not
// a date that silently appears in the list. It stays optional and has
// NO `defaultValue`: a param default is a literal submitted verbatim,
// while the default life is the deployment's Authentication API key
// policy, which the route applies when the field is left empty. The
// help text names that policy, the route refuses (never clamps) a date
// past the policy's maximum (`API_KEY_EXPIRY_TOO_LONG`), and the reveal
// below shows the expiry the key actually got. The column's `readonly`
// is a form flag; an action param does not inherit it.
params: [
{ field: 'name', required: true },
{
field: 'expires_at',
helpText: 'Leave empty for the default lifetime set under Setup → Login & Security → Sign-in Methods → API keys (Default key lifetime, 90 days unless changed). A date later than the Maximum key lifetime there is refused.',
},
],
resultDialog: {
title: 'API key created',
description: 'Copy the key now — it is shown only once and cannot be recovered. If it leaks, revoke it and create a new one.',
acknowledge: 'I have saved the key',
fields: [
{ path: 'key', label: 'API Key', format: 'secret' },
{ path: 'expires_at', label: 'Expires At', format: 'text' },
],
},
},
{
name: 'revoke_api_key',
label: 'Revoke API Key',
icon: 'shield-off',
variant: 'danger',
mode: 'custom',
locations: ['record_row'],
type: 'api',
method: 'PATCH',
target: '/api/v1/data/sys_api_key/{id}',
bodyExtra: { revoked: true },
// Offered on a live key only, Restore on a revoked one, in the form of
// `sys_oauth_application`'s Disable / Enable pair: a null `revoked`
// reads as live. Display only, no door reads `visible`; who may restore
// a key revoked with a `revoked_reason` is the server's
// (`api-key-restore-guard.ts` in plugin-auth). Pinned in
// `action-state-visibility.test.ts`.
visible: 'has(record.revoked) && record.revoked != true',
confirmText: 'Revoke this API key? Any clients using it will immediately lose access.',
successMessage: 'API key "{{ record.name }}" revoked',
refreshAfter: true,
// ADR-0011 identity-actions note, bucket C: exposed, and the
// confirmation is never relaxed.
ai: {
exposed: true,
description:
'Revoke an API key (the record): every client using it loses access immediately. It can be restored later. Ask the human to confirm before calling.',
requiresConfirmation: true,
},
},
{
name: 'restore_api_key',
label: 'Restore API Key',
icon: 'shield-check',
variant: 'secondary',
mode: 'custom',
locations: ['record_row'],
type: 'api',
method: 'PATCH',
target: '/api/v1/data/sys_api_key/{id}',
bodyExtra: { revoked: false },
visible: 'has(record.revoked) && record.revoked == true',
confirmText: 'Restore this revoked API key? Existing clients holding the key will regain access.',
successMessage: 'API key "{{ record.name }}" restored',
refreshAfter: true,
},
],
listViews: {
// [#21972] Declared FIRST on purpose: a route that names no view opens the
// first declared list view, so a caller-scoped view (`mine`) is never
// first. Setup's `nav_api_keys` names this view; the Account app's entry
// names `mine`.
all_keys: {
type: 'grid',
name: 'all_keys',
label: 'All',
data: { provider: 'object', object: 'sys_api_key' },
columns: ['name', 'prefix', 'user_id', 'active_organization_id', 'expires_at', 'last_used_at', 'revoked'],
sort: [{ field: 'created_at', order: 'desc' }],
pagination: { pageSize: 50 },
// This object is `managedBy: 'better-auth'`, so with no declaration the
// console draws the shared identity-object fallback ("created by the
// authentication provider … not added by hand here") — wrong for keys,
// which are created by hand on this very page.
emptyState: {
title: 'No API keys yet',
message: 'Create a key for scripts and integrations with Create Key; the key is shown once, when it is created.',
},
},
mine: {
type: 'grid',
name: 'mine',
label: 'My Keys',
data: { provider: 'object', object: 'sys_api_key' },
// [#8287] `active_organization_id` is shown here deliberately: the card's
// complaint was a valid-looking credential whose reach the owner could
// not see. The column IS the reach, so the "My Keys" list states it.
columns: ['name', 'prefix', 'active_organization_id', 'expires_at', 'last_used_at', 'revoked'],
filter: [
{ field: 'user_id', operator: 'equals', value: '{current_user_id}' },
],
sort: [{ field: 'created_at', order: 'desc' }],
pagination: { pageSize: 50 },
emptyState: {
title: 'You have no API keys yet',
message: 'Create a key for your scripts and integrations with Create Key; the key is shown once, when it is created.',
},
},
active: {
type: 'grid',
name: 'active',
label: 'Active',
data: { provider: 'object', object: 'sys_api_key' },
columns: ['name', 'prefix', 'user_id', 'expires_at', 'last_used_at'],
filter: [{ field: 'revoked', operator: 'equals', value: false }],
sort: [{ field: 'last_used_at', order: 'desc' }],
pagination: { pageSize: 50 },
emptyState: {
title: 'No active API keys',
message: 'Every key that has not been revoked is listed here.',
},
},
revoked: {
type: 'grid',
name: 'revoked',
label: 'Revoked',
data: { provider: 'object', object: 'sys_api_key' },
columns: ['name', 'prefix', 'user_id', 'expires_at', 'updated_at'],
filter: [{ field: 'revoked', operator: 'equals', value: true }],
sort: [{ field: 'updated_at', order: 'desc' }],
pagination: { pageSize: 50 },
emptyState: {
title: 'No revoked keys',
message: 'A key moves here when it is revoked; clients using it lose access until it is restored.',
},
},
},
// [ADR-0095 D1, 2026-10-18 note] This object's default row scope: the one policy
// plugin-security's shipped permission sets spread for it today (the `_self`
// carve-outs in `default-permission-sets.ts`), moved here verbatim. Layer 0 is inert
// on this table (no organization column), so Layer 1 silence means this scope, not no
// filter. The security plugin's row-policy collection applies it when no set the
// caller holds carries a row policy for the object and operation; the shipped sets
// still carry it, so their holders read as before. An `extend` contribution cannot set
// or loosen it (refused at registration).
defaultRowScope: {
name: 'sys_api_key_self',
operation: 'all',
using: 'user_id == current_user.id',
},
fields: {
// ── Identity ─────────────────────────────────────────────────
// The five fields below are `readonly` for one reason (ADR-0092 D4's
// form-rendering constraint): they are set on the mint path and are NOT on
// the identity write guard's column whitelist, so a user-context write to
// any of them is refused 403. With `userActions.edit` open, leaving them
// writable in the form would advertise an edit the server rejects — the
// declared-≠-enforced shape this object already paid for once (#7727).
name: Field.text({
label: 'Name',
required: true,
readonly: true,
searchable: true,
maxLength: 255,
description: 'Human-readable label for the API key',
group: 'Identity',
}),
prefix: Field.text({
label: 'Prefix',
required: false,
readonly: true,
maxLength: 16,
description: 'Visible prefix for identifying the key (e.g., "osk_")',
group: 'Identity',
}),
user_id: Field.lookup('sys_user', {
label: 'Owner',
required: true,
readonly: true,
description: 'User who owns this API key',
group: 'Identity',
}),
// ── Access ───────────────────────────────────────────────────
//
// [#8287] The organization this key authenticates INTO. Set once, on the
// mint path, from the minter's active organization (inherited — there is
// deliberately no org parameter and no cross-org key); the verifier reads
// it back and `resolveAuthzContext` establishes it as the request's active
// organization, which is what lets the ADR-0105 Layer 0 wall match. Before
// this column a minted key carried no organization at all, so under the
// `isolated` posture (`organization_id = activeOrganizationId`) no row
// could ever match and the whole key surface read nothing while the console
// went on offering minting.
//
// ⚠️ The NAME is load-bearing, and it is `active_organization_id` — the
// `sys_session.active_organization_id` spelling — NOT `organization_id`.
// Two reasons, one semantic and one measured:
//
// - Semantic: this value is not "the organization that owns this row", it
// is "the organization this credential makes ACTIVE". A session carries
// exactly the same fact under exactly this name, and both are read into
// `ExecutionContext.tenantId` by the one shared resolver. One concept,
// one name (ADR-0089).
// - Measured: `objectHasOrgIdField` (plugin-security `security-plugin.ts`)
// tests for the literal `organization_id`, and `computeTenantLayer0Filter`
// (`tenant-layer.ts`) exempts objects without it. Naming this column
// `organization_id` would therefore make `sys_api_key` ITSELF org-walled,
// and both walled postures exclude NULL: every pre-existing org-less row
// would vanish from the console's "My Keys" list FOR ITS OWN OWNER, and
// under `group` those rows still authenticate — a live credential its
// owner can no longer see or revoke. New keys would fare little better:
// a key minted in org A disappears from its owner's list whenever they
// switch to org B. `sys_api_key` is an owner-scoped credential table
// like `sys_user` / `sys_session` / `sys_account`; it is scoped by the
// Layer 1 `sys_api_key_self` policy (`user_id == current_user.id`), and
// keeping it that way is what stops this fix from creating a fresh
// instance of the very silent-empty class it exists to remove.
active_organization_id: Field.lookup('sys_organization', {
label: 'Active Organization',
required: false,
readonly: true,
description:
'Organization this key authenticates into — inherited from the minter at creation and established as the request’s active organization',
group: 'Access',
}),
scopes: Field.textarea({
label: 'Scopes',
required: false,
readonly: true,
description: 'JSON array of permission scopes',
group: 'Access',
}),
// ── Lifecycle ────────────────────────────────────────────────
expires_at: Field.datetime({
label: 'Expires At',
required: false,
readonly: true,
group: 'Lifecycle',
}),
// [#23367, ruling A] The description used to read "Automatically updated
// on each API call" while nothing wrote the column at all. Its one writer
// is now the shared key-admission seam (`resolveApiKeyAdmission`,
// `@objectstack/core`), throttled to one write per key per hour; the
// inactivity expiry reads it.
last_used_at: Field.datetime({
label: 'Last Used At',
required: false,
readonly: true,
description:
'Recorded when the key is used, at most once an hour. A key with no recorded use for the inactivity window (90 days by default) is refused until replaced',
group: 'Lifecycle',
}),
revoked: Field.boolean({
label: 'Revoked',
defaultValue: false,
group: 'Lifecycle',
}),
// Why the key was revoked, recorded only where the reason changes WHO may
// restore it. Four values. The first two are the same word the platform
// writes on `sys_session.revoke_reason` for the same event; a session has
// no counterpart of the last two, because a session is never restored (and
// a directory deactivation deletes the user's sessions outright):
//
// - `admin_password_reset`: an administrator's forced password reset
// revokes the user's keys by default because the reset may answer a
// compromise, so the owner must not be the one to reopen such a key:
// only a platform administrator restores it, and the owner creates a new
// key instead. Its one writer is plugin-auth `forced-reset-revocation.ts`,
// beside `revoked: true`.
// - `organization_membership_ended`: the key was revoked because its
// owner's membership in the organization ended. Nobody restores such a
// key from a user context, a platform administrator included: re-arming
// it would hand a non-member's credential back its access. A member mints
// a new key instead. The platform does not stamp it itself: a host that
// revokes a departed member's keys (a control plane removing someone from
// the organization) writes it in the system context, beside
// `revoked: true`.
// - `administrator_suspended`: a platform administrator revoked a key that
// is not theirs (an administrator stopping an AI's or a person's key),
// so the stop holds against the owner: only a platform administrator
// restores it. The restore guard stamps it on that revoke; a host that
// stops a key itself writes it in the system context, beside
// `revoked: true`.
// - `scim_deactivated`: the organization's directory deactivated or
// deleted the key's owner through SCIM, and the deactivation revoked
// every key the owner had. Nobody restores such a key from a user
// context, a platform administrator included: a re-activation lifts the
// directory's ban and re-arms no key, and the re-activated owner creates
// a new one. Its one writer is plugin-auth
// `scim-deactivation-key-revocation.ts`, in the system context, beside
// `revoked: true`.
//
// One hook keeps it in step with `revoked` (plugin-auth
// `api-key-restore-guard.ts`): it refuses the user-context restores each
// reason rules out, clears the reason on every restore it admits, stamps
// `administrator_suspended` on a platform administrator's revoke of a key
// they do not own, and otherwise leaves it alone when a revoked key is
// revoked again.
// `readonly` for ADR-0092 D4's form-rendering reason: it is not on the D2
// whitelist, so no data-API write may set or clear it.
revoked_reason: Field.select({
label: 'Revoke Reason',
required: false,
readonly: true,
options: [
{ label: 'Administrator password reset', value: 'admin_password_reset' },
{ label: 'Organization membership ended', value: 'organization_membership_ended' },
{ label: 'Suspended by an administrator', value: 'administrator_suspended' },
{ label: 'Deactivated by the directory', value: 'scim_deactivated' },
],
description:
'Why the key was revoked, where that decides who can restore it. Administrator password reset: only a platform administrator can restore the key. Organization membership ended: the owner left the organization, and no one can restore the key; a member creates a new one. Suspended by an administrator: a platform administrator revoked a key that is not theirs, and only a platform administrator can restore it. Deactivated by the directory: the organization\'s directory (SCIM) deactivated or deleted the owner, and no one can restore the key, even after the owner is re-activated; the owner creates a new one. Cleared when the key is restored. Empty for a key its owner revoked from the API Keys list.',
group: 'Lifecycle',
}),
// ── Secret (hidden by default) ──────────────────────────────
//
// [#7728] `internal: true` is what makes the description below TRUE. It was
// false on every build before this flag existed: `hidden` is a UI contract
// ("Hidden from default UI"), never a serialization one, and the engine's
// credential read mask collects by field TYPE — so this `text` column was
// collected by nothing and the stored SHA-256 hash came back on get-by-id,
// on list, on an explicit `?select=id,key` and in the PATCH body.
//
// Still `text`, deliberately. `Field.secret` would encrypt at rest and
// replace the column with a `sys_secret` ref, destroying the
// `where: { key: hashApiKey(raw) }` lookup `resolveApiKeyPrincipal` uses —
// i.e. it would break authentication to fix a disclosure. `internal` is
// read-side only: storage, the index and the verifier's filter are
// untouched, and `POST /api/v1/keys` still returns the raw secret once.
key: Field.text({
label: 'Hashed Key',
required: true,
// [commit 3954fb7df] Exact producer bound: the only writer is
// `packages/core/src/security/api-key.ts` (`hashApiKey` — "sha256(raw)
// hex — store this in sys_api_key.key"), a fixed 64-hex-char digest.
// better-auth's apiKey plugin is not loaded, so no other producer exists.
maxLength: 64,
hidden: true,
readonly: true,
internal: true,
description: 'Hashed API key value — never exposed to clients',
group: 'Secret',
}),
// ── System ───────────────────────────────────────────────────
id: Field.text({
label: 'API Key ID',
required: true,
readonly: true,
group: 'System',
}),
created_at: Field.datetime({
label: 'Created At',
defaultValue: 'NOW()',
readonly: true,
group: 'System',
}),
updated_at: Field.datetime({
label: 'Updated At',
defaultValue: 'NOW()',
readonly: true,
group: 'System',
}),
},
indexes: [
{ fields: ['key'], unique: 'global' },
{ fields: ['user_id'] },
{ fields: ['prefix'] },
{ fields: ['revoked'] },
// [#8287] Not for the verify path — that matches the unique `key` hash and
// reads the organization off the row it already has. This serves the
// administrative direction ("which keys authenticate into this org?"),
// which is the query a tenant admin runs when a membership ends.
{ fields: ['active_organization_id'] },
],
enable: {
trackHistory: true,
searchable: false,
apiEnabled: true,
// #1591 / #7727 — reads, plus `update` for the revoke/restore lifecycle.
//
// `create` and `delete` stay off: minting is `POST /api/v1/keys` (the only
// path that can return the raw secret once) and rows are retired by
// revoking, not deleting, so history survives.
//
// `update` is here because the two row actions above declare a PATCH
// against the data API, and a method gate that answers 405 first makes
// those actions dead on arrival — a declared affordance the runtime never
// honours (#7727). Opening the METHOD does not open the COLUMNS: this
// object is `managedBy: 'better-auth'`, so ADR-0092 D2's identity write
// guard still fail-closed rejects user-context writes, and the only
// opening is its per-object update whitelist. `revoked` is registered
// there (plugin-auth `managed-extension-fields.ts`); every other column —
// `key`, `user_id`, `expires_at`, `name`, … — is stripped, and a PATCH
// that touches nothing else is refused 403 `PERMISSION_DENIED` rather
// than degrading into a silent no-op.
//
// The batch primitive stays off DELIBERATELY (#7802), which is why this is
// the monorepo's only single-record-write whitelist without it. Revoking is
// a one-row, one-column gesture: the console renders no checkbox column for
// this object (no bulk action can arise — the grid's only implicit one is
// bulk-delete, and this object grants no delete affordance), and promoting
// a row action into a view's `bulkActions` fans out per row through the
// action runner rather than calling `/batch`. So the primitive would open
// `POST /data/sys_api_key/batch` and the `*Many` routes to API clients for
// no caller. The decision is on the record — with its evidence and the
// conditions that would reverse it — in `SINGLE_RECORD_WRITE_ONLY` in
// `@objectstack/spec`'s `data/api-methods-batch-conformance.test.ts`, whose
// stale-entry check fails if `bulk` is added here without retiring it.
apiMethods: ['get', 'list', 'update'],
},
});