@coffre/vault 0.10.0 → 0.10.2

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.
@@ -1,4 +1,4 @@
1
- import { a as KekUnavailableError, c as awsKms, d as Kek, f as VaultConfig, i as KekProvider, l as checkpointMessage, n as AwsKmsOptions, o as SecretContext, p as derivedSigningKey, r as KekBadClaimError, s as WrappedDek, t as AwsCredentials, u as verifyCheckpoint } from "./index-CByXzyi-.js";
1
+ import { a as KekUnavailableError, c as awsKms, d as Kek, f as VaultConfig, i as KekProvider, l as checkpointMessage, n as AwsKmsOptions, o as SecretContext, p as derivedSigningKey, r as KekBadClaimError, s as WrappedDek, t as AwsCredentials, u as verifyCheckpoint } from "./index-zkW6DEm9.js";
2
2
  import { AdmitInput, ChangePolicyInput, EndReferencesInput, ReferenceInput, RemoveInput, RewrapInput, SetAccessInput, SetSettingsInput, UnwrapInput, Vault, VerifyLogInput, WrapInput } from "@coffre/core/vault";
3
3
  import { PostgresDatabase, PostgresDatabase as PostgresDatabase$1, postgres } from "@coffre/db/hyperdrive";
4
4
  import { WorkerEntrypoint } from "cloudflare:workers";
@@ -48,6 +48,7 @@ export declare class VaultEntrypoint extends WorkerEntrypoint implements Vault {
48
48
  }>>;
49
49
  checkpoint(): Promise<import("@coffre/core/vault").Outcome<{
50
50
  checkpoint: import("@coffre/core/vault").Checkpoint;
51
+ warning?: string;
51
52
  }>>;
52
53
  about(): Promise<{
53
54
  checkpointKeys: Record<string, import("@coffre/core/vault").CheckpointKey>;
@@ -1,5 +1,5 @@
1
- import { a as verifyCheckpoint, i as checkpointMessage, n as KekUnavailableError, o as derivedSigningKey, r as awsKms, s as resolveVaultConfig, t as KekBadClaimError } from "./src-D82jyprb.js";
2
- import { n as prepareVault, t as openVault } from "./vault-COqZ12ny.js";
1
+ import { a as verifyCheckpoint, i as checkpointMessage, n as KekUnavailableError, o as derivedSigningKey, r as awsKms, s as resolveVaultConfig, t as KekBadClaimError } from "./src-B0d-W-SI.js";
2
+ import { n as prepareVault, t as openVault } from "./vault-66Xf0Hw1.js";
3
3
  import { createDatabase } from "@coffre/db";
4
4
  import { HyperdrivePool, postgres } from "@coffre/db/hyperdrive";
5
5
  import { WorkerEntrypoint } from "cloudflare:workers";
@@ -36,7 +36,7 @@ type VaultConfig = {
36
36
  * service holds the KEK, as AWS KMS does: the vault never sees that key.
37
37
  */
38
38
  signingKey?: string;
39
- /** At most `count` data keys unwrapped per principal in any `windowMinutes`; 1000 in 15 unless set. */
39
+ /** At most `count` distinct data keys unwrapped per principal in any `windowMinutes`; 1000 in 15 unless set. */
40
40
  bulkLimit?: {
41
41
  count: number;
42
42
  windowMinutes: number;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { a as KekUnavailableError, c as awsKms, d as Kek, f as VaultConfig, i as KekProvider, l as checkpointMessage, n as AwsKmsOptions, o as SecretContext, p as derivedSigningKey, r as KekBadClaimError, s as WrappedDek, t as AwsCredentials, u as verifyCheckpoint } from "./index-CByXzyi-.js";
1
+ import { a as KekUnavailableError, c as awsKms, d as Kek, f as VaultConfig, i as KekProvider, l as checkpointMessage, n as AwsKmsOptions, o as SecretContext, p as derivedSigningKey, r as KekBadClaimError, s as WrappedDek, t as AwsCredentials, u as verifyCheckpoint } from "./index-zkW6DEm9.js";
2
2
  export type * from "@coffre/core/vault";
3
3
  export { type AwsCredentials, type AwsKmsOptions, type Kek, KekBadClaimError, type KekProvider, KekUnavailableError, type SecretContext, type VaultConfig, type WrappedDek, awsKms, checkpointMessage, derivedSigningKey, verifyCheckpoint };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as verifyCheckpoint, i as checkpointMessage, n as KekUnavailableError, o as derivedSigningKey, r as awsKms, t as KekBadClaimError } from "./src-D82jyprb.js";
1
+ import { a as verifyCheckpoint, i as checkpointMessage, n as KekUnavailableError, o as derivedSigningKey, r as awsKms, t as KekBadClaimError } from "./src-B0d-W-SI.js";
2
2
  export { KekBadClaimError, KekUnavailableError, awsKms, checkpointMessage, derivedSigningKey, verifyCheckpoint };
package/dist/node.d.ts CHANGED
@@ -1,7 +1,10 @@
1
- import { a as KekUnavailableError, c as awsKms, d as Kek, f as VaultConfig, i as KekProvider, l as checkpointMessage, n as AwsKmsOptions, o as SecretContext, p as derivedSigningKey, r as KekBadClaimError, s as WrappedDek, t as AwsCredentials, u as verifyCheckpoint } from "./index-CByXzyi-.js";
1
+ import { a as KekUnavailableError, c as awsKms, d as Kek, f as VaultConfig, i as KekProvider, l as checkpointMessage, n as AwsKmsOptions, o as SecretContext, p as derivedSigningKey, r as KekBadClaimError, s as WrappedDek, t as AwsCredentials, u as verifyCheckpoint } from "./index-zkW6DEm9.js";
2
2
  import { Vault, Vault as Vault$1 } from "@coffre/core/vault";
3
3
  import { Database } from "@coffre/db";
4
+ import "@coffre/core/access";
4
5
  import "@coffre/core/audit";
6
+ import "@coffre/db/grants";
7
+ import "@coffre/db/log";
5
8
  export * from "@coffre/core/vault";
6
9
  //#region src/vault.d.ts
7
10
  type VaultOptions = {
@@ -12,6 +15,14 @@ type VaultOptions = {
12
15
  keyBudgetMs?: number;
13
16
  /** Milliseconds added to the database's clock where the vault decides by it. Tests move time with it. */
14
17
  clockOffset?: () => number;
18
+ /** How far one call walks the log (`WALKS`); tests shorten them. */
19
+ walks?: Partial<Walks>;
20
+ };
21
+ /** How far one call walks the log, in entries: a checkpoint's walk from the last, its rehash of the past, and a verification's own walk. */
22
+ type Walks = {
23
+ checkpoint: number;
24
+ scrub: number;
25
+ verify: number;
15
26
  };
16
27
  //#endregion
17
28
  //#region src/local.d.ts
package/dist/node.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as verifyCheckpoint, i as checkpointMessage, n as KekUnavailableError, o as derivedSigningKey, r as awsKms, s as resolveVaultConfig, t as KekBadClaimError } from "./src-D82jyprb.js";
2
- import { n as prepareVault, t as openVault } from "./vault-COqZ12ny.js";
1
+ import { a as verifyCheckpoint, i as checkpointMessage, n as KekUnavailableError, o as derivedSigningKey, r as awsKms, s as resolveVaultConfig, t as KekBadClaimError } from "./src-B0d-W-SI.js";
2
+ import { n as prepareVault, t as openVault } from "./vault-66Xf0Hw1.js";
3
3
  import { chmodSync, existsSync, lstatSync, rmSync } from "node:fs";
4
4
  import { Agent, createServer, request } from "node:http";
5
5
  import { openDatabase } from "@coffre/db/connect";
@@ -3,9 +3,10 @@ import { KekBadClaimError as KekBadClaimError$1, KekRegistry, KekUnavailableErro
3
3
  import { hkdfSync } from "node:crypto";
4
4
  //#region src/config.ts
5
5
  /**
6
- * 1000 keys in 15 minutes: twenty `coffre run`s of a 50-key environment
7
- * back to back, which no person or deploy pipeline does, while a script
8
- * pulling every secret it can reach stops within a few seconds.
6
+ * 1000 different keys in 15 minutes, which no person or deploy pipeline
7
+ * reads, while a script pulling every secret it can reach stops within a
8
+ * few seconds. A key read again counts once: a 50-key `coffre run` is 50
9
+ * however often it runs.
9
10
  */
10
11
  const DEFAULT_BULK_LIMIT = {
11
12
  count: 1e3,