@forgezero/access 0.1.4 → 0.1.5

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/README.md CHANGED
@@ -62,18 +62,62 @@ bun add @forgezero/access
62
62
  <a id="forgezero-access"></a>
63
63
  ## @forgezero/access
64
64
 
65
- Declare routes, factors and policies as orthogonal lists; authorise against them. Named value imports: AccessError, Refusal, SCHEMA_VERSION, Settled, VERSION, action, assertReadable, authorise, codePolicy, defineAccessControl, defineFactors, defineRoutes, externalPolicy, fulfilledActionFactors, grantsRoute, impactOfDisabling, isRefusal, isSettled, page, resolveActionFactors, stemOf. Named type imports: AccessControl, AccessControlConfig, ActionPolicy, ActionRoute, AfterHandler, BeforeHandler, Binding, FactorContext, FactorKind, FactorRegistry, FactorSpec, GrantOptions, Method, Outcome, PageRoute, PolicySource, Problem, RatePolicy, RequestContext, Role, RouteBase, RouteContract, RouteRegistry, RouteSpec, SessionContext, SessionPolicy, Versioned. Import only the names used by this file.
65
+ Declare routes, factors and policies as orthogonal lists; authorise against them. This entry exposes 21 named value exports and 27 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
66
66
 
67
67
  ```text
68
- import { AccessError, Refusal, SCHEMA_VERSION, Settled, VERSION, action } from '@forgezero/access';
69
- import { assertReadable, authorise, codePolicy, defineAccessControl, defineFactors, defineRoutes } from '@forgezero/access';
70
- import { externalPolicy, fulfilledActionFactors, grantsRoute, impactOfDisabling, isRefusal, isSettled } from '@forgezero/access';
71
- import { page, resolveActionFactors, stemOf } from '@forgezero/access';
72
- import type { AccessControl, AccessControlConfig, ActionPolicy, ActionRoute, AfterHandler, BeforeHandler } from '@forgezero/access';
73
- import type { Binding, FactorContext, FactorKind, FactorRegistry, FactorSpec, GrantOptions } from '@forgezero/access';
74
- import type { Method, Outcome, PageRoute, PolicySource, Problem, RatePolicy } from '@forgezero/access';
75
- import type { RequestContext, Role, RouteBase, RouteContract, RouteRegistry, RouteSpec } from '@forgezero/access';
76
- import type { SessionContext, SessionPolicy, Versioned } from '@forgezero/access';
68
+ import {
69
+ AccessError,
70
+ Refusal,
71
+ SCHEMA_VERSION,
72
+ Settled,
73
+ VERSION,
74
+ action,
75
+ assertReadable,
76
+ authorise,
77
+ codePolicy,
78
+ defineAccessControl,
79
+ defineFactors,
80
+ defineRoutes,
81
+ externalPolicy,
82
+ fulfilledActionFactors,
83
+ grantsRoute,
84
+ impactOfDisabling,
85
+ isRefusal,
86
+ isSettled,
87
+ page,
88
+ resolveActionFactors,
89
+ stemOf,
90
+ } from '@forgezero/access';
91
+
92
+ import type {
93
+ AccessControl,
94
+ AccessControlConfig,
95
+ ActionPolicy,
96
+ ActionRoute,
97
+ AfterHandler,
98
+ BeforeHandler,
99
+ Binding,
100
+ FactorContext,
101
+ FactorKind,
102
+ FactorRegistry,
103
+ FactorSpec,
104
+ GrantOptions,
105
+ Method,
106
+ Outcome,
107
+ PageRoute,
108
+ PolicySource,
109
+ Problem,
110
+ RatePolicy,
111
+ RequestContext,
112
+ Role,
113
+ RouteBase,
114
+ RouteContract,
115
+ RouteRegistry,
116
+ RouteSpec,
117
+ SessionContext,
118
+ SessionPolicy,
119
+ Versioned,
120
+ } from '@forgezero/access';
77
121
  ```
78
122
 
79
123
  ## @forgezero/access — Declare routes before handlers
@@ -81,7 +125,11 @@ import type { SessionContext, SessionPolicy, Versioned } from '@forgezero/access
81
125
  Routes and their access policy are data; Fetch and Elysia adapters enforce the same declaration.
82
126
 
83
127
  ```text
84
- import { defineRoutes, action, page } from '@forgezero/access';
128
+ import {
129
+ defineRoutes,
130
+ action,
131
+ page,
132
+ } from '@forgezero/access';
85
133
 
86
134
  export const routes = defineRoutes({
87
135
  orders: page('Orders'),
@@ -92,153 +140,333 @@ export const routes = defineRoutes({
92
140
  <a id="forgezero-access-conditions"></a>
93
141
  ## @forgezero/access/conditions
94
142
 
95
- The twelve guards every project writes into `before`, each with the status its refusal deserves. Named value imports: assertDeclaredRefusals, loadTarget, refusalsFor, requireApproval, requireBalance, requireIdempotency, requireNotFrozen, requireOwner, requireQuota, requireService, requireState, requireTier, requireUnlocked, requireVersion. Named type imports: ApprovalState, Condition, IdempotencyStore, LoadTargetOptions, RefusalSpec, RequireApprovalOptions, RequireBalanceOptions, RequireIdempotencyOptions, RequireNotFrozenOptions, RequireOwnerOptions, RequireQuotaOptions, RequireServiceOptions, RequireStateOptions, RequireTierOptions, RequireUnlockedOptions, RequireVersionOptions. Import only the names used by this file.
143
+ The twelve guards every project writes into `before`, each with the status its refusal deserves. This entry exposes 14 named value exports and 16 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
96
144
 
97
145
  ```text
98
- import { assertDeclaredRefusals, loadTarget, refusalsFor, requireApproval, requireBalance, requireIdempotency } from '@forgezero/access/conditions';
99
- import { requireNotFrozen, requireOwner, requireQuota, requireService, requireState, requireTier } from '@forgezero/access/conditions';
100
- import { requireUnlocked, requireVersion } from '@forgezero/access/conditions';
101
- import type { ApprovalState, Condition, IdempotencyStore, LoadTargetOptions, RefusalSpec, RequireApprovalOptions } from '@forgezero/access/conditions';
102
- import type { RequireBalanceOptions, RequireIdempotencyOptions, RequireNotFrozenOptions, RequireOwnerOptions, RequireQuotaOptions, RequireServiceOptions } from '@forgezero/access/conditions';
103
- import type { RequireStateOptions, RequireTierOptions, RequireUnlockedOptions, RequireVersionOptions } from '@forgezero/access/conditions';
146
+ import {
147
+ assertDeclaredRefusals,
148
+ loadTarget,
149
+ refusalsFor,
150
+ requireApproval,
151
+ requireBalance,
152
+ requireIdempotency,
153
+ requireNotFrozen,
154
+ requireOwner,
155
+ requireQuota,
156
+ requireService,
157
+ requireState,
158
+ requireTier,
159
+ requireUnlocked,
160
+ requireVersion,
161
+ } from '@forgezero/access/conditions';
162
+
163
+ import type {
164
+ ApprovalState,
165
+ Condition,
166
+ IdempotencyStore,
167
+ LoadTargetOptions,
168
+ RefusalSpec,
169
+ RequireApprovalOptions,
170
+ RequireBalanceOptions,
171
+ RequireIdempotencyOptions,
172
+ RequireNotFrozenOptions,
173
+ RequireOwnerOptions,
174
+ RequireQuotaOptions,
175
+ RequireServiceOptions,
176
+ RequireStateOptions,
177
+ RequireTierOptions,
178
+ RequireUnlockedOptions,
179
+ RequireVersionOptions,
180
+ } from '@forgezero/access/conditions';
104
181
  ```
105
182
 
106
183
  <a id="forgezero-access-effects"></a>
107
184
  ## @forgezero/access/effects
108
185
 
109
- Audit, emit, meter, invalidate and notify — what happens after a request is decided, never failing it. Named value imports: audit, emit, invalidate, meter, notify, settlementOf. Named type imports: AuditOptions, AuditRecord, AuditSink, CacheInvalidator, Effect, EmitOptions, InvalidateOptions, MeterOptions, Notification, Notifier, NotifyOptions, Outbox, OutboxEvent, Settlement, UsageMeter. Import only the names used by this file.
186
+ Audit, emit, meter, invalidate and notify — what happens after a request is decided, never failing it. This entry exposes 6 named value exports and 15 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
110
187
 
111
188
  ```text
112
- import { audit, emit, invalidate, meter, notify, settlementOf } from '@forgezero/access/effects';
113
- import type { AuditOptions, AuditRecord, AuditSink, CacheInvalidator, Effect, EmitOptions } from '@forgezero/access/effects';
114
- import type { InvalidateOptions, MeterOptions, Notification, Notifier, NotifyOptions, Outbox } from '@forgezero/access/effects';
115
- import type { OutboxEvent, Settlement, UsageMeter } from '@forgezero/access/effects';
189
+ import {
190
+ audit,
191
+ emit,
192
+ invalidate,
193
+ meter,
194
+ notify,
195
+ settlementOf,
196
+ } from '@forgezero/access/effects';
197
+
198
+ import type {
199
+ AuditOptions,
200
+ AuditRecord,
201
+ AuditSink,
202
+ CacheInvalidator,
203
+ Effect,
204
+ EmitOptions,
205
+ InvalidateOptions,
206
+ MeterOptions,
207
+ Notification,
208
+ Notifier,
209
+ NotifyOptions,
210
+ Outbox,
211
+ OutboxEvent,
212
+ Settlement,
213
+ UsageMeter,
214
+ } from '@forgezero/access/effects';
116
215
  ```
117
216
 
118
217
  <a id="forgezero-access-security"></a>
119
218
  ## @forgezero/access/security
120
219
 
121
- Constant-time comparison, CSPRNG tokens, HMAC, HKDF, AES-GCM sealing and redaction. Web Crypto only. Named value imports: fromBase64Url, fromHex, hashToken, hkdf, hmacSha256, isLive, nowSeconds, open, randomDigits, randomHex, randomInt, randomToken, redact, seal, secretFieldPattern, sha256, timingSafeEqual, toBase64Url, toHex, verifyHmac. Named type imports: Sealed. Import only the names used by this file.
220
+ Constant-time comparison, CSPRNG tokens, HMAC, HKDF, AES-GCM sealing and redaction. Web Crypto only. This entry exposes 20 named value exports and 1 named type export. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
122
221
 
123
222
  ```text
124
- import { fromBase64Url, fromHex, hashToken, hkdf, hmacSha256, isLive } from '@forgezero/access/security';
125
- import { nowSeconds, open, randomDigits, randomHex, randomInt, randomToken } from '@forgezero/access/security';
126
- import { redact, seal, secretFieldPattern, sha256, timingSafeEqual, toBase64Url } from '@forgezero/access/security';
127
- import { toHex, verifyHmac } from '@forgezero/access/security';
128
- import type { Sealed } from '@forgezero/access/security';
223
+ import {
224
+ fromBase64Url,
225
+ fromHex,
226
+ hashToken,
227
+ hkdf,
228
+ hmacSha256,
229
+ isLive,
230
+ nowSeconds,
231
+ open,
232
+ randomDigits,
233
+ randomHex,
234
+ randomInt,
235
+ randomToken,
236
+ redact,
237
+ seal,
238
+ secretFieldPattern,
239
+ sha256,
240
+ timingSafeEqual,
241
+ toBase64Url,
242
+ toHex,
243
+ verifyHmac,
244
+ } from '@forgezero/access/security';
245
+
246
+ import type {
247
+ Sealed,
248
+ } from '@forgezero/access/security';
129
249
  ```
130
250
 
131
251
  <a id="forgezero-access-rate-limit"></a>
132
252
  ## @forgezero/access/rate-limit
133
253
 
134
- Request counters over a window — in memory, in Redis, or in a Durable Object. Named value imports: durableObjectStore, memoryStore, redisStore, slidingWindowStore. Named type imports: DurableStorageLike, RedisLike. Import only the names used by this file.
254
+ Request counters over a window — in memory, in Redis, or in a Durable Object. This entry exposes 4 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
135
255
 
136
256
  ```text
137
- import { durableObjectStore, memoryStore, redisStore, slidingWindowStore } from '@forgezero/access/rate-limit';
138
- import type { DurableStorageLike, RedisLike } from '@forgezero/access/rate-limit';
257
+ import {
258
+ durableObjectStore,
259
+ memoryStore,
260
+ redisStore,
261
+ slidingWindowStore,
262
+ } from '@forgezero/access/rate-limit';
263
+
264
+ import type {
265
+ DurableStorageLike,
266
+ RedisLike,
267
+ } from '@forgezero/access/rate-limit';
139
268
  ```
140
269
 
141
270
  <a id="forgezero-access-fetch"></a>
142
271
  ## @forgezero/access/fetch
143
272
 
144
- A Fetch-native adapter over the declared access pipeline. Named value imports: compileRoute, matchRoute, toFetch. Named type imports: FetchHandler. Import only the names used by this file.
273
+ A Fetch-native adapter over the declared access pipeline. This entry exposes 3 named value exports and 1 named type export. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
145
274
 
146
275
  ```text
147
- import { compileRoute, matchRoute, toFetch } from '@forgezero/access/fetch';
148
- import type { FetchHandler } from '@forgezero/access/fetch';
276
+ import {
277
+ compileRoute,
278
+ matchRoute,
279
+ toFetch,
280
+ } from '@forgezero/access/fetch';
281
+
282
+ import type {
283
+ FetchHandler,
284
+ } from '@forgezero/access/fetch';
149
285
  ```
150
286
 
151
287
  <a id="forgezero-access-pipeline"></a>
152
288
  ## @forgezero/access/pipeline
153
289
 
154
- The framework-neutral route, principal, factor, policy, rate-limit and effects pipeline. Named value imports: createPipeline, defineHandlers, windowSeconds. Named type imports: Handler, HandlerRegistry, Pipeline, PipelineOptions, RateStore, SessionResolver, StepUpStore, Telemetry, Validator. Import only the names used by this file.
290
+ The framework-neutral route, principal, factor, policy, rate-limit and effects pipeline. This entry exposes 3 named value exports and 9 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
155
291
 
156
292
  ```text
157
- import { createPipeline, defineHandlers, windowSeconds } from '@forgezero/access/pipeline';
158
- import type { Handler, HandlerRegistry, Pipeline, PipelineOptions, RateStore, SessionResolver } from '@forgezero/access/pipeline';
159
- import type { StepUpStore, Telemetry, Validator } from '@forgezero/access/pipeline';
293
+ import {
294
+ createPipeline,
295
+ defineHandlers,
296
+ windowSeconds,
297
+ } from '@forgezero/access/pipeline';
298
+
299
+ import type {
300
+ Handler,
301
+ HandlerRegistry,
302
+ Pipeline,
303
+ PipelineOptions,
304
+ RateStore,
305
+ SessionResolver,
306
+ StepUpStore,
307
+ Telemetry,
308
+ Validator,
309
+ } from '@forgezero/access/pipeline';
160
310
  ```
161
311
 
162
312
  <a id="forgezero-access-elysia"></a>
163
313
  ## @forgezero/access/elysia
164
314
 
165
- Elysia integration over the same access pipeline and route declarations. Named value imports: elysia, forbiddenTelemetryAttribute, telemetryFrom, toElysiaPath. Named type imports: ElysiaAdapterOptions, OtelTracer. Import only the names used by this file.
315
+ Elysia integration over the same access pipeline and route declarations. This entry exposes 4 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
166
316
 
167
317
  ```text
168
- import { elysia, forbiddenTelemetryAttribute, telemetryFrom, toElysiaPath } from '@forgezero/access/elysia';
169
- import type { ElysiaAdapterOptions, OtelTracer } from '@forgezero/access/elysia';
318
+ import {
319
+ elysia,
320
+ forbiddenTelemetryAttribute,
321
+ telemetryFrom,
322
+ toElysiaPath,
323
+ } from '@forgezero/access/elysia';
324
+
325
+ import type {
326
+ ElysiaAdapterOptions,
327
+ OtelTracer,
328
+ } from '@forgezero/access/elysia';
170
329
  ```
171
330
 
172
331
  <a id="forgezero-access-client"></a>
173
332
  ## @forgezero/access/client
174
333
 
175
- Typed client helpers that fulfil factors without duplicating the security matrix. Named value imports: buildPath, createClient. Named type imports: ChallengeHandler, ClientOptions, ClientResult, Problem, RequestArgs, SecurityChallenge. Import only the names used by this file.
334
+ Typed client helpers that fulfil factors without duplicating the security matrix. This entry exposes 2 named value exports and 6 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
176
335
 
177
336
  ```text
178
- import { buildPath, createClient } from '@forgezero/access/client';
179
- import type { ChallengeHandler, ClientOptions, ClientResult, Problem, RequestArgs, SecurityChallenge } from '@forgezero/access/client';
337
+ import {
338
+ buildPath,
339
+ createClient,
340
+ } from '@forgezero/access/client';
341
+
342
+ import type {
343
+ ChallengeHandler,
344
+ ClientOptions,
345
+ ClientResult,
346
+ Problem,
347
+ RequestArgs,
348
+ SecurityChallenge,
349
+ } from '@forgezero/access/client';
180
350
  ```
181
351
 
182
352
  <a id="forgezero-access-testing"></a>
183
353
  ## @forgezero/access/testing
184
354
 
185
- Deterministic access-pipeline fixtures and assertions for consumer tests. Named value imports: reachableRoutes, simulate, unreachableRoutes. Named type imports: SimulateArgs, Verdict. Import only the names used by this file.
355
+ Deterministic access-pipeline fixtures and assertions for consumer tests. This entry exposes 3 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
186
356
 
187
357
  ```text
188
- import { reachableRoutes, simulate, unreachableRoutes } from '@forgezero/access/testing';
189
- import type { SimulateArgs, Verdict } from '@forgezero/access/testing';
358
+ import {
359
+ reachableRoutes,
360
+ simulate,
361
+ unreachableRoutes,
362
+ } from '@forgezero/access/testing';
363
+
364
+ import type {
365
+ SimulateArgs,
366
+ Verdict,
367
+ } from '@forgezero/access/testing';
190
368
  ```
191
369
 
192
370
  <a id="forgezero-access-header"></a>
193
371
  ## @forgezero/access/header
194
372
 
195
- Strict configurable header-identity extraction with canonical names and bounded values. Named value imports: defineHeaderIdentitySources, headerIdentityResolver. Named type imports: HeaderAssignmentResolver, HeaderIdentity, HeaderIdentitySource, HeaderPrincipal. Import only the names used by this file.
373
+ Strict configurable header-identity extraction with canonical names and bounded values. This entry exposes 2 named value exports and 4 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
196
374
 
197
375
  ```text
198
- import { defineHeaderIdentitySources, headerIdentityResolver } from '@forgezero/access/header';
199
- import type { HeaderAssignmentResolver, HeaderIdentity, HeaderIdentitySource, HeaderPrincipal } from '@forgezero/access/header';
376
+ import {
377
+ defineHeaderIdentitySources,
378
+ headerIdentityResolver,
379
+ } from '@forgezero/access/header';
380
+
381
+ import type {
382
+ HeaderAssignmentResolver,
383
+ HeaderIdentity,
384
+ HeaderIdentitySource,
385
+ HeaderPrincipal,
386
+ } from '@forgezero/access/header';
200
387
  ```
201
388
 
202
389
  <a id="forgezero-access-principal"></a>
203
390
  ## @forgezero/access/principal
204
391
 
205
- Generic principal-source resolution for browser, API-key, attestation or future identity adapters. Named value imports: assignmentIsActive, decidePrincipalAccess, defineRbacPrincipal, touchPrincipalAssignment. Named type imports: PrincipalAccessDecision, PrincipalAssignment, RbacPrincipal. Import only the names used by this file.
392
+ Generic principal-source resolution for browser, API-key, attestation or future identity adapters. This entry exposes 4 named value exports and 3 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
206
393
 
207
394
  ```text
208
- import { assignmentIsActive, decidePrincipalAccess, defineRbacPrincipal, touchPrincipalAssignment } from '@forgezero/access/principal';
209
- import type { PrincipalAccessDecision, PrincipalAssignment, RbacPrincipal } from '@forgezero/access/principal';
395
+ import {
396
+ assignmentIsActive,
397
+ decidePrincipalAccess,
398
+ defineRbacPrincipal,
399
+ touchPrincipalAssignment,
400
+ } from '@forgezero/access/principal';
401
+
402
+ import type {
403
+ PrincipalAccessDecision,
404
+ PrincipalAssignment,
405
+ RbacPrincipal,
406
+ } from '@forgezero/access/principal';
210
407
  ```
211
408
 
212
409
  <a id="forgezero-access-principal-session"></a>
213
410
  ## @forgezero/access/principal-session
214
411
 
215
- Short-lived scope-bound delegated-principal sessions with sliding and absolute expiry. Named value imports: DEFAULT_PRINCIPAL_ABSOLUTE_TTL_MS, DEFAULT_PRINCIPAL_IDLE_TTL_MS, MAX_PRINCIPAL_ABSOLUTE_TTL_MS, MAX_PRINCIPAL_IDLE_TTL_MS, authenticatePrincipalSession, issuePrincipalSession, principalSessionIsActive, touchPrincipalSession. Named type imports: IssuedPrincipalSession, PrincipalSessionRecord. Import only the names used by this file.
412
+ Short-lived scope-bound delegated-principal sessions with sliding and absolute expiry. This entry exposes 8 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
216
413
 
217
414
  ```text
218
- import { DEFAULT_PRINCIPAL_ABSOLUTE_TTL_MS, DEFAULT_PRINCIPAL_IDLE_TTL_MS, MAX_PRINCIPAL_ABSOLUTE_TTL_MS, MAX_PRINCIPAL_IDLE_TTL_MS, authenticatePrincipalSession, issuePrincipalSession } from '@forgezero/access/principal-session';
219
- import { principalSessionIsActive, touchPrincipalSession } from '@forgezero/access/principal-session';
220
- import type { IssuedPrincipalSession, PrincipalSessionRecord } from '@forgezero/access/principal-session';
415
+ import {
416
+ DEFAULT_PRINCIPAL_ABSOLUTE_TTL_MS,
417
+ DEFAULT_PRINCIPAL_IDLE_TTL_MS,
418
+ MAX_PRINCIPAL_ABSOLUTE_TTL_MS,
419
+ MAX_PRINCIPAL_IDLE_TTL_MS,
420
+ authenticatePrincipalSession,
421
+ issuePrincipalSession,
422
+ principalSessionIsActive,
423
+ touchPrincipalSession,
424
+ } from '@forgezero/access/principal-session';
425
+
426
+ import type {
427
+ IssuedPrincipalSession,
428
+ PrincipalSessionRecord,
429
+ } from '@forgezero/access/principal-session';
221
430
  ```
222
431
 
223
432
  <a id="forgezero-access-authenticator"></a>
224
433
  ## @forgezero/access/authenticator
225
434
 
226
- Authentication-source contracts for adding identity mechanisms without changing route policy. Named value imports: createAuthenticator, encoding. Named type imports: AuthenticationOptions, AuthenticationResponse, Authenticator, AuthenticatorOptions, Credential, RegistrationOptions, RegistrationResponse. Import only the names used by this file.
435
+ Authentication-source contracts for adding identity mechanisms without changing route policy. This entry exposes 2 named value exports and 7 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
227
436
 
228
437
  ```text
229
- import { createAuthenticator, encoding } from '@forgezero/access/authenticator';
230
- import type { AuthenticationOptions, AuthenticationResponse, Authenticator, AuthenticatorOptions, Credential, RegistrationOptions } from '@forgezero/access/authenticator';
231
- import type { RegistrationResponse } from '@forgezero/access/authenticator';
438
+ import {
439
+ createAuthenticator,
440
+ encoding,
441
+ } from '@forgezero/access/authenticator';
442
+
443
+ import type {
444
+ AuthenticationOptions,
445
+ AuthenticationResponse,
446
+ Authenticator,
447
+ AuthenticatorOptions,
448
+ Credential,
449
+ RegistrationOptions,
450
+ RegistrationResponse,
451
+ } from '@forgezero/access/authenticator';
232
452
  ```
233
453
 
234
454
  <a id="forgezero-access-ceremony-modes"></a>
235
455
  ## @forgezero/access/ceremony-modes
236
456
 
237
- Named security-ceremony modes and their session/action fulfilment semantics. Named value imports: MAX_CUSTODIANS, THRESHOLD_MODES, thresholdMode. Named type imports: ThresholdMode, ThresholdModeId. Import only the names used by this file.
457
+ Named security-ceremony modes and their session/action fulfilment semantics. This entry exposes 3 named value exports and 2 named type exports. The generated import block lists one name per line for scanning and copying; keep only the names used by your file.
238
458
 
239
459
  ```text
240
- import { MAX_CUSTODIANS, THRESHOLD_MODES, thresholdMode } from '@forgezero/access/ceremony-modes';
241
- import type { ThresholdMode, ThresholdModeId } from '@forgezero/access/ceremony-modes';
460
+ import {
461
+ MAX_CUSTODIANS,
462
+ THRESHOLD_MODES,
463
+ thresholdMode,
464
+ } from '@forgezero/access/ceremony-modes';
465
+
466
+ import type {
467
+ ThresholdMode,
468
+ ThresholdModeId,
469
+ } from '@forgezero/access/ceremony-modes';
242
470
  ```
243
471
 
244
472
  ## 1. Install
@@ -254,7 +482,12 @@ bun add @forgezero/access
254
482
  Routes carry their contract — label, method, and the shapes they accept and return. WHO may reach them is a separate list, because the two change for different reasons and on different schedules.
255
483
 
256
484
  ```text
257
- import { defineRoutes, defineAccessControl, page, action } from '@forgezero/access';
485
+ import {
486
+ defineRoutes,
487
+ defineAccessControl,
488
+ page,
489
+ action,
490
+ } from '@forgezero/access';
258
491
 
259
492
  export const ROUTES = defineRoutes({
260
493
  orders: page('Orders'),
@@ -278,11 +511,15 @@ One line per runtime. The pipeline is written once and shared, so an adapter nev
278
511
 
279
512
  ```text
280
513
  // anywhere fetch exists — Workers, Deno, Node, Bun
281
- import { toFetch } from '@forgezero/access/fetch';
514
+ import {
515
+ toFetch,
516
+ } from '@forgezero/access/fetch';
282
517
  export default { fetch: toFetch({ access: ACCESS, handlers: HANDLERS }) };
283
518
 
284
519
  // Elysia
285
- import { elysia } from '@forgezero/access/elysia';
520
+ import {
521
+ elysia,
522
+ } from '@forgezero/access/elysia';
286
523
  app.use(elysia({ access: ACCESS, handlers: HANDLERS, Elysia }));
287
524
  ```
288
525
 
@@ -328,7 +565,10 @@ impactOfDisabling(ACCESS, ['passkey'])
328
565
  simulate() reports which policy decided, which a browser 403 never tells you. reachableRoutes() answers what a role can actually do — worth running, because stem inheritance grants more than a grant list reads like.
329
566
 
330
567
  ```text
331
- import { simulate, reachableRoutes } from '@forgezero/access/testing';
568
+ import {
569
+ simulate,
570
+ reachableRoutes,
571
+ } from '@forgezero/access/testing';
332
572
 
333
573
  simulate(ACCESS, { route: 'api/settings', roles, as: 'member' });
334
574
  // { allowed: false, status: 403, reason: 'ACCESS_DENIED', sessionPolicy: 'admin' }
@@ -379,7 +619,11 @@ assertDeclaredRefusals({ routes: ROUTES, conditions: CONDITIONS });
379
619
  Audit, emit, meter, invalidate and notify. None can fail the request — a dead audit sink must not turn a completed transfer into a 500. Audit records denials as well as successes, because a run of 403s from one session is the signal an incident is reconstructed from. Every payload is redacted first.
380
620
 
381
621
  ```text
382
- import { audit, emit, meter } from '@forgezero/access/effects';
622
+ import {
623
+ audit,
624
+ emit,
625
+ meter,
626
+ } from '@forgezero/access/effects';
383
627
 
384
628
  afterHandlers: {
385
629
  trail: audit({ routes: [...], sink }),
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.4";
278
+ var VERSION = "0.1.5";
279
279
 
280
280
  // src/conditions.ts
281
281
  function define(condition, routes, refusals, run) {
package/dist/effects.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.4";
278
+ var VERSION = "0.1.5";
279
279
 
280
280
  // src/security.ts
281
281
  var HEX = Array.from({ length: 256 }, (_, index) => index.toString(16).padStart(2, "0"));
package/dist/elysia.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.4";
278
+ var VERSION = "0.1.5";
279
279
 
280
280
  // src/pipeline.ts
281
281
  function defineHandlers(routes, handlers) {
package/dist/fetch.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.4";
278
+ var VERSION = "0.1.5";
279
279
 
280
280
  // src/pipeline.ts
281
281
  function defineHandlers(routes, handlers) {
package/dist/header.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.4";
278
+ var VERSION = "0.1.5";
279
279
 
280
280
  // src/principal.ts
281
281
  var ATOM = /^[A-Za-z0-9][A-Za-z0-9_.:@/-]{0,255}$/;
package/dist/index.d.ts CHANGED
@@ -379,4 +379,4 @@ export declare function impactOfDisabling<R extends RouteRegistry>(access: Acces
379
379
  available: number;
380
380
  required: number;
381
381
  }[];
382
- export declare const VERSION = "0.1.4";
382
+ export declare const VERSION = "0.1.5";
package/dist/index.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.4";
278
+ var VERSION = "0.1.5";
279
279
  export {
280
280
  stemOf,
281
281
  resolveActionFactors,
package/dist/pipeline.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.4";
278
+ var VERSION = "0.1.5";
279
279
 
280
280
  // src/pipeline.ts
281
281
  function defineHandlers(routes, handlers) {
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.4";
278
+ var VERSION = "0.1.5";
279
279
 
280
280
  // src/security.ts
281
281
  var HEX = Array.from({ length: 256 }, (_, index) => index.toString(16).padStart(2, "0"));
package/dist/principal.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.4";
278
+ var VERSION = "0.1.5";
279
279
 
280
280
  // src/principal.ts
281
281
  var ATOM = /^[A-Za-z0-9][A-Za-z0-9_.:@/-]{0,255}$/;
package/dist/testing.js CHANGED
@@ -275,7 +275,7 @@ function impactOfDisabling(access, enabledAfter) {
275
275
  }
276
276
  return broken;
277
277
  }
278
- var VERSION = "0.1.4";
278
+ var VERSION = "0.1.5";
279
279
 
280
280
  // src/testing.ts
281
281
  function nameOf(policies, route) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgezero/access",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public",