@beignet/core 0.0.51 → 0.0.53
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/CHANGELOG.md +27 -0
- package/README.md +112 -20
- package/dist/application/index.d.ts +1 -1
- package/dist/application/index.d.ts.map +1 -1
- package/dist/application/index.js +5 -2
- package/dist/application/index.js.map +1 -1
- package/dist/encryption/index.d.ts +40 -0
- package/dist/encryption/index.d.ts.map +1 -0
- package/dist/encryption/index.js +134 -0
- package/dist/encryption/index.js.map +1 -0
- package/dist/events/index.d.ts +26 -2
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +84 -10
- package/dist/events/index.js.map +1 -1
- package/dist/events/payload-state.d.ts +14 -2
- package/dist/events/payload-state.d.ts.map +1 -1
- package/dist/events/payload-state.js +116 -4
- package/dist/events/payload-state.js.map +1 -1
- package/dist/events/transport.d.ts +25 -0
- package/dist/events/transport.d.ts.map +1 -0
- package/dist/events/transport.js +192 -0
- package/dist/events/transport.js.map +1 -0
- package/dist/openapi/index.d.ts.map +1 -1
- package/dist/openapi/index.js +27 -4
- package/dist/openapi/index.js.map +1 -1
- package/dist/outbox/index.d.ts.map +1 -1
- package/dist/outbox/index.js +10 -13
- package/dist/outbox/index.js.map +1 -1
- package/dist/ports/events.d.ts +4 -1
- package/dist/ports/events.d.ts.map +1 -1
- package/dist/ports/storage.d.ts +7 -0
- package/dist/ports/storage.d.ts.map +1 -1
- package/dist/ports/storage.js +4 -0
- package/dist/ports/storage.js.map +1 -1
- package/dist/ports/testing.d.ts +3 -2
- package/dist/ports/testing.d.ts.map +1 -1
- package/dist/ports/testing.js +7 -4
- package/dist/ports/testing.js.map +1 -1
- package/dist/ports/unit-of-work.d.ts +4 -4
- package/dist/ports/unit-of-work.d.ts.map +1 -1
- package/dist/ports/unit-of-work.js +8 -9
- package/dist/ports/unit-of-work.js.map +1 -1
- package/dist/search/index.js +2 -2
- package/dist/search/index.js.map +1 -1
- package/dist/server/instrumentation.d.ts +5 -5
- package/dist/server/instrumentation.d.ts.map +1 -1
- package/dist/server/instrumentation.js +3 -4
- package/dist/server/instrumentation.js.map +1 -1
- package/dist/server/request-executor.d.ts.map +1 -1
- package/dist/server/request-executor.js +13 -0
- package/dist/server/request-executor.js.map +1 -1
- package/dist/server/response-finalization.d.ts.map +1 -1
- package/dist/server/response-finalization.js +25 -13
- package/dist/server/response-finalization.js.map +1 -1
- package/dist/server/server.d.ts +8 -5
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +1 -3
- package/dist/server/server.js.map +1 -1
- package/dist/server/use-case-route.d.ts +82 -17
- package/dist/server/use-case-route.d.ts.map +1 -1
- package/dist/server/use-case-route.js +40 -4
- package/dist/server/use-case-route.js.map +1 -1
- package/dist/uploads/index.d.ts.map +1 -1
- package/dist/uploads/index.js +37 -16
- package/dist/uploads/index.js.map +1 -1
- package/package.json +6 -2
- package/skills/app-architecture/SKILL.md +29 -6
- package/src/application/index.ts +24 -3
- package/src/encryption/index.ts +198 -0
- package/src/events/index.ts +137 -10
- package/src/events/payload-state.ts +205 -6
- package/src/events/transport.ts +242 -0
- package/src/openapi/index.ts +41 -3
- package/src/outbox/index.ts +26 -18
- package/src/ports/events.ts +4 -1
- package/src/ports/storage.ts +10 -0
- package/src/ports/testing.ts +11 -4
- package/src/ports/unit-of-work.ts +20 -16
- package/src/search/index.ts +2 -2
- package/src/server/instrumentation.ts +10 -8
- package/src/server/request-executor.ts +19 -0
- package/src/server/response-finalization.ts +33 -15
- package/src/server/server.ts +9 -8
- package/src/server/use-case-route.ts +234 -27
- package/src/uploads/index.ts +34 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @beignet/core
|
|
2
2
|
|
|
3
|
+
## 0.0.53
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 6ef881c: Reject incompatible default route-binder inputs at compile time and classify
|
|
8
|
+
type-erased runtime mismatches as framework-owned validation errors. Generated
|
|
9
|
+
resource cursors now remain optional at the request boundary and normalize to
|
|
10
|
+
nullable repository pagination state inside the use case.
|
|
11
|
+
- e1a559d: Add authenticated string encryption through EncryptionPort and createEncryption, with optional context binding, decryption through previous keys, and non-sensitive failure errors. Add beignet encryption key for key generation, server import checks, and guidance for rotation and recovery.
|
|
12
|
+
- edebbea: Add `@beignet/react-form`, a TanStack Form adapter that installs a contract body schema as a Standard Schema validator, types the `onServer` error slot, and maps client errors with `serverErrorMap`. `beignet lint` keeps the form packages out of domain and use-case code, `beignet doctor` expects `client/forms.ts` for either form adapter, and `beignet make feature --with ui` refuses to add React Hook Form components to an app that depends on `@beignet/react-form`.
|
|
13
|
+
|
|
14
|
+
## 0.0.52
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- b39bb6e: Clarify that Beignet applications require Node.js 22.12 or newer and can use
|
|
19
|
+
npm, pnpm, Yarn, or Bun for package management and framework commands.
|
|
20
|
+
- 33bd8a2: Reject duplicate or ambiguous path operations during direct OpenAPI generation instead of emitting overwritten or invalid paths.
|
|
21
|
+
- ac76ab9: Reject event payloads with `EventTransportError` when they are not canonical JSON or change when validated again after transport, before publishing or recording them durably. Direct memory and recording-bus publication must be awaited while validation completes.
|
|
22
|
+
- 64dca8d: Bound webhook bodies, keep fallback errors private outside development and
|
|
23
|
+
tests, serialize snapshot-safe local storage operations, preserve ambient audit
|
|
24
|
+
correlation, surface provider shutdown failures, validate timer ranges, and
|
|
25
|
+
omit raw search and database queries from instrumentation. Release unread
|
|
26
|
+
storage bodies explicitly and bound provider-owned Redis shutdown.
|
|
27
|
+
- a50ef66: Send the parsed response-schema output from framework-neutral route handlers,
|
|
28
|
+
including transformed catalog error details.
|
|
29
|
+
|
|
3
30
|
## 0.0.51
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# @beignet/core
|
|
2
2
|
|
|
3
|
-
> **Runtime:** Beignet requires Node.js 22.12 or newer. Bun
|
|
4
|
-
> supported for Beignet commands.
|
|
3
|
+
> **Runtime:** Beignet requires Node.js 22.12 or newer. Bun is optional.
|
|
5
4
|
|
|
6
5
|
> Core framework primitives for Beignet
|
|
7
6
|
|
|
@@ -12,7 +11,7 @@
|
|
|
12
11
|
This package provides Beignet's framework primitives: contracts, server runtime,
|
|
13
12
|
typed client, use cases, agent capabilities, ports, domain helpers, app errors, config, events,
|
|
14
13
|
idempotency, locks, outbox, mail, notifications, payments, search, webhooks,
|
|
15
|
-
feature flags, error reporting, schedules, uploads, entitlements, pagination
|
|
14
|
+
feature flags, error reporting, encryption, schedules, uploads, entitlements, pagination
|
|
16
15
|
helpers, testing helpers, and OpenAPI generation.
|
|
17
16
|
|
|
18
17
|
## Installation
|
|
@@ -56,6 +55,7 @@ name the framework area they depend on.
|
|
|
56
55
|
| `@beignet/core/config` | Environment config validation |
|
|
57
56
|
| `@beignet/core/contracts` | HTTP contract builders, types, path helpers, and contract metadata |
|
|
58
57
|
| `@beignet/core/domain` | Entities, value objects, and domain events |
|
|
58
|
+
| `@beignet/core/encryption` | Authenticated string encryption, EncryptionPort, and key generation |
|
|
59
59
|
| `@beignet/core/entitlements` | Product access decision types, helpers, and static entitlement adapter |
|
|
60
60
|
| `@beignet/core/error-reporting` | Error reporting port, memory adapter, no-op adapter, and helpers |
|
|
61
61
|
| `@beignet/core/errors` | Error catalogs and response helpers |
|
|
@@ -86,6 +86,49 @@ name the framework area they depend on.
|
|
|
86
86
|
| `@beignet/core/uploads/client` | Browser upload client for server and direct uploads |
|
|
87
87
|
| `@beignet/core/webhooks` | Inbound webhook definitions, verifiers, memory test verifier, and HMAC verifier |
|
|
88
88
|
|
|
89
|
+
## Encryption
|
|
90
|
+
|
|
91
|
+
Use `createEncryption(...)` in server infra and expose `EncryptionPort` through
|
|
92
|
+
your app ports. It uses Web Crypto AES-256-GCM with a random 96-bit IV and a
|
|
93
|
+
128-bit authentication tag for each write.
|
|
94
|
+
|
|
95
|
+
```typescript
|
|
96
|
+
import { createEncryption } from "@beignet/core/encryption";
|
|
97
|
+
import { env } from "@/lib/env";
|
|
98
|
+
|
|
99
|
+
// Supply a persistent server secret from your validated environment config.
|
|
100
|
+
const encryption = createEncryption({
|
|
101
|
+
key: env.ENCRYPTION_KEY,
|
|
102
|
+
previousKeys: env.ENCRYPTION_PREVIOUS_KEYS,
|
|
103
|
+
});
|
|
104
|
+
const context = { purpose: "integration-token", tenantId: "tenant-1" };
|
|
105
|
+
const encrypted = await encryption.encrypt({ value: "example-token", context });
|
|
106
|
+
const token = await encryption.decrypt({ value: encrypted, context });
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Generate a persistent key with `beignet encryption key` or
|
|
110
|
+
`generateEncryptionKey()`: canonical `base64:` plus 32 random bytes. All keys
|
|
111
|
+
are validated synchronously. `key` encrypts new writes; `previousKeys` is an
|
|
112
|
+
optional array used only for decryption. The methods accept strings and return
|
|
113
|
+
`Promise<string>`. Optional `context` is a plain string record authenticated
|
|
114
|
+
with the value; supply the same expected context when decrypting. It does not
|
|
115
|
+
replace authorization.
|
|
116
|
+
|
|
117
|
+
Store the complete opaque ciphertext in a text column. Malformed values,
|
|
118
|
+
tampering, wrong keys, and context mismatches reject with
|
|
119
|
+
`EncryptionDecryptionError` and a non-sensitive message. There is no plaintext
|
|
120
|
+
fallback. The API emits no logs or telemetry.
|
|
121
|
+
|
|
122
|
+
Keep keys outside client bundles and logs. Rotation does not rewrite existing
|
|
123
|
+
data. Distribute a new decryption key to all readers before switching writes,
|
|
124
|
+
retain old keys while records and backups require them, and test recovery.
|
|
125
|
+
Losing a required key makes its ciphertext unreadable. This is field encryption,
|
|
126
|
+
not password hashing or streaming file encryption. See the
|
|
127
|
+
[encryption guide](https://beignetjs.com/encryption) for port wiring, rotation,
|
|
128
|
+
recovery, and KMS boundaries.
|
|
129
|
+
|
|
130
|
+
## Import boundaries
|
|
131
|
+
|
|
89
132
|
Use boundary markers as side-effect imports so local linting and formatting do
|
|
90
133
|
not treat them as unused symbols:
|
|
91
134
|
|
|
@@ -344,6 +387,17 @@ attempts the complete batch before rejecting with any callback failures.
|
|
|
344
387
|
|
|
345
388
|
## Event subscriptions
|
|
346
389
|
|
|
390
|
+
Beignet event payloads are canonical JSON transport data. `publishEvent(...)`,
|
|
391
|
+
use-case event helpers, buffered recorder flushes, and outbox helpers parse the
|
|
392
|
+
payload, convert the output to strict JSON, and validate the decoded JSON again.
|
|
393
|
+
They throw `EventTransportError` before publication or durable recording when
|
|
394
|
+
the output is not JSON-safe or changes under repeated validation. Use strings
|
|
395
|
+
or numbers for timestamps rather than `Date`, and keep schema transforms
|
|
396
|
+
idempotent. Keep validation deterministic and side-effect-free because Beignet
|
|
397
|
+
can run it at producer and receiving boundaries. A transform such as
|
|
398
|
+
`z.string().trim()` is valid because parsing its canonical output does not
|
|
399
|
+
change it.
|
|
400
|
+
|
|
347
401
|
`EventBusPort.subscribe(...)` returns an `EventSubscription` with a `ready`
|
|
348
402
|
promise and asynchronous, idempotent `unsubscribe()` method. Await `ready`
|
|
349
403
|
before advertising that a process can receive events, and await
|
|
@@ -362,11 +416,13 @@ Normal teardown after successful readiness still awaits transport cleanup;
|
|
|
362
416
|
apply a host-level shutdown deadline when required. Readiness is an initial
|
|
363
417
|
lifecycle signal, not an ongoing health check or durability guarantee.
|
|
364
418
|
|
|
365
|
-
An app-owned
|
|
366
|
-
`
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
419
|
+
An app-owned `EventBusPort` adapter must call
|
|
420
|
+
`prepareEventPayloadForTransport(...)` before publication. An in-process
|
|
421
|
+
adapter delivers the returned `payload` and forwards the complete
|
|
422
|
+
`publishOptions` object to subscribers. A serialized adapter encodes
|
|
423
|
+
`transportValue`, sends documented metadata such as the trace carrier, and lets
|
|
424
|
+
`registerListeners(...)` validate the decoded payload again at the receiving
|
|
425
|
+
boundary.
|
|
370
426
|
|
|
371
427
|
## Provider-contributed ports
|
|
372
428
|
|
|
@@ -683,6 +739,8 @@ const results = await ctx.ports.search.search(issueSearchIndex, {
|
|
|
683
739
|
Use `createMemorySearch(...)` in tests, `createMemorySearchProvider()` for local
|
|
684
740
|
provider wiring, or install `@beignet/provider-search-meilisearch` for
|
|
685
741
|
production search.
|
|
742
|
+
Search instrumentation records the index, result count, and query length. It
|
|
743
|
+
does not record query text or document bodies.
|
|
686
744
|
Provider adapters may require query fields to be declared in the index
|
|
687
745
|
metadata. For Meilisearch, `filters` and `facets` must use
|
|
688
746
|
`filterableAttributes`, and `sort` must use `sortableAttributes`.
|
|
@@ -722,6 +780,11 @@ trailing slashes, backslashes, empty segments, and `.` / `..` segments.
|
|
|
722
780
|
Provider adapters may add narrower restrictions for their own internal
|
|
723
781
|
namespaces.
|
|
724
782
|
|
|
783
|
+
`StoragePort.get(...)` returns a one-shot `StorageObjectBody`. Consume one of
|
|
784
|
+
its body methods, or call `await object.cancel()` when only inspecting metadata
|
|
785
|
+
so providers can release unread streams, sockets, or file snapshots. Prefer
|
|
786
|
+
`stat(...)` for metadata-only lookups.
|
|
787
|
+
|
|
725
788
|
## Uploads
|
|
726
789
|
|
|
727
790
|
Use `@beignet/core/uploads` for typed file workflows above `StoragePort`.
|
|
@@ -1700,6 +1763,10 @@ assertProviderInstrumentationEvent(providerEvents, {
|
|
|
1700
1763
|
});
|
|
1701
1764
|
```
|
|
1702
1765
|
|
|
1766
|
+
`createRecordingEventBus()` applies the same canonical JSON and
|
|
1767
|
+
transport-stability checks as Beignet's runtime event buses before appending an
|
|
1768
|
+
event to its captured log. Await `bus.publish(...)` before reading that log.
|
|
1769
|
+
|
|
1703
1770
|
`createProviderInstrumentation(...)` adds `details.providerName` to custom and
|
|
1704
1771
|
typed provider events, so tests and devtools can group provider work
|
|
1705
1772
|
consistently. Watcher checks, synchronous sink errors, and rejected
|
|
@@ -2063,14 +2130,13 @@ optional versioned trace carrier in `trace_context_json`; add that nullable
|
|
|
2063
2130
|
column to existing tables before upgrading the adapter.
|
|
2064
2131
|
|
|
2065
2132
|
Beignet's use-case event helpers, `publishEvent(...)`, and `enqueueEvent(...)`
|
|
2066
|
-
validate payloads and forward
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
parse.
|
|
2133
|
+
validate payloads and forward canonical Standard Schema output. They reject
|
|
2134
|
+
non-JSON outputs and transforms that change when canonical JSON is validated
|
|
2135
|
+
again, before publishing or writing an outbox row. In-process delivery
|
|
2136
|
+
preserves that validation state, while durable or distributed transports
|
|
2137
|
+
validate decoded JSON again. For an outbox, model timestamps as JSON strings or
|
|
2138
|
+
numbers rather than `Date` objects. Job transports continue to preserve the
|
|
2139
|
+
original JSON-safe payload until the worker's handler-facing parse.
|
|
2074
2140
|
|
|
2075
2141
|
An ordinary Unit of Work event flush has a different boundary: it runs after
|
|
2076
2142
|
commit, and a publishing failure rejects even though the database writes are
|
|
@@ -2204,6 +2270,13 @@ explicit `input: (parts) => ...` mapper. When the use case `.input(...)`
|
|
|
2204
2270
|
schema is the contract's sole request schema by reference, the server skips
|
|
2205
2271
|
the use case's input re-parse — one schema, one parse.
|
|
2206
2272
|
|
|
2273
|
+
The route definition checks the inferred default binder input against the use
|
|
2274
|
+
case input type. Incompatible concrete shapes are compile errors with a prompt
|
|
2275
|
+
to add an explicit `input` mapper. If route types are deliberately erased and
|
|
2276
|
+
the default input still fails use-case validation at runtime, the server
|
|
2277
|
+
returns a framework-owned `500 USE_CASE_INPUT_VALIDATION_ERROR` rather than
|
|
2278
|
+
passing the failure through the app's unhandled-error mapper.
|
|
2279
|
+
|
|
2207
2280
|
Use `{ contract, handle }` as the escape hatch for response headers,
|
|
2208
2281
|
streaming, and multi-status responses. `defineRoute` remains
|
|
2209
2282
|
available for full handlers that read hook-added `ctx` fields.
|
|
@@ -2395,7 +2468,7 @@ import { appContext } from "@/server/context";
|
|
|
2395
2468
|
const server = await createServer({
|
|
2396
2469
|
ports,
|
|
2397
2470
|
providers,
|
|
2398
|
-
// Defaults shown. Pass
|
|
2471
|
+
// Defaults shown. Pass false to disable headers and event recording.
|
|
2399
2472
|
instrumentation: {
|
|
2400
2473
|
requestIdHeader: "x-request-id",
|
|
2401
2474
|
traceContextHeader: "traceparent",
|
|
@@ -2409,6 +2482,12 @@ Service contexts created with `server.createServiceContext(...)` receive fresh
|
|
|
2409
2482
|
`requestId` and `trace` values per call. Context values win: when a factory
|
|
2410
2483
|
sets its own `requestId`, headers and recorded events use it.
|
|
2411
2484
|
|
|
2485
|
+
`instrumentation: false` keeps request and service correlation available to
|
|
2486
|
+
context factories and `createAmbientAuditLog(...)`; it disables only response
|
|
2487
|
+
headers and instrumentation event recording.
|
|
2488
|
+
`ignorePaths` suppresses recorded events without removing ambient correlation
|
|
2489
|
+
from matching requests.
|
|
2490
|
+
|
|
2412
2491
|
Trace primitives live in `@beignet/core/tracing` (`TraceContext`,
|
|
2413
2492
|
`TracingPort`, `TraceOperation`, `TraceSpan`, `createTraceContext`,
|
|
2414
2493
|
`createChildTraceContext`, `parseTraceparent`, `createTraceparent`,
|
|
@@ -2485,9 +2564,16 @@ normalize to an anonymous actor.
|
|
|
2485
2564
|
|
|
2486
2565
|
Route-owned response validation can be disabled with
|
|
2487
2566
|
`validateResponses: false` on `createServer(...)`, mirroring the client option
|
|
2488
|
-
of the same name.
|
|
2489
|
-
|
|
2490
|
-
|
|
2567
|
+
of the same name. When enabled, Beignet sends the declared response schema's
|
|
2568
|
+
parsed output: object schemas can strip undeclared keys, transforms change the
|
|
2569
|
+
wire value, and catalog error-detail schemas apply the same semantics. The
|
|
2570
|
+
parsed body is also the value observed by response finalizers, `afterSend`
|
|
2571
|
+
hooks, and idempotency storage. Disabling validation sends route-owned handler
|
|
2572
|
+
bodies as-is without schema stripping or transforms.
|
|
2573
|
+
|
|
2574
|
+
Binder routes whose use case `.output(...)` schema is the declared success
|
|
2575
|
+
response schema by reference skip the redundant success-status parse only when
|
|
2576
|
+
use-case output validation is enabled. If the use case sets
|
|
2491
2577
|
`validate: { output: false }`, route response validation still runs once. If
|
|
2492
2578
|
profiling justifies disabling validation entirely, drive `validateResponses`
|
|
2493
2579
|
from an environment flag so development and CI keep it on.
|
|
@@ -2535,6 +2621,11 @@ schema.
|
|
|
2535
2621
|
OpenAPI `operationId` defaults to the stable contract name. Explicit operation
|
|
2536
2622
|
IDs are supported when an external SDK needs a different method name; server
|
|
2537
2623
|
registration and OpenAPI generation reject duplicates.
|
|
2624
|
+
`contractsToOpenAPI(...)` also rejects duplicate method and normalized path
|
|
2625
|
+
combinations instead of replacing an earlier operation; `:id` and `[id]` both
|
|
2626
|
+
normalize to the OpenAPI path parameter `{id}`. Paths with the same hierarchy
|
|
2627
|
+
must also use consistent parameter names: `/items/{id}` and `/items/{slug}`
|
|
2628
|
+
cannot coexist in one OpenAPI document, even when they use different methods.
|
|
2538
2629
|
|
|
2539
2630
|
### External TypeScript clients
|
|
2540
2631
|
|
|
@@ -2647,6 +2738,7 @@ field requiredness, descriptions, and constraints.
|
|
|
2647
2738
|
- [`@beignet/next`](https://beignetjs.com/server) - Next.js server adapter
|
|
2648
2739
|
- [`@beignet/react-query`](https://beignetjs.com/react-query) - TanStack Query integration
|
|
2649
2740
|
- [`@beignet/react-hook-form`](https://beignetjs.com/react-hook-form) - React Hook Form integration
|
|
2741
|
+
- [`@beignet/react-form`](https://beignetjs.com/react-form) - TanStack Form integration
|
|
2650
2742
|
- [`@beignet/react-uploads`](https://beignetjs.com/react-uploads) - React upload state and progress hooks
|
|
2651
2743
|
- [`@beignet/nuqs`](https://beignetjs.com/nuqs) - URL query state integration with nuqs
|
|
2652
2744
|
- [`@beignet/devtools`](https://beignetjs.com/devtools) - Local request, provider, and audit timeline
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBA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C;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EACrC,aAAa,EAAE,GAAG,GAAG,CAAC,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC,GAC7C,aAAa,CAAC,GAAG,CAAC,CAqBpB;AAKD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAC/B,OAAO,CAAC,EAAE,oBAAoB,CAAC,GAAG,CAAC,GAClC,kBAAkB,CAAC,GAAG,CAAC,CA4CzB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { prepareEventPayloadForTransport, } from "../events/index.js";
|
|
1
2
|
import { markEventPayloadParsed } from "../events/payload-state.js";
|
|
2
3
|
import { resolveProviderInstrumentationPort, } from "../providers/instrumentation.js";
|
|
3
4
|
import { createChildTraceContext, resolveTracingPort, runWithTracing, } from "../tracing/index.js";
|
|
@@ -127,12 +128,14 @@ function createUseCaseEventHelpers(useCaseName, declared) {
|
|
|
127
128
|
async record(recorder, event, payload) {
|
|
128
129
|
const declaredEvent = resolveDeclared(event);
|
|
129
130
|
const parsed = await parseEventPayload(declaredEvent, payload, useCaseName);
|
|
130
|
-
await
|
|
131
|
+
const prepared = await prepareEventPayloadForTransport(declaredEvent, parsed, markEventPayloadParsed(declaredEvent, parsed));
|
|
132
|
+
await recorder.record(declaredEvent, prepared.payload, prepared.publishOptions);
|
|
131
133
|
},
|
|
132
134
|
async publish(eventBus, event, payload) {
|
|
133
135
|
const declaredEvent = resolveDeclared(event);
|
|
134
136
|
const parsed = await parseEventPayload(declaredEvent, payload, useCaseName);
|
|
135
|
-
await
|
|
137
|
+
const prepared = await prepareEventPayloadForTransport(declaredEvent, parsed, markEventPayloadParsed(declaredEvent, parsed));
|
|
138
|
+
await eventBus.publish(declaredEvent, prepared.payload, prepared.publishOptions);
|
|
136
139
|
},
|
|
137
140
|
};
|
|
138
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"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AI,cAAc,CAQvB;gBACE,IAAI;gBACJ,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,WAAW;aACnB,EACD,KAAK,EACL,UAAU,EACV,YAAY,CACb,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "../server-only.js";
|
|
2
|
+
/** Non-secret, authenticated metadata. Supply the same expected context on reads. */
|
|
3
|
+
export type EncryptionContext = Readonly<Record<string, string>>;
|
|
4
|
+
/** Options shared by string encryption and decryption. */
|
|
5
|
+
export interface EncryptionValueOptions {
|
|
6
|
+
/** Plaintext for encrypt; the complete encrypted value for decrypt. */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Bind the value to its purpose, tenant, or record. This is not authorization. */
|
|
9
|
+
context?: EncryptionContext;
|
|
10
|
+
}
|
|
11
|
+
/** Server-side authenticated string encryption. */
|
|
12
|
+
export interface EncryptionPort {
|
|
13
|
+
/** Encrypt a string; persist the complete returned value. */
|
|
14
|
+
encrypt(options: EncryptionValueOptions): Promise<string>;
|
|
15
|
+
/** Authenticate and decrypt a value with the same expected context. */
|
|
16
|
+
decrypt(options: EncryptionValueOptions): Promise<string>;
|
|
17
|
+
}
|
|
18
|
+
/** Configuration for the built-in AES-256-GCM implementation. */
|
|
19
|
+
export interface CreateEncryptionOptions {
|
|
20
|
+
/** A base64: prefixed, canonical Base64 encoding of 32 random bytes. */
|
|
21
|
+
key: string;
|
|
22
|
+
/** Decryption-only keys in the same format. New writes always use key. */
|
|
23
|
+
previousKeys?: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
/** Malformed, unauthenticated, or undecryptable ciphertext. Contains no input. */
|
|
26
|
+
export declare class EncryptionDecryptionError extends Error {
|
|
27
|
+
/** Stable error name, independent of the decryption failure's cause. */
|
|
28
|
+
readonly name = "EncryptionDecryptionError";
|
|
29
|
+
constructor();
|
|
30
|
+
}
|
|
31
|
+
/** Generate a new 256-bit key. Store it in a server secret store; never log it. */
|
|
32
|
+
export declare function generateEncryptionKey(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Create authenticated string encryption using Web Crypto AES-256-GCM.
|
|
35
|
+
* Configuration is validated synchronously. Each write uses a random 96-bit IV
|
|
36
|
+
* and a 128-bit authentication tag. Previous keys are used only for reads.
|
|
37
|
+
* No environment variables are read and no plaintext, keys, or context are logged.
|
|
38
|
+
*/
|
|
39
|
+
export declare function createEncryption(options: CreateEncryptionOptions): EncryptionPort;
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/encryption/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AAE3B,qFAAqF;AACrF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEjE,0DAA0D;AAC1D,MAAM,WAAW,sBAAsB;IACrC,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,mDAAmD;AACnD,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,OAAO,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,uEAAuE;IACvE,OAAO,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3D;AAED,iEAAiE;AACjE,MAAM,WAAW,uBAAuB;IACtC,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED,kFAAkF;AAClF,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,wEAAwE;IACxE,QAAQ,CAAC,IAAI,+BAA+B;;CAK7C;AAsED,mFAAmF;AACnF,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,uBAAuB,GAC/B,cAAc,CA6EhB"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import "../server-only.js";
|
|
2
|
+
/** Malformed, unauthenticated, or undecryptable ciphertext. Contains no input. */
|
|
3
|
+
export class EncryptionDecryptionError extends Error {
|
|
4
|
+
/** Stable error name, independent of the decryption failure's cause. */
|
|
5
|
+
name = "EncryptionDecryptionError";
|
|
6
|
+
constructor() {
|
|
7
|
+
super("Unable to decrypt encrypted value.");
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
const envelopePrefix = "beignet:enc:v1:";
|
|
11
|
+
const ivLength = 12;
|
|
12
|
+
const tagLength = 16;
|
|
13
|
+
const encoder = new TextEncoder();
|
|
14
|
+
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
15
|
+
function encodeBase64(bytes) {
|
|
16
|
+
// Bound each spread so large values do not overflow the argument stack.
|
|
17
|
+
const chunks = [];
|
|
18
|
+
for (let offset = 0; offset < bytes.length; offset += 8192) {
|
|
19
|
+
chunks.push(String.fromCharCode(...bytes.subarray(offset, offset + 8192)));
|
|
20
|
+
}
|
|
21
|
+
return btoa(chunks.join(""));
|
|
22
|
+
}
|
|
23
|
+
function decodeBase64(value) {
|
|
24
|
+
if (value.length % 4 !== 0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(value)) {
|
|
25
|
+
throw new Error("Invalid Base64 encoding.");
|
|
26
|
+
}
|
|
27
|
+
const bytes = Uint8Array.from(atob(value), (character) => character.charCodeAt(0));
|
|
28
|
+
if (encodeBase64(bytes) !== value)
|
|
29
|
+
throw new Error("Noncanonical Base64 encoding.");
|
|
30
|
+
return bytes;
|
|
31
|
+
}
|
|
32
|
+
function decodeKey(value, label) {
|
|
33
|
+
try {
|
|
34
|
+
if (typeof value !== "string" ||
|
|
35
|
+
value.length !== 51 ||
|
|
36
|
+
!value.startsWith("base64:"))
|
|
37
|
+
throw new Error();
|
|
38
|
+
const bytes = decodeBase64(value.slice(7));
|
|
39
|
+
if (bytes.length !== 32)
|
|
40
|
+
throw new Error();
|
|
41
|
+
return bytes;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
throw new TypeError(`${label} must be base64: followed by the Base64 encoding of 32 bytes. Use generateEncryptionKey().`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function authenticatedData(context) {
|
|
48
|
+
if (context !== undefined &&
|
|
49
|
+
(context === null ||
|
|
50
|
+
typeof context !== "object" ||
|
|
51
|
+
(Object.getPrototypeOf(context) !== Object.prototype &&
|
|
52
|
+
Object.getPrototypeOf(context) !== null))) {
|
|
53
|
+
throw new TypeError("Encryption context must be a plain record of strings.");
|
|
54
|
+
}
|
|
55
|
+
const entries = Object.entries(context ?? {}).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0);
|
|
56
|
+
if (entries.some(([, value]) => typeof value !== "string")) {
|
|
57
|
+
throw new TypeError("Encryption context values must be strings.");
|
|
58
|
+
}
|
|
59
|
+
return encoder.encode(JSON.stringify([envelopePrefix, entries]));
|
|
60
|
+
}
|
|
61
|
+
/** Generate a new 256-bit key. Store it in a server secret store; never log it. */
|
|
62
|
+
export function generateEncryptionKey() {
|
|
63
|
+
return `base64:${encodeBase64(crypto.getRandomValues(new Uint8Array(32)))}`;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Create authenticated string encryption using Web Crypto AES-256-GCM.
|
|
67
|
+
* Configuration is validated synchronously. Each write uses a random 96-bit IV
|
|
68
|
+
* and a 128-bit authentication tag. Previous keys are used only for reads.
|
|
69
|
+
* No environment variables are read and no plaintext, keys, or context are logged.
|
|
70
|
+
*/
|
|
71
|
+
export function createEncryption(options) {
|
|
72
|
+
const current = decodeKey(options?.key, "Encryption key");
|
|
73
|
+
if (options.previousKeys !== undefined &&
|
|
74
|
+
!Array.isArray(options.previousKeys)) {
|
|
75
|
+
throw new TypeError("Encryption previousKeys must be an array of keys.");
|
|
76
|
+
}
|
|
77
|
+
const rawKeys = [
|
|
78
|
+
current,
|
|
79
|
+
...Array.from(options.previousKeys ?? [], (key, index) => decodeKey(key, `Encryption previousKeys[${index}]`)),
|
|
80
|
+
];
|
|
81
|
+
const importedKeys = [];
|
|
82
|
+
const getKey = (index) => {
|
|
83
|
+
const existing = importedKeys[index];
|
|
84
|
+
if (existing)
|
|
85
|
+
return existing;
|
|
86
|
+
const imported = crypto.subtle.importKey("raw", rawKeys[index], "AES-GCM", false, ["encrypt", "decrypt"]);
|
|
87
|
+
importedKeys[index] = imported;
|
|
88
|
+
return imported;
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
async encrypt({ value, context }) {
|
|
92
|
+
if (typeof value !== "string")
|
|
93
|
+
throw new TypeError("Encryption value must be a string.");
|
|
94
|
+
const additionalData = authenticatedData(context);
|
|
95
|
+
const iv = crypto.getRandomValues(new Uint8Array(ivLength));
|
|
96
|
+
const ciphertext = new Uint8Array(await crypto.subtle.encrypt({ name: "AES-GCM", iv, additionalData, tagLength: tagLength * 8 }, await getKey(0),
|
|
97
|
+
// JSON preserves all JavaScript strings, including lone UTF-16 surrogates.
|
|
98
|
+
encoder.encode(JSON.stringify(value))));
|
|
99
|
+
const envelope = new Uint8Array(iv.length + ciphertext.length);
|
|
100
|
+
envelope.set(iv);
|
|
101
|
+
envelope.set(ciphertext, iv.length);
|
|
102
|
+
return `${envelopePrefix}${encodeBase64(envelope)}`;
|
|
103
|
+
},
|
|
104
|
+
async decrypt(options) {
|
|
105
|
+
try {
|
|
106
|
+
const { value, context } = options;
|
|
107
|
+
if (typeof value !== "string" || !value.startsWith(envelopePrefix))
|
|
108
|
+
throw new Error();
|
|
109
|
+
const envelope = decodeBase64(value.slice(envelopePrefix.length));
|
|
110
|
+
if (envelope.length < ivLength + tagLength + 2)
|
|
111
|
+
throw new Error();
|
|
112
|
+
const additionalData = authenticatedData(context);
|
|
113
|
+
const iv = envelope.slice(0, ivLength);
|
|
114
|
+
const ciphertext = envelope.slice(ivLength);
|
|
115
|
+
for (let index = 0; index < rawKeys.length; index++) {
|
|
116
|
+
try {
|
|
117
|
+
const plaintext = await crypto.subtle.decrypt({ name: "AES-GCM", iv, additionalData, tagLength: tagLength * 8 }, await getKey(index), ciphertext);
|
|
118
|
+
const parsed = JSON.parse(decoder.decode(plaintext));
|
|
119
|
+
if (typeof parsed === "string")
|
|
120
|
+
return parsed;
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// Try only the configured key ring; never return unauthenticated data.
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
// All decryption failures share one non-sensitive public error.
|
|
129
|
+
}
|
|
130
|
+
throw new EncryptionDecryptionError();
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/encryption/index.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAC;AA6B3B,kFAAkF;AAClF,MAAM,OAAO,yBAA0B,SAAQ,KAAK;IAClD,wEAAwE;IAC/D,IAAI,GAAG,2BAA2B,CAAC;IAE5C;QACE,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAC9C,CAAC;CACF;AAED,MAAM,cAAc,GAAG,iBAAiB,CAAC;AACzC,MAAM,QAAQ,GAAG,EAAE,CAAC;AACpB,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;AAClC,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAE1D,SAAS,YAAY,CAAC,KAAiB;IACrC,wEAAwE;IACxE,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,KAAK,IAA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