@adonis-agora/crypto-integrations 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,23 +1,80 @@
1
1
  # @adonis-agora/crypto-integrations
2
2
 
3
- ## 0.1.0
3
+ ## 0.3.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - [#5](https://github.com/DavideCarvalho/adonis-agora-crypto/pull/5) [`6b141b5`](https://github.com/DavideCarvalho/adonis-agora-crypto/commit/6b141b5b4ca090c39f60d72d0581beec60863504) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - The 0.x integrations package, so the rc libs stay untouched.
8
-
9
- - `/authkit`, `/agent`, `/config`: a crypto-kit KMS root backed by the crypto server under each lib's
10
- key convention (`authkit-root`, `agent-poppy-root`, `config-root`) plus an `agora:doctor` check
11
- that the key exists, is `aes256-gcm`, and that this process can seal and open with it (missing key,
12
- wrong type, missing capabilities and a changed root each get their own message and fix).
13
- - `/durable`: `encryptedTransport` and `encryptedControlPlane` decorators over ready instances —
14
- task `input`, step `output`/`error`, heartbeat `progress` and control-plane `event` payloads are
15
- sealed; ids, step names, groups, priorities, attempts, `from`/`runId` and queue metadata stay in
16
- clear so routing and dedupe are unchanged. `onControl` keeps broker order, and the docs state the
17
- NestJS interop caveat.
18
- - `/flags`: an envelope `fetch` for `transports.http` and the posthog/clickhouse sinks.
19
- - `/http`: an envelope `fetch` for any call (authkit token requests, config tenant fetches) plus the
20
- receiver middleware re-exports.
21
-
22
- Every helper accepts `{ client }` (remote server) or `{ service, partition }` (embedded server), so
23
- the same integration works in `standalone`, `control-plane` and `tenant`.
7
+ - [#14](https://github.com/DavideCarvalho/adonis-agora-crypto/pull/14) [`ef09ac8`](https://github.com/DavideCarvalho/adonis-agora-crypto/commit/ef09ac86208132eba42e25fc6ddac111fe5e964b) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - The tenant side lives in `@adonis-agora/crypto`, like every other Agora lib.
8
+
9
+ `@adonis-agora/crypto-client` is gone. The typed client, `cryptoServerKms`, `cryptoEnvelope`/
10
+ `cryptoFetch` and `cryptoServerSigner` moved to `@adonis-agora/crypto-core` (the only piece a worker,
11
+ a script or a non-Adonis service needs — it never imports `@adonisjs/core`), and `@adonis-agora/crypto`
12
+ re-exports them. A tenant now installs one package and picks its role with `topology: 'tenant'` in
13
+ `config/crypto.ts`; `services/main` gives the same API in `standalone`, `control-plane` and `tenant`.
14
+
15
+ `@adonis-agora/crypto-integrations` and `@adonis-agora/crypto-react` import from `crypto`/`crypto-core`,
16
+ never from a separate client package. Docs got the same "Central server" shape as flags (control
17
+ plane, tenant, moving from standalone, end-to-end example). `@adonis-agora/crypto-client` is deprecated
18
+ on npm; its last version keeps working.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [[`ef09ac8`](https://github.com/DavideCarvalho/adonis-agora-crypto/commit/ef09ac86208132eba42e25fc6ddac111fe5e964b)]:
23
+ - @adonis-agora/crypto@0.5.0
24
+ - @adonis-agora/crypto-core@0.3.0
25
+
26
+ ## 0.2.0
27
+
28
+ ### Minor Changes
29
+
30
+ - [#12](https://github.com/DavideCarvalho/adonis-agora-crypto/pull/12) [`ab8292a`](https://github.com/DavideCarvalho/adonis-agora-crypto/commit/ab8292a52527a7408d5c4ab36043b0325139b86f) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - Auditable opens: an operation can carry `context`.
31
+
32
+ `decrypt`, `rewrap` and `generateDataKey` accept an optional `context` (`user:42`, `grant:7`, `boot`),
33
+ recorded on the audit row as `metadata.context` — including on refusals, so a probe is traceable. It is
34
+ never encrypted, so it must not hold the plaintext or a secret; a value longer than 200 characters or
35
+ with control characters is refused. `DecryptInput`/`RewrapInput`/`DataKeyInput` gained the field, and
36
+ `crypto:decrypt` gained `--context`.
37
+
38
+ `configCrypto` sends the entry path (`config:<app>:<environment>:<label>:<key>`) as the context, so the
39
+ crypto audit of a server-held config secret says which entry was opened.
40
+
41
+ - [#12](https://github.com/DavideCarvalho/adonis-agora-crypto/pull/12) [`ab8292a`](https://github.com/DavideCarvalho/adonis-agora-crypto/commit/ab8292a52527a7408d5c4ab36043b0325139b86f) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - The server-held config secret seam, for `@adonis-agora/config`.
42
+
43
+ `configCrypto({ source, key?, keys? })` seals and opens the `{ key, ciphertext }` reference a config
44
+ entry stores: `seal(plaintext, entry)` on the control plane (needs only `crypto:encrypt:<key>`),
45
+ `open(reference, entry)` in the app (needs only `crypto:decrypt:<key>`), with the entry identity
46
+ (`app`, `environment`, `label`, key) bound as AAD so a reference cannot be moved to another entry,
47
+ and an allow-list (`keys`, default the sealing key) so a tampered config cannot point the app at
48
+ another key its token holds. `isCryptoReference`/`parseReference` let config mask and validate the
49
+ value without knowing crypto, and `configCryptoAad(entry)` derives the same AAD on both sides.
50
+
51
+ Also: `pnpm bench` (`scripts/bench-crypto.mjs`) and the performance page — what each path costs,
52
+ whether Adonis encryption blocks the event loop (it does: it is synchronous), and when a worker
53
+ thread is worth it.
54
+
55
+ - [#12](https://github.com/DavideCarvalho/adonis-agora-crypto/pull/12) [`ab8292a`](https://github.com/DavideCarvalho/adonis-agora-crypto/commit/ab8292a52527a7408d5c4ab36043b0325139b86f) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - `sealedOpenChannel(lib)` — the diagnostics bus channel of a recipient-held open.
56
+
57
+ The payload's `event` stays `crypto:sealed.open` (product-neutral: the fact, not the emitter), while the
58
+ bus channel names who emitted it, `agora:<lib>:sealed.open`, the same convention authkit uses for
59
+ `agora:authkit:<type>`. Config therefore emits `agora:config:sealed.open` with
60
+ `event: 'crypto:sealed.open'`, and another product that opens shares can emit the same payload under
61
+ its own channel. Docs also spell out the whole structural contract (`{ key, ciphertext }`, the AAD, the
62
+ event shape, the capabilities) so a lib can adopt the seams before the package is on npm.
63
+
64
+ - [#12](https://github.com/DavideCarvalho/adonis-agora-crypto/pull/12) [`ab8292a`](https://github.com/DavideCarvalho/adonis-agora-crypto/commit/ab8292a52527a7408d5c4ab36043b0325139b86f) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - The audit contract for a recipient-held open.
65
+
66
+ `sealedOpenEvent({ actor, subject, key, kid, resource, at?, result? })` builds the `crypto:sealed.open`
67
+ payload every app emits when it opens a `sealTo` share: `actor ?? sub` — the same identity rule as the
68
+ crypto server's audit — plus the `kid` that opened it, a resource label, a timestamp and `ok`/`error`.
69
+ An open with no identity throws instead of emitting an anonymous row. Exported from the package root
70
+ and from `/config` (which is what emits it, as `config:sealed.open` + `tenant.onSealedOpen`).
71
+
72
+ `openWithAudit()` (and `sealedKid()`) in `@adonis-agora/crypto-react` open a share on the device and
73
+ return the value with the `kid` and timestamp the event needs.
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [[`ab8292a`](https://github.com/DavideCarvalho/adonis-agora-crypto/commit/ab8292a52527a7408d5c4ab36043b0325139b86f)]:
78
+ - @adonis-agora/crypto-core@0.2.0
79
+ - @adonis-agora/crypto@0.4.0
80
+ - @adonis-agora/crypto-client@0.2.1
@@ -1,5 +1,5 @@
1
1
  import type { AgoraDoctorCheck } from '@adonis-agora/crypto';
2
- import type { KmsAdapterLike } from '@adonis-agora/crypto-client';
2
+ import type { KmsAdapterLike } from '@adonis-agora/crypto-core';
3
3
  import { type KmsCheckOptions, type KmsIntegrationOptions } from './kms.js';
4
4
  /** agent's poppy-connections root: the refresh tokens, DPoP keys and delegated keys it keeps. */
5
5
  export declare const AGENT_ROOT_KEY: "agent-poppy-root";
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK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,0 +1,68 @@
1
+ /**
2
+ * The audit contract for a **recipient-held** open (`sealTo` / `openWith`): the crypto server never
3
+ * sees it, so the app records it. This is the one shape every product emits, so Telescope (and any
4
+ * other reader) shows the same identity in both models.
5
+ *
6
+ * Server-held (`crypto.decrypt`) needs none of this: the crypto server audits it, with the same
7
+ * `actor ?? sub` rule.
8
+ */
9
+ /**
10
+ * The **semantic** event type carried in the payload (`event` field). It names the fact, not the
11
+ * emitter, so every product that opens a share emits the same payload.
12
+ */
13
+ export declare const SEALED_OPEN_EVENT = "crypto:sealed.open";
14
+ /**
15
+ * The **diagnostics bus channel** it is emitted on: `agora:<emitting lib>:sealed.open`.
16
+ *
17
+ * The channel names who emitted it (the lib whose entry was opened), the same way authkit emits
18
+ * `agora:authkit:<type>`; the payload names the fact (`crypto:sealed.open`). So config emits
19
+ * `agora:config:sealed.open` with `event: 'crypto:sealed.open'` — not `agora:crypto:sealed.open`,
20
+ * which would read as if the crypto lib had seen the open (it did not: recipient-held is local).
21
+ */
22
+ export declare function sealedOpenChannel(lib: string): string;
23
+ /** Who opened it: `actor ?? sub`, exactly like the crypto server's audit. */
24
+ export type SealedOpenActor = string | {
25
+ sub?: string | undefined;
26
+ email?: string | undefined;
27
+ };
28
+ export interface SealedOpenEventInput {
29
+ /** `Identity.actor` when an agent acts for a person (RFC 8693 `act`), or a plain string. */
30
+ actor?: SealedOpenActor | null | undefined;
31
+ /** `Identity.sub` — the authenticated principal behind the open. */
32
+ subject?: string | undefined;
33
+ /** The key name the share was sealed to (the app's own key, e.g. `doctor-42`). */
34
+ key: string;
35
+ /** The `kid` the `agora:pk1` value names (the version that opened it). */
36
+ kid?: string | undefined;
37
+ /** What was opened, in the product's own vocabulary (a grant, an entry, an exam). */
38
+ resource?: string | undefined;
39
+ /** ISO timestamp. Default: now. */
40
+ at?: string | undefined;
41
+ /** `ok` (default) or `error` when the open was refused/failed. */
42
+ result?: 'ok' | 'error' | undefined;
43
+ }
44
+ export interface SealedOpenEvent {
45
+ event: typeof SEALED_OPEN_EVENT;
46
+ v: 1;
47
+ /** `actor ?? subject`: the same identity rule as the crypto server's audit. */
48
+ actor: string;
49
+ subject?: string;
50
+ key: string;
51
+ kid?: string;
52
+ resource?: string;
53
+ at: string;
54
+ result: 'ok' | 'error';
55
+ }
56
+ /**
57
+ * Builds the event an app emits when *it* opens a share:
58
+ *
59
+ * ```ts
60
+ * const event = sealedOpenEvent({ actor: identity.actor, subject: identity.sub, key: 'doctor-42', kid, resource: `grant:${id}` })
61
+ * emitter.emit(SEALED_OPEN_EVENT, event)
62
+ * ```
63
+ *
64
+ * No actor and no subject is a programming error: an open without an identity would make the audit
65
+ * lie, so it throws instead of emitting an anonymous row.
66
+ */
67
+ export declare function sealedOpenEvent(input: SealedOpenEventInput): SealedOpenEvent;
68
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,uBAAuB,CAAC;AAEtD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKrD;AAED,6EAA6E;AAC7E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEhG,MAAM,WAAW,oBAAoB;IACnC,4FAA4F;IAC5F,KAAK,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,kFAAkF;IAClF,GAAG,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,qFAAqF;IACrF,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,mCAAmC;IACnC,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,kEAAkE;IAClE,MAAM,CAAC,EAAE,IAAI,GAAG,OAAO,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,OAAO,iBAAiB,CAAC;IAChC,CAAC,EAAE,CAAC,CAAC;IACL,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,IAAI,GAAG,OAAO,CAAC;CACxB;AAKD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe,CAqB5E"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * The audit contract for a **recipient-held** open (`sealTo` / `openWith`): the crypto server never
3
+ * sees it, so the app records it. This is the one shape every product emits, so Telescope (and any
4
+ * other reader) shows the same identity in both models.
5
+ *
6
+ * Server-held (`crypto.decrypt`) needs none of this: the crypto server audits it, with the same
7
+ * `actor ?? sub` rule.
8
+ */
9
+ /**
10
+ * The **semantic** event type carried in the payload (`event` field). It names the fact, not the
11
+ * emitter, so every product that opens a share emits the same payload.
12
+ */
13
+ export const SEALED_OPEN_EVENT = 'crypto:sealed.open';
14
+ /**
15
+ * The **diagnostics bus channel** it is emitted on: `agora:<emitting lib>:sealed.open`.
16
+ *
17
+ * The channel names who emitted it (the lib whose entry was opened), the same way authkit emits
18
+ * `agora:authkit:<type>`; the payload names the fact (`crypto:sealed.open`). So config emits
19
+ * `agora:config:sealed.open` with `event: 'crypto:sealed.open'` — not `agora:crypto:sealed.open`,
20
+ * which would read as if the crypto lib had seen the open (it did not: recipient-held is local).
21
+ */
22
+ export function sealedOpenChannel(lib) {
23
+ if (typeof lib !== 'string' || lib.trim() === '') {
24
+ throw new Error('crypto: sealedOpenChannel needs the emitting lib name (e.g. "config")');
25
+ }
26
+ return `agora:${lib}:sealed.open`;
27
+ }
28
+ const subjectOf = (actor) => typeof actor === 'string' ? actor : actor?.sub;
29
+ /**
30
+ * Builds the event an app emits when *it* opens a share:
31
+ *
32
+ * ```ts
33
+ * const event = sealedOpenEvent({ actor: identity.actor, subject: identity.sub, key: 'doctor-42', kid, resource: `grant:${id}` })
34
+ * emitter.emit(SEALED_OPEN_EVENT, event)
35
+ * ```
36
+ *
37
+ * No actor and no subject is a programming error: an open without an identity would make the audit
38
+ * lie, so it throws instead of emitting an anonymous row.
39
+ */
40
+ export function sealedOpenEvent(input) {
41
+ if (typeof input.key !== 'string' || input.key === '') {
42
+ throw new Error('crypto: a sealed-open event needs the key name');
43
+ }
44
+ const actor = subjectOf(input.actor) ?? input.subject;
45
+ if (actor === undefined || actor === '') {
46
+ throw new Error('crypto: a sealed-open event needs an identity (actor ?? subject); an anonymous open is not auditable');
47
+ }
48
+ return {
49
+ event: SEALED_OPEN_EVENT,
50
+ v: 1,
51
+ actor,
52
+ ...(input.subject !== undefined ? { subject: input.subject } : {}),
53
+ key: input.key,
54
+ ...(input.kid !== undefined ? { kid: input.kid } : {}),
55
+ ...(input.resource !== undefined ? { resource: input.resource } : {}),
56
+ at: input.at ?? new Date().toISOString(),
57
+ result: input.result ?? 'ok',
58
+ };
59
+ }
60
+ //# sourceMappingURL=audit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../src/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,oBAAoB,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAW;IAC3C,IAAI,OAAO,GAAG,KAAK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K,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,EAAE,EAAE,KAAK,CAAC,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACxC,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,IAAI;KAC7B,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { AgoraDoctorCheck } from '@adonis-agora/crypto';
2
- import type { KmsAdapterLike } from '@adonis-agora/crypto-client';
2
+ import type { KmsAdapterLike } from '@adonis-agora/crypto-core';
3
3
  import { type KmsCheckOptions, type KmsIntegrationOptions } from './kms.js';
4
4
  /** authkit-server's root key: its keystore (JWKS private keys) and account secrets. */
5
5
  export declare const AUTHKIT_ROOT_KEY: "authkit-root";
@@ -1 +1 @@
1
- {"version":3,"file":"authkit.d.ts","sourceRoot":"","sources":["../../src/authkit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAA0B,MAAM,UAAU,CAAC;AAEpG,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,gBAAoB,CAAC;AAClD,2CAA2C;AAC3C,eAAO,MAAM,eAAe,iCAAiC,CAAC;AAE9D;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D,cAAc,CAKhB;AAED,uFAAuF;AACvF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,KAAK,GAAG,aAAa,GAAG,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/E,gBAAgB,CAQlB"}
1
+ {"version":3,"file":"authkit.d.ts","sourceRoot":"","sources":["../../src/authkit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAA0B,MAAM,UAAU,CAAC;AAEpG,uFAAuF;AACvF,eAAO,MAAM,gBAAgB,gBAAoB,CAAC;AAClD,2CAA2C;AAC3C,eAAO,MAAM,eAAe,iCAAiC,CAAC;AAE9D;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,IAAI,CAAC,qBAAqB,EAAE,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D,cAAc,CAKhB;AAED,uFAAuF;AACvF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,KAAK,GAAG,aAAa,GAAG,KAAK,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/E,gBAAgB,CAQlB"}
@@ -1,10 +1,15 @@
1
1
  import type { AgoraDoctorCheck } from '@adonis-agora/crypto';
2
- import type { KmsAdapterLike } from '@adonis-agora/crypto-client';
2
+ import type { KmsAdapterLike } from '@adonis-agora/crypto-core';
3
3
  import { type KmsCheckOptions, type KmsIntegrationOptions } from './kms.js';
4
4
  /** config's root: every secret entry (`crypto:secrets`, `vault://` aside) is sealed under it. */
5
5
  export declare const CONFIG_ROOT_KEY: "config-root";
6
6
  /** The package the check reports under. */
7
7
  export declare const CONFIG_PACKAGE = "@adonis-agora/config";
8
+ /**
9
+ * The recipient-held open event, re-exported here because it is config that emits it:
10
+ * `config:sealed.open` in the product's bus, carrying `actor ?? sub`, the key and the `kid`.
11
+ */
12
+ export { SEALED_OPEN_EVENT, type SealedOpenActor, type SealedOpenEvent, type SealedOpenEventInput, sealedOpenChannel, sealedOpenEvent, } from './audit.js';
8
13
  /**
9
14
  * The KMS root for `@adonis-agora/config`:
10
15
  *
@@ -23,4 +28,76 @@ export declare function configKms(options: Omit<KmsIntegrationOptions, 'key'> &
23
28
  export declare function configKmsCheck(options: Omit<KmsCheckOptions, 'lib' | 'packageName' | 'key'> & {
24
29
  key?: string;
25
30
  }): AgoraDoctorCheck;
31
+ /**
32
+ * A secret entry as config stores it: no plaintext, just the crypto key's name and the ciphertext.
33
+ * The control plane can write it (it holds `crypto:encrypt:<key>`) and can never read it (it does
34
+ * not hold `crypto:decrypt:<key>`); the app reads it with its own token.
35
+ */
36
+ export interface CryptoReference {
37
+ /** The crypto server key the value was sealed with (`config-root` by default). */
38
+ key: string;
39
+ /** `agora:ct1:…` (or `agora:pk1:…` for an x25519 key). Opaque to config. */
40
+ ciphertext: string;
41
+ }
42
+ /** What the reference is bound to: the entry's identity inside config. */
43
+ export interface ConfigEntryRef {
44
+ app: string;
45
+ environment: string;
46
+ /** Default `main`. */
47
+ label?: string;
48
+ /** The entry's dot path. */
49
+ key: string;
50
+ }
51
+ /**
52
+ * The AAD both sides derive for one entry: a reference copied to another app, environment, label or
53
+ * key does not open. `configCrypto` uses it for every seal/open unless the caller passes another.
54
+ */
55
+ export declare function configCryptoAad(entry: ConfigEntryRef): string;
56
+ export interface ConfigCryptoOptions {
57
+ source: KmsIntegrationOptions['source'];
58
+ /** The key new references seal with. Default `config-root`. */
59
+ key?: string;
60
+ /**
61
+ * Keys a reference may name when opening. Default `[key]`: a tampered config cannot point the app
62
+ * at another key its token happens to hold (`fleet-root`, …). List the old roots during a rotation.
63
+ */
64
+ keys?: string[];
65
+ }
66
+ export interface ConfigCrypto {
67
+ /** Seals a plaintext for storage. Needs `crypto:encrypt:<key>` on the source's token. */
68
+ seal(plaintext: string, entry: ConfigEntryRef, options?: {
69
+ key?: string;
70
+ aad?: string;
71
+ }): Promise<CryptoReference>;
72
+ /** Opens a stored reference. Needs `crypto:decrypt:<key>` on the source's token. */
73
+ open(reference: CryptoReference, entry: ConfigEntryRef, options?: {
74
+ aad?: string;
75
+ }): Promise<string>;
76
+ /** Whether a value already looks like a reference (so the control plane can mask it). */
77
+ isReference(value: unknown): value is CryptoReference;
78
+ /** Validates a reference from config before opening it (allow-list, shape, ciphertext prefix). */
79
+ parseReference(value: unknown): CryptoReference;
80
+ }
81
+ /**
82
+ * The *server-held* config secret seam: config stores `{ key, ciphertext }`, the app decrypts it at
83
+ * boot/reload with its own token.
84
+ *
85
+ * ```ts title="config/config.ts (control plane: encrypt only)"
86
+ * const secrets = configCrypto({ source: { client: crypto }, key: 'config-root' })
87
+ * const stored = await secrets.seal('hunter2', { app: 'streaming', environment: 'production', key: 'db.password' })
88
+ * // entry value: { key: 'config-root', ciphertext: 'agora:ct1:config-root:1:…' }
89
+ * ```
90
+ *
91
+ * ```ts title="the app (decrypt only)"
92
+ * const secrets = configCrypto({ source: { client: crypto } })
93
+ * const password = await secrets.open(entry.value, { app, environment, key })
94
+ * ```
95
+ *
96
+ * The crypto server's partition is the same on both sides (recommended: a dedicated `platform`
97
+ * partition, or the control plane's own): the control plane's token holds
98
+ * `crypto:encrypt:config-root` only, the app's holds `crypto:decrypt:config-root` only.
99
+ */
100
+ /** Structural check for a stored reference: `{ key, ciphertext }` and nothing else. */
101
+ export declare function isCryptoReference(value: unknown): value is CryptoReference;
102
+ export declare function configCrypto(options: ConfigCryptoOptions): ConfigCrypto;
26
103
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,qBAAqB,EAA0B,MAAM,UAAU,CAAC;AAEpG,iGAAiG;AACjG,eAAO,MAAM,eAAe,eA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;;;;;;;;;;;;GAkBG;AACH,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe,CAQ1E;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CAiDvE"}
@@ -1,9 +1,15 @@
1
1
  import { ROOT_KEYS } from './keys.js';
2
2
  import { kmsDoctorCheck, kmsFor } from './kms.js';
3
+ import { cipherFor } from './source.js';
3
4
  /** config's root: every secret entry (`crypto:secrets`, `vault://` aside) is sealed under it. */
4
5
  export const CONFIG_ROOT_KEY = ROOT_KEYS.config;
5
6
  /** The package the check reports under. */
6
7
  export const CONFIG_PACKAGE = '@adonis-agora/config';
8
+ /**
9
+ * The recipient-held open event, re-exported here because it is config that emits it:
10
+ * `config:sealed.open` in the product's bus, carrying `actor ?? sub`, the key and the `kid`.
11
+ */
12
+ export { SEALED_OPEN_EVENT, sealedOpenChannel, sealedOpenEvent, } from './audit.js';
7
13
  /**
8
14
  * The KMS root for `@adonis-agora/config`:
9
15
  *
@@ -29,4 +35,82 @@ export function configKmsCheck(options) {
29
35
  title: 'KMS root for the secrets',
30
36
  });
31
37
  }
38
+ /**
39
+ * The AAD both sides derive for one entry: a reference copied to another app, environment, label or
40
+ * key does not open. `configCrypto` uses it for every seal/open unless the caller passes another.
41
+ */
42
+ export function configCryptoAad(entry) {
43
+ return `config:${entry.app}:${entry.environment}:${entry.label ?? 'main'}:${entry.key}`;
44
+ }
45
+ /**
46
+ * The *server-held* config secret seam: config stores `{ key, ciphertext }`, the app decrypts it at
47
+ * boot/reload with its own token.
48
+ *
49
+ * ```ts title="config/config.ts (control plane: encrypt only)"
50
+ * const secrets = configCrypto({ source: { client: crypto }, key: 'config-root' })
51
+ * const stored = await secrets.seal('hunter2', { app: 'streaming', environment: 'production', key: 'db.password' })
52
+ * // entry value: { key: 'config-root', ciphertext: 'agora:ct1:config-root:1:…' }
53
+ * ```
54
+ *
55
+ * ```ts title="the app (decrypt only)"
56
+ * const secrets = configCrypto({ source: { client: crypto } })
57
+ * const password = await secrets.open(entry.value, { app, environment, key })
58
+ * ```
59
+ *
60
+ * The crypto server's partition is the same on both sides (recommended: a dedicated `platform`
61
+ * partition, or the control plane's own): the control plane's token holds
62
+ * `crypto:encrypt:config-root` only, the app's holds `crypto:decrypt:config-root` only.
63
+ */
64
+ /** Structural check for a stored reference: `{ key, ciphertext }` and nothing else. */
65
+ export function isCryptoReference(value) {
66
+ if (typeof value !== 'object' || value === null)
67
+ return false;
68
+ const candidate = value;
69
+ return (typeof candidate.key === 'string' &&
70
+ typeof candidate.ciphertext === 'string' &&
71
+ Object.keys(candidate).every((field) => field === 'key' || field === 'ciphertext'));
72
+ }
73
+ export function configCrypto(options) {
74
+ const sealKey = options.key ?? CONFIG_ROOT_KEY;
75
+ const allowed = new Set(options.keys ?? [sealKey]);
76
+ const cipher = cipherFor(options.source, 'config:secrets');
77
+ return {
78
+ isReference: isCryptoReference,
79
+ parseReference(value) {
80
+ if (!this.isReference(value)) {
81
+ throw new Error('crypto: a crypto reference is { key, ciphertext } and nothing else (no plaintext)');
82
+ }
83
+ if (value.key === '' || value.ciphertext === '') {
84
+ throw new Error('crypto: a crypto reference needs a key name and a ciphertext');
85
+ }
86
+ if (!allowed.has(value.key)) {
87
+ throw new Error(`crypto: the reference names "${value.key}", which this app is not configured to open (allowed: ${[...allowed].join(', ')})`);
88
+ }
89
+ if (!value.ciphertext.startsWith('agora:')) {
90
+ throw new Error('crypto: the reference ciphertext is not an agora: value');
91
+ }
92
+ return { key: value.key, ciphertext: value.ciphertext };
93
+ },
94
+ async seal(plaintext, entry, sealOptions = {}) {
95
+ if (typeof plaintext !== 'string')
96
+ throw new Error('crypto: seal takes a string');
97
+ const key = sealOptions.key ?? sealKey;
98
+ const aad = sealOptions.aad ?? configCryptoAad(entry);
99
+ const { ciphertext } = await cipher.encrypt({ key, plaintext, aad, context: aad });
100
+ return { key, ciphertext };
101
+ },
102
+ async open(reference, entry, openOptions = {}) {
103
+ const parsed = this.parseReference(reference);
104
+ const aad = openOptions.aad ?? configCryptoAad(entry);
105
+ const { plaintext } = await cipher.decrypt({
106
+ key: parsed.key,
107
+ ciphertext: parsed.ciphertext,
108
+ aad,
109
+ // The entry path, in clear, so the crypto audit says which secret was opened.
110
+ context: aad,
111
+ });
112
+ return plaintext;
113
+ },
114
+ };
115
+ }
32
116
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAoD,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEpG,iGAAiG;AACjG,MAAM,CAAC,MAAM,eAAe,GAAG,SAAS,CAAC,MAAM,CAAC;AAChD,2CAA2C;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,sBAAsB,CAAC;AAErD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,SAAS,CACvB,OAA8D;IAE9D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,eAAe,CAAC;IAC3C,OAAO,MAAM,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;AAC1C,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,cAAc,CAC5B,OAAgF;IAEhF,OAAO,cAAc,CAAC;QACpB,GAAG,OAAO;QACV,GAAG,EAAE,QAAQ;QACb,WAAW,EAAE,cAAc;QAC3B,GAAG,EAAE,OAAO,CAAC,GAAG,IAAI,eAAe;QACnC,KAAK,EAAE,0BAA0B;KAClC,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAoD,cAAc,EAAE,MAAM,EAAE,MAAM,UAAU,C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E,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC;QAC1D,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,WAAW,GAAG,EAAE;YAC3C,IAAI,OAAO,SAAS,KAAK,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;YAClF,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,IAAI,OAAO,CAAC;YACvC,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;YACtD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC;YACnF,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,CAAC;QAC7B,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,EAAE,WAAW,GAAG,EAAE;YAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;YAC9C,MAAM,GAAG,GAAG,WAAW,CAAC,GAAG,IAAI,eAAe,CAAC,KAAK,CAAC,CAAC;YACtD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC;gBACzC,GAAG,EAAE,MAAM,CAAC,GAAG;gBACf,UAAU,EAAE,MAAM,CAAC,UAAU;gBAC7B,GAAG;gBACH,8EAA8E;gBAC9E,OAAO,EAAE,GAAG;aACb,CAAC,CAAC;YACH,OAAO,SAAS,CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC"}
package/dist/src/flags.js CHANGED
@@ -1,4 +1,4 @@
1
- import { cryptoFetch } from '@adonis-agora/crypto-client';
1
+ import { cryptoFetch } from '@adonis-agora/crypto-core';
2
2
  import { cipherFor } from './source.js';
3
3
  /** The key a flags app uses for its event hop by default. */
4
4
  export const FLAGS_EVENTS_KEY = 'flags-events';
@@ -1 +1 @@
1
- {"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAqB,SAAS,EAAE,MAAM,aAAa,CAAC;AAE3D,6DAA6D;AAC7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAc/C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,aAAa,CAAC,OAA6B;IACzD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,gBAAgB,CAAC;IAC5C,OAAO;QACL,KAAK,EAAE,WAAW,CAAC;YACjB,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC;YACjD,GAAG;YACH,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1D,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5E,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACjE,CAAC;KACH,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,kBAAkB,CAAC,OAA6B;IAC9D,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/flags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAqB,SAAS,EAAE,MAAM,aAAa,CAAC;AAE3D,6DAA6D;AAC7D,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAc/C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,aAAa,CAAC,OAA6B;IACzD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,gBAAgB,CAAC;IAC5C,OAAO;QACL,KAAK,EAAE,WAAW,CAAC;YACjB,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC;YACjD,GAAG;YACH,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1D,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5E,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACjE,CAAC;KACH,CAAC;AACJ,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,kBAAkB,CAAC,OAA6B;IAC9D,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC;AACtC,CAAC"}
@@ -8,7 +8,7 @@
8
8
  * - `createFlagsClient({ url, fetch: envelope.fetch })` (or `flagsEnvelope` from `/flags`).
9
9
  */
10
10
  export { type CryptoEnvelopeMiddlewareOptions, type CryptoEnvelopeReplyOptions, type CryptoEnvelopeState, cryptoEnvelopeMiddleware, cryptoEnvelopeReply, serviceCipher, } from '@adonis-agora/crypto';
11
- export { CryptoEnvelopeError, type CryptoEnvelopeErrorCode, type CryptoEnvelopeOptions, cryptoEnvelope, cryptoFetch, ENVELOPE_FIELD, ENVELOPE_HEADER, ENVELOPE_VERSION, type EnvelopeCipher, } from '@adonis-agora/crypto-client';
11
+ export { CryptoEnvelopeError, type CryptoEnvelopeErrorCode, type CryptoEnvelopeOptions, cryptoEnvelope, cryptoFetch, ENVELOPE_FIELD, ENVELOPE_HEADER, ENVELOPE_VERSION, type EnvelopeCipher, } from '@adonis-agora/crypto-core';
12
12
  export { type CipherSource, cipherFor } from './source.js';
13
13
  import { type CipherSource } from './source.js';
14
14
  export interface HttpEnvelopeOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,cAAc,EACd,WAAW,EACX,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,KAAK,cAAc,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,KAAK,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,aAAa,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,YAAY,CAAC;IACrB,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,CAUlF"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EACnB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,cAAc,EACd,WAAW,EACX,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,KAAK,cAAc,GACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,YAAY,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAG3D,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,aAAa,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,YAAY,CAAC;IACrB,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,wCAAwC;IACxC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG;IAAE,KAAK,EAAE,OAAO,KAAK,CAAA;CAAE,CAUlF"}
package/dist/src/http.js CHANGED
@@ -8,9 +8,9 @@
8
8
  * - `createFlagsClient({ url, fetch: envelope.fetch })` (or `flagsEnvelope` from `/flags`).
9
9
  */
10
10
  export { cryptoEnvelopeMiddleware, cryptoEnvelopeReply, serviceCipher, } from '@adonis-agora/crypto';
11
- export { CryptoEnvelopeError, cryptoEnvelope, cryptoFetch, ENVELOPE_FIELD, ENVELOPE_HEADER, ENVELOPE_VERSION, } from '@adonis-agora/crypto-client';
11
+ export { CryptoEnvelopeError, cryptoEnvelope, cryptoFetch, ENVELOPE_FIELD, ENVELOPE_HEADER, ENVELOPE_VERSION, } from '@adonis-agora/crypto-core';
12
12
  export { cipherFor } from './source.js';
13
- import { cryptoFetch } from '@adonis-agora/crypto-client';
13
+ import { cryptoFetch } from '@adonis-agora/crypto-core';
14
14
  import { cipherFor } from './source.js';
15
15
  /**
16
16
  * `{ fetch }`, spreadable into any client that takes one:
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/http.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAIL,wBAAwB,EACxB,mBAAmB,EACnB,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,mBAAmB,EAGnB,cAAc,EACd,WAAW,EACX,cAAc,EACd,eAAe,EACf,gBAAgB,GAEjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAqB,SAAS,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAqB,SAAS,EAAE,MAAM,aAAa,CAAC;AAc3D;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,OAA4B;IACvD,OAAO;QACL,KAAK,EAAE,WAAW,CAAC;YACjB,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC;YAClD,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC1D,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5E,GAAG,CAAC,OAAO,CAAC,KA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 +1,4 @@
1
+ export { SEALED_OPEN_EVENT, type SealedOpenActor, type SealedOpenEvent, type SealedOpenEventInput, sealedOpenChannel, sealedOpenEvent, } from './audit.js';
1
2
  export { type ControlPlaneLike, type DurableEncryptionOptions, encryptedControlPlane, encryptedTransport, type TransportLike, } from './durable.js';
2
3
  export { ROOT_KEYS } from './keys.js';
3
4
  export { type KmsCheckOptions, type KmsIntegrationOptions, kmsDoctorCheck, kmsFor, } from './kms.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,cAAc,EACd,MAAM,GACP,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,aAAa,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,cAAc,EACd,MAAM,GACP,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { SEALED_OPEN_EVENT, sealedOpenChannel, sealedOpenEvent, } from './audit.js';
1
2
  export { encryptedControlPlane, encryptedTransport, } from './durable.js';
2
3
  export { ROOT_KEYS } from './keys.js';
3
4
  export { kmsDoctorCheck, kmsFor, } from './kms.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAGL,cAAc,EACd,MAAM,GACP,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,YAAY,EAIZ,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAkC,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAIjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EAGL,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAGL,cAAc,EACd,MAAM,GACP,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,YAAY,EAIZ,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAkC,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
package/dist/src/kms.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AgoraDoctorCheck } from '@adonis-agora/crypto';
2
- import { type KmsAdapterLike } from '@adonis-agora/crypto-client';
2
+ import { type KmsAdapterLike } from '@adonis-agora/crypto-core';
3
3
  import { type CipherSource } from './source.js';
4
4
  /** Options every KMS integration shares: where the keys live, and which key is the root. */
5
5
  export interface KmsIntegrationOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"kms.d.ts","sourceRoot":"","sources":["../../src/kms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,aAAa,CAAC;AAE3D,4FAA4F;AAC5F,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,YAAY,CAAC;IACrB,8FAA8F;IAC9F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAMlF;AAED,MAAM,WAAW,eAAgB,SAAQ,qBAAqB;IAC5D,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAiFzE"}
1
+ {"version":3,"file":"kms.d.ts","sourceRoot":"","sources":["../../src/kms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,aAAa,CAAC;AAE3D,4FAA4F;AAC5F,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,YAAY,CAAC;IACrB,8FAA8F;IAC9F,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,qBAAqB,GAAG,cAAc,CAMlF;AAED,MAAM,WAAW,eAAgB,SAAQ,qBAAqB;IAC5D,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,eAAe,GAAG,gBAAgB,CAiFzE"}
package/dist/src/kms.js CHANGED
@@ -1,4 +1,4 @@
1
- import { cryptoServerKms } from '@adonis-agora/crypto-client';
1
+ import { cryptoServerKms } from '@adonis-agora/crypto-core';
2
2
  import { cipherFor } from './source.js';
3
3
  /**
4
4
  * The crypto-kit `KmsAdapter` backed by the crypto server, under one key. Every value the lib seals
@@ -1 +1 @@
1
- {"version":3,"file":"kms.js","sourceRoot":"","sources":["../../src/kms.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAuB,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAqB,SAAS,EAAE,MAAM,aAAa,CAAC;AAc3D;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,GAAW,EAAE,OAA8B;IAChE,OAAO,eAAe,CAAC;QACrB,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE,OA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I,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;AAChE,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { CryptoService } from '@adonis-agora/crypto';
2
- import type { CryptoClient, EnvelopeCipher } from '@adonis-agora/crypto-client';
2
+ import type { CryptoClient, EnvelopeCipher } from '@adonis-agora/crypto-core';
3
3
  /**
4
4
  * Where the keys live. Both work with every integration:
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAEhF;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,gFAAgF;AAChF,MAAM,MAAM,MAAM,GAAG,cAAc,CAAC;AAEpC,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,SAAgB,GAAG,MAAM,CAG7E;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAI3D"}
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE9E;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GACxB;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,gFAAgF;AAChF,MAAM,MAAM,MAAM,GAAG,cAAc,CAAC;AAEpC,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,KAAK,SAAgB,GAAG,MAAM,CAG7E;AAED,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAI3D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adonis-agora/crypto-integrations",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Seams between @adonis-agora/crypto and the other Agora libs — KMS roots for authkit, agent and config, encrypted durable transport/control-plane, envelope fetch for flags and any service-to-service call. Kept at 0.x so the rc libs stay untouched.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -67,9 +67,8 @@
67
67
  "CHANGELOG.md"
68
68
  ],
69
69
  "dependencies": {
70
- "@adonis-agora/crypto": "^0.3.0",
71
- "@adonis-agora/crypto-client": "^0.2.0",
72
- "@adonis-agora/crypto-core": "^0.1.0"
70
+ "@adonis-agora/crypto": "^0.5.0",
71
+ "@adonis-agora/crypto-core": "^0.3.0"
73
72
  },
74
73
  "peerDependencies": {
75
74
  "@adonis-agora/durable": ">=1.0.0-rc.0 <2.0.0"