wallaby-cash 3.18.0 → 3.19.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/README.md +18 -4
- package/dist/base.d.ts +5 -0
- package/dist/index.cjs +11 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -11
- package/dist/index.mjs.map +1 -1
- package/dist/lib/attestation/attestation.service.d.ts +27 -14
- package/dist/lib/attestation/errors.d.ts +1 -1
- package/dist/lib/attestation/index.d.ts +3 -2
- package/dist/lib/attestation/pcr-allowlist.d.ts +25 -0
- package/dist/lib/attestation/verify.d.ts +12 -4
- package/dist/lib/enclave/constants.d.ts +21 -0
- package/dist/lib/enclave/errors.d.ts +32 -0
- package/dist/lib/enclave/index.d.ts +7 -0
- package/dist/lib/enclave/manifest.d.ts +70 -0
- package/dist/lib/enclave/spki.d.ts +10 -0
- package/dist/lib/enclave/verify.d.ts +15 -0
- package/dist/lib/utils/cipher.service.d.ts +19 -1
- package/dist/lib/wallet/wallet-handlers.service.d.ts +23 -3
- package/dist/package.json +4 -13
- package/dist/types/attestation.d.ts +10 -8
- package/package.json +4 -13
- package/dist/lib/attestation/pinned-measurements.d.ts +0 -42
package/README.md
CHANGED
|
@@ -183,9 +183,11 @@ still in progress.
|
|
|
183
183
|
## Enclave attestation verification (opt-in)
|
|
184
184
|
|
|
185
185
|
> **Opt-in and not yet load-bearing.** This is off by default, so existing integrations see no
|
|
186
|
-
> behavior change. Its presence is **not** the attestation guarantee having landed: the
|
|
187
|
-
>
|
|
188
|
-
>
|
|
186
|
+
> behavior change. Its presence is **not** the attestation guarantee having landed: the production
|
|
187
|
+
> manifest-signing keys (until they are embedded, a production SDK fails closed with an
|
|
188
|
+
> `EnclaveManifestError` whose `reason` is `keys-not-configured`) and the binding between the attested
|
|
189
|
+
> identity and the keys seed material is encrypted to are still being rolled out. Don't treat enabling
|
|
190
|
+
> it as a security boundary yet.
|
|
189
191
|
|
|
190
192
|
`options.attestationVerification` makes the SDK verify the enclave's image **before** it decrypts
|
|
191
193
|
and re-encrypts any seed material for transport to it:
|
|
@@ -203,7 +205,19 @@ const wallaby = new Wallaby({
|
|
|
203
205
|
|
|
204
206
|
On each guarded request the SDK fetches a fresh attestation document (a new CSPRNG nonce per call,
|
|
205
207
|
verified on echo) and runs the five checks: decode, certificate chain to the pinned AWS Nitro root,
|
|
206
|
-
ES384 signature, PCR0/1/2 triple against the
|
|
208
|
+
ES384 signature, PCR0/1/2 triple against the enclave manifest's permitted builds, and nonce.
|
|
209
|
+
|
|
210
|
+
The permitted PCR triples are not baked into the SDK. They come from a signed manifest fetched from
|
|
211
|
+
a hardcoded endpoint (`https://enclave-manifest.wallaby.cash/manifest.json`, or the `dev-` host unless
|
|
212
|
+
`options.environment` is `'production'`) shaped `{ payload, signatures }`. The SDK base64-decodes the
|
|
213
|
+
payload, verifies a secp256k1 signature over `sha256(payload)` against the trusted keys embedded in the
|
|
214
|
+
SDK, and only then reads its `builds`. Any failure raises an `EnclaveManifestError` (fail closed). You can
|
|
215
|
+
read the verified PCRs yourself with `getEnclavePcrs({ isProduction })`.
|
|
216
|
+
|
|
217
|
+
The same service is public as `wallaby.attestation`, for callers that want to verify on demand rather than
|
|
218
|
+
gate requests: `await wallaby.attestation.verify()` fetches an attestation document (fresh nonce) and the
|
|
219
|
+
signed manifest, runs all five checks, and returns `{ verified: true, documentInfo }` — the decoded, verified
|
|
220
|
+
attestation document, including its PCRs and the enclave identity public key — or throws as below.
|
|
207
221
|
|
|
208
222
|
In `'throw'` mode a failed check is raised as the matching `AttestationVerificationError` subclass
|
|
209
223
|
(`AttestationDecodeError`, `AttestationChainError`, `AttestationSignatureError`, `AttestationPcrError`,
|
package/dist/base.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ export declare abstract class Base {
|
|
|
31
31
|
*/
|
|
32
32
|
get deviceLocalStorage(): LocalStorage;
|
|
33
33
|
get attestationVerificationMode(): import("./types").AttestationVerificationMode;
|
|
34
|
+
/**
|
|
35
|
+
* Whether the SDK is configured for production (`options.environment`, defaulting to `NODE_ENV`, is `'production'`).
|
|
36
|
+
* Selects which signed enclave manifest — and which trusted signing keys — apply.
|
|
37
|
+
*/
|
|
38
|
+
protected get isProductionEnvironment(): boolean;
|
|
34
39
|
private get validationMode();
|
|
35
40
|
/**
|
|
36
41
|
* @private
|