@coffre/vault 0.2.0 → 0.4.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/dist/cloudflare.d.ts +7 -1
- package/dist/cloudflare.js +7 -1
- package/dist/node.js +3 -1
- package/dist/{vault-BexBMpZL.js → vault-CeKwkzSV.js} +551 -104
- package/package.json +4 -4
- package/src/cloudflare.ts +4 -0
- package/src/local.ts +2 -0
- package/src/replay.ts +19 -5
- package/src/rows.ts +9 -3
- package/src/store.ts +136 -43
- package/src/vault.ts +435 -52
package/dist/cloudflare.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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-CGVAd1mz.js";
|
|
2
|
-
import { AdmitInput, RemoveInput, RewrapInput, SetAccessInput, UnwrapInput, Vault, VerifyLogInput, WrapInput } from "@coffre/core/vault";
|
|
2
|
+
import { AdmitInput, EndReferencesInput, ReferenceInput, RemoveInput, RewrapInput, SetAccessInput, 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";
|
|
5
5
|
export * from "@coffre/core/vault";
|
|
@@ -27,6 +27,12 @@ export declare class VaultEntrypoint extends WorkerEntrypoint implements Vault {
|
|
|
27
27
|
wrapped: import("@coffre/core/vault").WrappedKey[];
|
|
28
28
|
seqs: number[];
|
|
29
29
|
}>>;
|
|
30
|
+
reference(input: ReferenceInput): Promise<import("@coffre/core/vault").Outcome<{
|
|
31
|
+
seqs: number[];
|
|
32
|
+
}>>;
|
|
33
|
+
endReferences(input: EndReferencesInput): Promise<import("@coffre/core/vault").Outcome<{
|
|
34
|
+
seqs: number[];
|
|
35
|
+
}>>;
|
|
30
36
|
access(principal: string): Promise<import("@coffre/core/vault").Access>;
|
|
31
37
|
setAccess(input: SetAccessInput): Promise<import("@coffre/core/vault").Outcome<{
|
|
32
38
|
changes: import("@coffre/core/vault").AccessChange[];
|
package/dist/cloudflare.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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-1yVV2L0_.js";
|
|
2
|
-
import { n as prepareVault, t as openVault } from "./vault-
|
|
2
|
+
import { n as prepareVault, t as openVault } from "./vault-CeKwkzSV.js";
|
|
3
3
|
import { createDatabase } from "@coffre/db";
|
|
4
4
|
import { HyperdrivePool, postgres } from "@coffre/db/hyperdrive";
|
|
5
5
|
import { WorkerEntrypoint } from "cloudflare:workers";
|
|
@@ -52,6 +52,12 @@ var VaultEntrypoint = class extends WorkerEntrypoint {
|
|
|
52
52
|
async rewrap(input) {
|
|
53
53
|
return this.#call((vault) => vault.rewrap(input));
|
|
54
54
|
}
|
|
55
|
+
async reference(input) {
|
|
56
|
+
return this.#call((vault) => vault.reference(input));
|
|
57
|
+
}
|
|
58
|
+
async endReferences(input) {
|
|
59
|
+
return this.#call((vault) => vault.endReferences(input));
|
|
60
|
+
}
|
|
55
61
|
async access(principal) {
|
|
56
62
|
return this.#call((vault) => vault.access(principal));
|
|
57
63
|
}
|
package/dist/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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-1yVV2L0_.js";
|
|
2
|
-
import { n as prepareVault, t as openVault } from "./vault-
|
|
2
|
+
import { n as prepareVault, t as openVault } from "./vault-CeKwkzSV.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";
|
|
@@ -9,6 +9,8 @@ const METHODS = [
|
|
|
9
9
|
"unwrap",
|
|
10
10
|
"wrap",
|
|
11
11
|
"rewrap",
|
|
12
|
+
"reference",
|
|
13
|
+
"endReferences",
|
|
12
14
|
"access",
|
|
13
15
|
"setAccess",
|
|
14
16
|
"admit",
|