Compare commits

15 Commits

Author SHA1 Message Date
88510a3ff5 Add TODO.md
Some checks failed
check / check (push) Failing after 5s
2026-07-06 20:35:46 +02:00
6c26e3ccb7 Merge: skip deleted-collection tombstones in listCollections 2026-06-10 11:49:48 -07:00
d0b4ee979e Green: filter isDeleted tombstones out of listCollections 2026-06-10 11:49:45 -07:00
cb9ac29cb4 Red: listCollections must drop deleted-collection tombstones
/collections/v2 is a sync API: deleted collections remain in the
response forever with isDeleted: true, and their /collections/v2/diff
endpoint returns HTTP 404. A long-lived account accumulates hundreds
of tombstones, so any caller that iterates listCollections() output
(backup, backup-metadata) dies on the first one.
2026-06-10 11:49:11 -07:00
6a9e41a2ee Merge: decrypt collections shared by other users (sealed-box keys) 2026-06-10 11:46:54 -07:00
15d2effc2d Green: unseal shared collection keys with the account keypair
decryptCollection now takes the full key material {masterKey,
publicKey, secretKey} and dispatches on keyDecryptionNonce: present
means an owned collection (secretbox under the master key), absent
means a shared collection (sealed box to our public key). Client
already held the keypair for unsealing the auth token, so it just
passes it through.
2026-06-10 11:46:51 -07:00
59e0aa7d47 Red: shared collections arrive as sealed boxes with no keyDecryptionNonce
Collections shared with the account are not encrypted with the master
key: the sharer only knows the recipient's public key, so the server
delivers encryptedKey as crypto_box_seal to that key and omits
keyDecryptionNonce entirely. decryptCollection assumed the owned-only
wire format and crashed on fromBase64(undefined) for any account with
an incoming shared album, taking down listCollections and every
command built on it (backup, backup-metadata, ...).

The previous "shared" fixture was unfaithful (secretbox + nonce with a
foreign ownerID, a shape the server never sends), which is why the
suite stayed green. These tests model the real wire format and change
decryptCollection to take the full key material {masterKey, publicKey,
secretKey} so it can unseal shared collection keys.
2026-06-10 11:41:36 -07:00
b86ac2cd20 Merge: fix dual-2FA login against real server (empty-string fields) 2026-06-10 11:26:18 -07:00
68d8cfb7fe Green: treat empty-string 2FA session fields as absent
Use || instead of ?? when picking the TOTP session ID. The server
sends "" for unset 2FA fields (no omitempty), and "" ?? v2
short-circuits to "", which made dual-2FA accounts fall through to
the unsupported passkey branch.
2026-06-10 11:26:15 -07:00
2c51074294 Red: mock server must serialize empty 2FA fields like Go does
The museum server's EmailAuthorizationResponse declares
passkeySessionID, accountsUrl, twoFactorSessionID, and
twoFactorSessionIDV2 without `omitempty`, so Go always sends them,
as "" when unset. The previous mock omitted the unset fields
entirely, which let the ?? -based dispatch pass in tests while the
real server's "" defeated it and dual-2FA logins fell through to
the unsupported passkey branch.
2026-06-10 11:25:25 -07:00
0d0dcf5987 Merge: TOTP login for accounts that also have passkeys
The server signals dual-2FA accounts with passkeySessionID +
twoFactorSessionIDV2. quak now takes the TOTP path in that case
instead of failing with 'Passkey authentication is not supported'.
2026-06-10 11:05:39 -07:00
9fd7b6a857 Green: prefer TOTP via twoFactorSessionIDV2 when passkey also enrolled
beginLogin now checks twoFactorSessionID ?? twoFactorSessionIDV2 before
the passkey branch. Accounts with both passkeys and TOTP can now log in
from the CLI using their authenticator app.
2026-06-10 11:05:36 -07:00
0024631ef3 Red: test TOTP preference when account has both passkey and TOTP
When an account has both passkeys and TOTP enrolled, the Ente server
returns passkeySessionID + twoFactorSessionIDV2 (deliberately not the
V1 twoFactorSessionID field, so old clients keep using passkeys).
quak only checked the V1 field, saw the passkey session, and threw
'Passkey authentication is not supported'. A CLI cannot do WebAuthn,
so it must take the TOTP path via the V2 session ID.
2026-06-10 11:04:49 -07:00
3d76bd092f Use @inquirer/prompts for interactive login input
Replaces the hand-rolled readline/raw-mode password prompt with
@inquirer/prompts (input + password). The manual approach broke in
bun-compiled binaries because bun doesn't properly re-open stdin
after closing a readline instance. inquirer handles TTY, raw mode,
and password masking correctly across both node and bun runtimes.
2026-06-10 10:54:17 -07:00
3d6742945b Add make install: copies compiled binary to ~/bin 2026-06-10 10:45:59 -07:00
16 changed files with 603 additions and 109 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: test lint fmt fmt-check check build build-bin dev clean docker hooks .PHONY: test lint fmt fmt-check check build build-bin install dev clean docker hooks
# Use `timeout` (GNU coreutils) when available so `make test` is hard-capped. # Use `timeout` (GNU coreutils) when available so `make test` is hard-capped.
# On macOS without coreutils this is empty and the cap is skipped. # On macOS without coreutils this is empty and the cap is skipped.
@@ -29,6 +29,11 @@ build:
build-bin: build-bin:
nix-shell -p bun --run "bun build bin/quak.ts --compile --outfile bin/quak" nix-shell -p bun --run "bun build bin/quak.ts --compile --outfile bin/quak"
install: build-bin
mkdir -p ~/bin
cp bin/quak ~/bin/quak
chmod +x ~/bin/quak
dev: dev:
@$(YARN) tsc --watch @$(YARN) tsc --watch

44
TODO.md Normal file
View File

@@ -0,0 +1,44 @@
# Status
pre-1.0
# Next Step
Implement the download retry policy from the README TODO: no retry on 4xx,
exponential backoff on 5xx and network errors. Apply it to file and
thumbnail downloads, cover it with mock-server tests, and update the
README TODO checkbox.
# Completed Steps
- 2026-06-10: Decrypted collections shared by other users (sealed-box
keys); listCollections drops deleted-collection tombstones.
- 2026-06-10: Login hardening: dual-2FA empty-string fields handled, TOTP
preferred when a passkey is also enrolled, interactive input via
@inquirer/prompts.
- 2026-06-10: Replaced sharp with pure JS (jpeg-js + exif-reader); added
single-binary bun build and make install.
- 2026-06-09: Added backup-metadata command (ML data always included,
--exif opt-in); rewrote README to match the implementation; added
thumbnail helper tests.
- 2026-05-13: Full CLI surface: login, backup with dedup symlink layout,
collections, files, get, get-thumb, thumbnail repair helpers.
- 2026-05-13: Client OO API with literate usage tests; file download and
decryption; all three metadata layers decrypted and persisted; renamed
quack to quak.
- 2026-05-11: SRP login flow (email OTP + TOTP) and ApiClient.
# Future Steps
- Retry policy: no retry on 4xx, exponential backoff on 5xx and network
errors (the Next Step).
- Update the README API reference section to match the current
implementation.
- Make `make docker` green.
- Tag v1.0.0.
- Future desktop client, separate repo:
- Electron app skeleton consuming this library.
- Local SQLite cache keyed on (collectionID, fileID, updationTime).
- Background sync worker streaming new files into the cache.
- Gallery UI: thumbnails, full-image view, basic search.
- Upload, delete, and share operations in the library.

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env node #!/usr/bin/env node
import { createInterface } from "node:readline/promises"; import { input, password as passwordPrompt } from "@inquirer/prompts";
import { stdin, stdout, stderr } from "node:process"; import { stdout, stderr } from "node:process";
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"; import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { join } from "node:path"; import { join } from "node:path";
import { Command } from "commander"; import { Command } from "commander";
@@ -45,46 +45,10 @@ const requireSession = (): Client => {
return Client.fromJSON(snapshot); return Client.fromJSON(snapshot);
}; };
const prompt = async (message: string): Promise<string> => { const prompt = async (message: string): Promise<string> => input({ message });
const rl = createInterface({ input: stdin, output: stderr });
const answer = await rl.question(message);
rl.close();
return answer;
};
const promptPassword = async (message: string): Promise<string> => { const promptSecret = async (message: string): Promise<string> =>
if (!stdin.isTTY) { passwordPrompt({ message, mask: true });
return prompt(message);
}
stderr.write(message);
stdin.setRawMode(true);
stdin.resume();
const chars: string[] = [];
return new Promise((resolve) => {
const onData = (buf: Buffer) => {
for (const byte of buf) {
if (byte === 3) {
stdin.setRawMode(false);
process.exit(130);
}
if (byte === 13 || byte === 10) {
stdin.setRawMode(false);
stdin.removeListener("data", onData);
stdin.pause();
stderr.write("\n");
resolve(chars.join(""));
return;
}
if (byte === 127 || byte === 8) {
chars.pop();
} else {
chars.push(String.fromCharCode(byte));
}
}
};
stdin.on("data", onData);
});
};
const program = new Command(); const program = new Command();
@@ -98,18 +62,9 @@ program
.description("Log in to an Ente account and save the session") .description("Log in to an Ente account and save the session")
.action(async () => { .action(async () => {
await init(); await init();
const email = const email = process.env.QUAK_EMAIL ?? (await prompt("Email"));
process.env.QUAK_EMAIL ??
(stdin.isTTY ? await prompt("Email: ") : null);
const password = const password =
process.env.QUAK_PASSWORD ?? process.env.QUAK_PASSWORD ?? (await promptSecret("Password"));
(stdin.isTTY ? await promptPassword("Password: ") : null);
if (!email || !password) {
stderr.write(
"Set QUAK_EMAIL and QUAK_PASSWORD env vars for non-interactive use.\n",
);
process.exit(1);
}
stderr.write("Authenticating...\n"); stderr.write("Authenticating...\n");
try { try {

View File

@@ -38,6 +38,7 @@
"vitest": "2.1.9" "vitest": "2.1.9"
}, },
"dependencies": { "dependencies": {
"@inquirer/prompts": "8.5.2",
"commander": "14.0.3", "commander": "14.0.3",
"env-paths": "4.0.0", "env-paths": "4.0.0",
"exif-reader": "2.0.3", "exif-reader": "2.0.3",

View File

@@ -73,8 +73,18 @@ const srpHandshake = async (
srpClient.checkM2(Buffer.from(verifyResponse.srpM2, "base64")); srpClient.checkM2(Buffer.from(verifyResponse.srpM2, "base64"));
if (verifyResponse.twoFactorSessionID) { // twoFactorSessionIDV2 is set (instead of twoFactorSessionID) when the
return { kind: "totp", sessionID: verifyResponse.twoFactorSessionID }; // account has BOTH passkeys and TOTP. Prefer TOTP: a CLI cannot perform
// a WebAuthn ceremony, and the user has a TOTP secret enrolled.
//
// The server marshals these fields without `omitempty`, so unset fields
// arrive as "" rather than being absent. Use || (not ??) so empty
// strings are treated as not-set.
const totpSessionID =
verifyResponse.twoFactorSessionID ||
verifyResponse.twoFactorSessionIDV2;
if (totpSessionID) {
return { kind: "totp", sessionID: totpSessionID };
} }
if (verifyResponse.passkeySessionID) { if (verifyResponse.passkeySessionID) {
return { return {

View File

@@ -34,13 +34,18 @@ export interface SRPAttributes {
// The body of a successful login response. Exactly one of the following // The body of a successful login response. Exactly one of the following
// situations applies, and the caller dispatches on the populated fields: // situations applies, and the caller dispatches on the populated fields:
// - both keyAttributes and encryptedToken present: login is complete // - both keyAttributes and encryptedToken present: login is complete
// - twoFactorSessionID present: caller must submit a TOTP code // - twoFactorSessionID present: caller must submit a TOTP code (TOTP-only
// - passkeySessionID present: caller must complete a passkey ceremony // account)
// - passkeySessionID + twoFactorSessionIDV2 present: account has both
// passkeys and TOTP; the V2 field is set instead of twoFactorSessionID
// so that older clients keep using the passkey flow
// - only passkeySessionID present: caller must complete a passkey ceremony
export interface AuthorizationResponse { export interface AuthorizationResponse {
id: number; id: number;
keyAttributes?: KeyAttributes; keyAttributes?: KeyAttributes;
encryptedToken?: Base64; encryptedToken?: Base64;
twoFactorSessionID?: string; twoFactorSessionID?: string;
twoFactorSessionIDV2?: string;
passkeySessionID?: string; passkeySessionID?: string;
} }

View File

@@ -155,9 +155,21 @@ export class Client {
const { collections } = await this.api.getJSON<{ const { collections } = await this.api.getJSON<{
collections: RawCollection[]; collections: RawCollection[];
}>("/collections/v2", { sinceTime: 0 }); }>("/collections/v2", { sinceTime: 0 });
return collections.map((raw) => // The sync API keeps returning deleted collections as tombstones
decryptCollection(raw, this.masterKey, this.userID), // (isDeleted: true); their diff endpoint 404s, so drop them.
); return collections
.filter((raw) => !raw.isDeleted)
.map((raw) =>
decryptCollection(
raw,
{
masterKey: this.masterKey,
publicKey: this.publicKey,
secretKey: this.secretKey,
},
this.userID,
),
);
} }
async listFiles( async listFiles(

View File

@@ -24,6 +24,7 @@ export type {
FileBlob, FileBlob,
FileMetadata, FileMetadata,
FileType, FileType,
KeyMaterial,
Microseconds, Microseconds,
RawCollection, RawCollection,
RawEnteFile, RawEnteFile,

View File

@@ -1,10 +1,16 @@
import { decryptBlob, decryptBox, fromBase64 } from "../crypto/index.js"; import {
decryptBlob,
decryptBox,
decryptSealed,
fromBase64,
} from "../crypto/index.js";
import type { import type {
Collection, Collection,
CollectionType, CollectionType,
EnteFile, EnteFile,
FileMetadata, FileMetadata,
FileType, FileType,
KeyMaterial,
RawCollection, RawCollection,
RawEnteFile, RawEnteFile,
RawMagicMetadata, RawMagicMetadata,
@@ -30,14 +36,25 @@ const parseFileType = (n: number): FileType => FILE_TYPE_MAP[n] ?? "unknown";
export const decryptCollection = ( export const decryptCollection = (
raw: RawCollection, raw: RawCollection,
masterKey: Uint8Array, keys: KeyMaterial,
currentUserID?: number, currentUserID?: number,
): Collection => { ): Collection => {
const key = decryptBox( // Owned collections carry their key as a secretbox under our master
fromBase64(raw.encryptedKey), // key, with the nonce in keyDecryptionNonce. Collections shared with
fromBase64(raw.keyDecryptionNonce), // us carry it as an anonymous sealed box to our public key and have
masterKey, // no keyDecryptionNonce at all (sealed boxes embed an ephemeral
); // public key instead).
const key = raw.keyDecryptionNonce
? decryptBox(
fromBase64(raw.encryptedKey),
fromBase64(raw.keyDecryptionNonce),
keys.masterKey,
)
: decryptSealed(
fromBase64(raw.encryptedKey),
keys.publicKey,
keys.secretKey,
);
let name = ""; let name = "";
if (raw.encryptedName && raw.nameDecryptionNonce) { if (raw.encryptedName && raw.nameDecryptionNonce) {

View File

@@ -6,6 +6,7 @@ export type {
FileBlob, FileBlob,
FileMetadata, FileMetadata,
FileType, FileType,
KeyMaterial,
Microseconds, Microseconds,
RawCollection, RawCollection,
RawEnteFile, RawEnteFile,

View File

@@ -50,13 +50,25 @@ export interface EnteFile {
updationTime: Microseconds; updationTime: Microseconds;
} }
// The key material a logged-in client holds, everything needed to decrypt
// any collection: the master key (secretbox for owned collection keys) and
// the X25519 keypair (sealed box for collection keys shared with us).
export interface KeyMaterial {
masterKey: Uint8Array;
publicKey: Uint8Array;
secretKey: Uint8Array;
}
// Raw shapes as they arrive from the Ente API, before decryption. // Raw shapes as they arrive from the Ente API, before decryption.
export interface RawCollection { export interface RawCollection {
id: number; id: number;
owner: { id: number }; owner: { id: number };
encryptedKey: string; encryptedKey: string;
keyDecryptionNonce: string; // Absent for collections shared with us: their encryptedKey is a
// sealed box to our public key, which embeds an ephemeral public key
// instead of using a nonce.
keyDecryptionNonce?: string;
encryptedName?: string; encryptedName?: string;
nameDecryptionNonce?: string; nameDecryptionNonce?: string;
type: string; type: string;

View File

@@ -145,7 +145,7 @@ const buildServerFixture = async (password: string) => {
*/ */
const buildMockFetch = ( const buildMockFetch = (
fixture: Awaited<ReturnType<typeof buildServerFixture>>, fixture: Awaited<ReturnType<typeof buildServerFixture>>,
opts?: { requireTOTP?: boolean }, opts?: { requireTOTP?: boolean; requirePasskeyAndTOTP?: boolean },
) => { ) => {
let srpServer: SrpServer; let srpServer: SrpServer;
const sessionID = "test-session-id"; const sessionID = "test-session-id";
@@ -200,11 +200,47 @@ const buildMockFetch = (
srpServer.checkM1(Buffer.from(body.srpM1, "base64")); srpServer.checkM1(Buffer.from(body.srpM1, "base64"));
const M2 = srpServer.computeM2(); const M2 = srpServer.computeM2();
// IMPORTANT: the museum server's EmailAuthorizationResponse
// (server/ente/user.go) declares passkeySessionID, accountsUrl,
// twoFactorSessionID, and twoFactorSessionIDV2 WITHOUT the
// `omitempty` JSON tag. Go therefore always serializes them,
// sending "" (empty string, NOT null/absent) for any that do
// not apply. These mocks must reproduce that faithfully: a
// client that distinguishes fields with `??` instead of `||`
// passes against an omitting mock but breaks against the real
// server.
if (opts?.requireTOTP) { if (opts?.requireTOTP) {
return new Response( return new Response(
JSON.stringify({ JSON.stringify({
id: 42,
srpM2: M2.toString("base64"), srpM2: M2.toString("base64"),
passkeySessionID: "",
accountsUrl: "",
twoFactorSessionID: "totp-session-999", twoFactorSessionID: "totp-session-999",
twoFactorSessionIDV2: "",
}),
{
status: 200,
headers: { "content-type": "application/json" },
},
);
}
if (opts?.requirePasskeyAndTOTP) {
// When the account has BOTH passkeys and TOTP enabled, the
// server sets passkeySessionID + twoFactorSessionIDV2 (not
// twoFactorSessionID -- that's deliberate, so old clients
// that only know the V1 field keep using the passkey flow).
// The V1 field is still present on the wire as "".
return new Response(
JSON.stringify({
id: 42,
srpM2: M2.toString("base64"),
passkeySessionID: "passkey-session-123",
accountsUrl: "https://accounts.ente.io",
twoFactorSessionID: "",
twoFactorSessionIDV2: "totp-session-v2-456",
}), }),
{ {
status: 200, status: 200,
@@ -219,6 +255,10 @@ const buildMockFetch = (
id: 42, id: 42,
keyAttributes: fixture.keyAttributes, keyAttributes: fixture.keyAttributes,
encryptedToken: fixture.encryptedToken, encryptedToken: fixture.encryptedToken,
passkeySessionID: "",
accountsUrl: "",
twoFactorSessionID: "",
twoFactorSessionIDV2: "",
}), }),
{ {
status: 200, status: 200,
@@ -305,6 +345,26 @@ describe("beginLogin via SRP", () => {
} }
}); });
it("prefers TOTP over passkey when the account has both", async () => {
// Accounts with both passkeys and TOTP get passkeySessionID +
// twoFactorSessionIDV2 in the verify-session response. A CLI
// cannot perform a WebAuthn ceremony, so quak must take the TOTP
// path using the V2 session ID. Returning { kind: "passkey" } here
// would make such accounts unusable from the CLI even though they
// have a perfectly good TOTP secret enrolled.
const fixture = await buildServerFixture(TEST_PASSWORD);
const api = new ApiClient({
fetch: buildMockFetch(fixture, { requirePasskeyAndTOTP: true }),
});
const challenge = await beginLogin(api, TEST_EMAIL, TEST_PASSWORD);
expect(challenge.kind).toBe("totp");
if (challenge.kind === "totp") {
expect(challenge.sessionID).toBe("totp-session-v2-456");
}
});
it("rejects a wrong password (SRP M1 verification fails)", async () => { it("rejects a wrong password (SRP M1 verification fails)", async () => {
const fixture = await buildServerFixture(TEST_PASSWORD); const fixture = await buildServerFixture(TEST_PASSWORD);
const api = new ApiClient({ fetch: buildMockFetch(fixture) }); const api = new ApiClient({ fetch: buildMockFetch(fixture) });

View File

@@ -91,6 +91,7 @@ interface ServerState {
thumbHeader: Uint8Array; thumbHeader: Uint8Array;
thumbCiphertext: Uint8Array; thumbCiphertext: Uint8Array;
collectionKey: Uint8Array; collectionKey: Uint8Array;
sharedCollectionKey: Uint8Array;
} }
let server: ServerState; let server: ServerState;
@@ -211,6 +212,69 @@ const buildServer = async (): Promise<ServerState> => {
updationTime: 1700000000000000, updationTime: 1700000000000000,
}; };
// A collection another user shared WITH us. The sharer does not have
// our master key, only our public key, so the real server delivers the
// collection key as an anonymous sealed box (crypto_box_seal) to our
// public key and the response carries NO keyDecryptionNonce. Every
// account with an incoming shared album has one of these in its
// /collections/v2 response, so the mock must include one too.
const sharedCollectionKey = sodium.crypto_secretbox_keygen();
const sealedSharedKey = sodium.crypto_box_seal(
sharedCollectionKey,
kp.publicKey,
);
const sharedNameNonce = sodium.randombytes_buf(
sodium.crypto_secretbox_NONCEBYTES,
);
const encSharedName = sodium.crypto_secretbox_easy(
new TextEncoder().encode("Friend's Wedding"),
sharedNameNonce,
sharedCollectionKey,
);
const rawSharedCollection = {
id: 2,
owner: { id: 99 },
encryptedKey: toBase64(sealedSharedKey),
encryptedName: toBase64(encSharedName),
nameDecryptionNonce: toBase64(sharedNameNonce),
type: "album",
updationTime: 1700000000000000,
};
// A DELETED collection. /collections/v2 is a sync API: deleted
// collections stay in the response forever as tombstones with
// isDeleted: true (a long-lived real account accumulates hundreds).
// Their keys still decrypt, but /collections/v2/diff returns
// HTTP 404 for them, so they must never surface from
// listCollections(); a client that naively iterates them dies on
// the first deleted album.
const deletedKey = sodium.crypto_secretbox_keygen();
const dkNonce = sodium.randombytes_buf(sodium.crypto_secretbox_NONCEBYTES);
const encDeletedKey = sodium.crypto_secretbox_easy(
deletedKey,
dkNonce,
masterKey,
);
const deletedNameNonce = sodium.randombytes_buf(
sodium.crypto_secretbox_NONCEBYTES,
);
const encDeletedName = sodium.crypto_secretbox_easy(
new TextEncoder().encode("Old Album"),
deletedNameNonce,
deletedKey,
);
const rawDeletedCollection = {
id: 3,
owner: { id: 42 },
encryptedKey: toBase64(encDeletedKey),
keyDecryptionNonce: toBase64(dkNonce),
encryptedName: toBase64(encDeletedName),
nameDecryptionNonce: toBase64(deletedNameNonce),
type: "album",
updationTime: 1700000000000000,
isDeleted: true,
};
const rawFile = { const rawFile = {
id: 100, id: 100,
collectionID: 1, collectionID: 1,
@@ -230,6 +294,10 @@ const buildServer = async (): Promise<ServerState> => {
// can return them. This is ugly plumbing; in a real program you // can return them. This is ugly plumbing; in a real program you
// never see any of it. // never see any of it.
(globalThis as Record<string, unknown>).__mockRawCollection = rawCollection; (globalThis as Record<string, unknown>).__mockRawCollection = rawCollection;
(globalThis as Record<string, unknown>).__mockRawSharedCollection =
rawSharedCollection;
(globalThis as Record<string, unknown>).__mockRawDeletedCollection =
rawDeletedCollection;
(globalThis as Record<string, unknown>).__mockRawFile = rawFile; (globalThis as Record<string, unknown>).__mockRawFile = rawFile;
return { return {
@@ -253,6 +321,7 @@ const buildServer = async (): Promise<ServerState> => {
thumbHeader: thumbPush.header, thumbHeader: thumbPush.header,
thumbCiphertext, thumbCiphertext,
collectionKey, collectionKey,
sharedCollectionKey,
}; };
}; };
@@ -303,9 +372,14 @@ const buildMockFetch = (s: ServerState) => {
}); });
} }
if (path === "/collections/v2") { if (path === "/collections/v2") {
const raw = (globalThis as Record<string, unknown>) const g = globalThis as Record<string, unknown>;
.__mockRawCollection; return json({
return json({ collections: [raw] }); collections: [
g.__mockRawCollection,
g.__mockRawSharedCollection,
g.__mockRawDeletedCollection,
],
});
} }
if (path === "/collections/v2/diff") { if (path === "/collections/v2/diff") {
const raw = (globalThis as Record<string, unknown>).__mockRawFile; const raw = (globalThis as Record<string, unknown>).__mockRawFile;
@@ -412,6 +486,10 @@ describe("quak Client usage guide", () => {
* encryption key. `listCollections()` fetches them from the server, * encryption key. `listCollections()` fetches them from the server,
* decrypts the keys and names, and returns typed objects. * decrypts the keys and names, and returns typed objects.
* *
* This works transparently for both kinds of collection: ones you
* own (key encrypted with your master key) and ones shared with you
* (key sealed to your public key, flagged with `isShared: true`).
*
* ```ts * ```ts
* const collections = await client.listCollections(); * const collections = await client.listCollections();
* for (const c of collections) { * for (const c of collections) {
@@ -419,7 +497,7 @@ describe("quak Client usage guide", () => {
* } * }
* ``` * ```
*/ */
it("3. list and decrypt collections", async () => { it("3. list and decrypt collections, owned and shared", async () => {
const client = await Client.login({ const client = await Client.login({
email: TEST_EMAIL, email: TEST_EMAIL,
password: TEST_PASSWORD, password: TEST_PASSWORD,
@@ -428,12 +506,25 @@ describe("quak Client usage guide", () => {
const collections = await client.listCollections(); const collections = await client.listCollections();
expect(collections.length).toBe(1); // The mock server also returns a deleted collection (id 3).
expect(collections[0]!.name).toBe("Vacation"); // Deleted collections are tombstones in the sync protocol: their
expect(collections[0]!.type).toBe("album"); // file diff endpoint 404s, so listCollections must drop them.
expect(collections[0]!.id).toBe(1); expect(collections.length).toBe(2);
expect(collections.find((c) => c.id === 3)).toBeUndefined();
const owned = collections.find((c) => c.id === 1)!;
expect(owned.name).toBe("Vacation");
expect(owned.type).toBe("album");
expect(owned.isShared).toBe(false);
// The decrypted collection key is available for advanced use. // The decrypted collection key is available for advanced use.
expect(collections[0]!.key.length).toBe(32); expect(owned.key.length).toBe(32);
const shared = collections.find((c) => c.id === 2)!;
expect(shared.name).toBe("Friend's Wedding");
expect(shared.isShared).toBe(true);
// The key was unsealed with our keypair; the decrypted name above
// already proves it round-trips, but check it exactly too.
expect(shared.key).toEqual(server.sharedCollectionKey);
}); });
/** /**

View File

@@ -25,7 +25,10 @@ const main = async () => {
process.exit(1); process.exit(1);
} }
const { masterKey, token } = await unwrapAuth(challenge.response, PASSWORD); const { masterKey, secretKey, publicKey, token } = await unwrapAuth(
challenge.response,
PASSWORD,
);
api.setAuthToken(token); api.setAuthToken(token);
console.log("Logged in, user ID:", challenge.response.id); console.log("Logged in, user ID:", challenge.response.id);
@@ -37,7 +40,7 @@ const main = async () => {
const userID = challenge.response.id; const userID = challenge.response.id;
const collections = rawCollections.map((raw) => const collections = rawCollections.map((raw) =>
decryptCollection(raw, masterKey, userID), decryptCollection(raw, { masterKey, publicKey, secretKey }, userID),
); );
console.log(`${collections.length} collection(s):`); console.log(`${collections.length} collection(s):`);

View File

@@ -7,12 +7,27 @@
* *
* ## Collection decryption * ## Collection decryption
* *
* The server stores each collection's encryption key sealed under the * How a collection's key is encrypted depends on who owns it:
* owner's master key (secretbox). The collection's name is then sealed
* under that collection key (also secretbox). `decryptCollection`:
* *
* 1. decryptBox(encryptedKey, keyDecryptionNonce, masterKey) -> collectionKey * OWNED collections (owner == current user): the collection key is a
* 2. decryptBox(encryptedName, nameDecryptionNonce, collectionKey) -> name (UTF-8) * secretbox under the owner's master key, and `keyDecryptionNonce`
* carries the nonce.
*
* SHARED collections (owned by someone else, shared with us): the owner
* does not have our master key, so the server instead carries the
* collection key as an anonymous SEALED BOX (crypto_box_seal) to our
* X25519 public key, and `keyDecryptionNonce` is ABSENT from the wire
* (sealed boxes embed an ephemeral public key instead of a nonce).
*
* `decryptCollection` therefore takes the full key material (master key
* plus keypair) and dispatches on the presence of `keyDecryptionNonce`:
*
* 1a. nonce present: decryptBox(encryptedKey, keyDecryptionNonce,
* masterKey) -> collectionKey
* 1b. nonce absent: decryptSealed(encryptedKey, publicKey, secretKey)
* -> collectionKey
* 2. decryptBox(encryptedName, nameDecryptionNonce, collectionKey)
* -> name (UTF-8)
* 3. Maps the string `type` field to a CollectionType union member * 3. Maps the string `type` field to a CollectionType union member
* 4. Returns a Collection with decrypted key, name, and type * 4. Returns a Collection with decrypted key, name, and type
* *
@@ -38,12 +53,28 @@ import sodium from "libsodium-wrappers-sumo";
import { beforeAll, describe, expect, it } from "vitest"; import { beforeAll, describe, expect, it } from "vitest";
import { init, toBase64 } from "../../src/crypto/index.js"; import { init, toBase64 } from "../../src/crypto/index.js";
import { decryptCollection, decryptFile } from "../../src/model/index.js"; import { decryptCollection, decryptFile } from "../../src/model/index.js";
import type { RawCollection, RawEnteFile } from "../../src/model/index.js"; import type {
KeyMaterial,
RawCollection,
RawEnteFile,
} from "../../src/model/index.js";
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Helpers // Helpers
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// The full set of key material a logged-in client holds: the master key
// (decrypts owned collection keys) and the X25519 keypair (unseals shared
// collection keys and the auth token).
const buildKeys = (): KeyMaterial => {
const kp = sodium.crypto_box_keypair();
return {
masterKey: sodium.crypto_secretbox_keygen(),
publicKey: kp.publicKey,
secretKey: kp.privateKey,
};
};
const secretboxEncrypt = ( const secretboxEncrypt = (
plaintext: Uint8Array, plaintext: Uint8Array,
key: Uint8Array, key: Uint8Array,
@@ -80,6 +111,38 @@ const buildRawCollection = (
return { raw, collectionKey }; return { raw, collectionKey };
}; };
// A collection shared with us by another user. The wire format differs
// from owned collections in two ways, both verified against the live
// api.ente.io: `encryptedKey` is an anonymous sealed box to OUR public
// key (80 bytes for a 32-byte key, vs 48 for a secretbox), and
// `keyDecryptionNonce` is entirely ABSENT from the JSON.
const buildSharedRawCollection = (
recipientPublicKey: Uint8Array,
opts?: { name?: string; ownerID?: number },
): { raw: RawCollection; collectionKey: Uint8Array } => {
const collectionKey = sodium.crypto_secretbox_keygen();
const sealedKey = sodium.crypto_box_seal(collectionKey, recipientPublicKey);
const name = opts?.name ?? "Shared Album";
const { ciphertext: encName, nonce: nameNonce } = secretboxEncrypt(
new TextEncoder().encode(name),
collectionKey,
);
const raw: RawCollection = {
id: 101,
owner: { id: opts?.ownerID ?? 99 },
encryptedKey: toBase64(sealedKey),
// NOTE: no keyDecryptionNonce. Do not "fix" this fixture by adding
// one: its absence is exactly what the real server sends, and an
// unfaithful fixture here previously masked a crash on every
// account with an incoming shared album.
encryptedName: toBase64(encName),
nameDecryptionNonce: toBase64(nameNonce),
type: "album",
updationTime: 1700000000000000,
};
return { raw, collectionKey };
};
const buildRawFile = ( const buildRawFile = (
collectionKey: Uint8Array, collectionKey: Uint8Array,
opts?: { title?: string; fileType?: number; creationTime?: number }, opts?: { title?: string; fileType?: number; creationTime?: number },
@@ -137,13 +200,13 @@ describe("model.decryptCollection", () => {
await sodium.ready; await sodium.ready;
}); });
it("decrypts the collection key and name from a raw server response", () => { it("decrypts an owned collection key and name from a raw server response", () => {
const masterKey = sodium.crypto_secretbox_keygen(); const keys = buildKeys();
const { raw, collectionKey } = buildRawCollection(masterKey, { const { raw, collectionKey } = buildRawCollection(keys.masterKey, {
name: "Summer Photos", name: "Summer Photos",
}); });
const col = decryptCollection(raw, masterKey, 1); const col = decryptCollection(raw, keys, 1);
expect(col.id).toBe(100); expect(col.id).toBe(100);
expect(col.key).toEqual(collectionKey); expect(col.key).toEqual(collectionKey);
@@ -154,49 +217,73 @@ describe("model.decryptCollection", () => {
expect(col.isShared).toBe(false); expect(col.isShared).toBe(false);
}); });
it("sets isShared when owner != current user", () => { it("decrypts a shared collection via sealed box when keyDecryptionNonce is absent", () => {
const masterKey = sodium.crypto_secretbox_keygen(); // A collection shared TO us is not encrypted with our master key:
const { raw } = buildRawCollection(masterKey, { ownerID: 99 }); // the sharer only knows our public key, so the collection key
// arrives as crypto_box_seal(collectionKey, ourPublicKey) and the
// response has NO keyDecryptionNonce. decryptCollection must
// recover the key with the keypair, then decrypt the name with it
// as usual. Accounts with any incoming shared album hit this path
// on every listCollections call.
const keys = buildKeys();
const { raw, collectionKey } = buildSharedRawCollection(
keys.publicKey,
{ name: "Friend's Wedding", ownerID: 99 },
);
const col = decryptCollection(raw, masterKey, 1); const col = decryptCollection(raw, keys, 1);
expect(col.key).toEqual(collectionKey);
expect(col.name).toBe("Friend's Wedding");
expect(col.ownerID).toBe(99);
expect(col.isShared).toBe(true); expect(col.isShared).toBe(true);
}); });
it("maps known type strings to CollectionType", () => { it("maps known type strings to CollectionType", () => {
const masterKey = sodium.crypto_secretbox_keygen(); const keys = buildKeys();
for (const type of ["album", "folder", "favorites", "uncategorized"]) { for (const type of ["album", "folder", "favorites", "uncategorized"]) {
const { raw } = buildRawCollection(masterKey, { type }); const { raw } = buildRawCollection(keys.masterKey, { type });
const col = decryptCollection(raw, masterKey, 1); const col = decryptCollection(raw, keys, 1);
expect(col.type).toBe(type); expect(col.type).toBe(type);
} }
}); });
it("maps unrecognised type strings to 'unknown'", () => { it("maps unrecognised type strings to 'unknown'", () => {
const masterKey = sodium.crypto_secretbox_keygen(); const keys = buildKeys();
const { raw } = buildRawCollection(masterKey, { const { raw } = buildRawCollection(keys.masterKey, {
type: "someFutureType", type: "someFutureType",
}); });
const col = decryptCollection(raw, masterKey, 1); const col = decryptCollection(raw, keys, 1);
expect(col.type).toBe("unknown"); expect(col.type).toBe("unknown");
}); });
it("handles a collection with no encrypted name gracefully", () => { it("handles a collection with no encrypted name gracefully", () => {
// Some special collections (e.g. uncategorized) may have no name. // Some special collections (e.g. uncategorized) may have no name.
const masterKey = sodium.crypto_secretbox_keygen(); const keys = buildKeys();
const { raw } = buildRawCollection(masterKey); const { raw } = buildRawCollection(keys.masterKey);
delete raw.encryptedName; delete raw.encryptedName;
delete raw.nameDecryptionNonce; delete raw.nameDecryptionNonce;
const col = decryptCollection(raw, masterKey, 1); const col = decryptCollection(raw, keys, 1);
expect(col.name).toBe(""); expect(col.name).toBe("");
}); });
it("throws when the master key is wrong", () => { it("throws when the master key is wrong for an owned collection", () => {
const masterKey = sodium.crypto_secretbox_keygen(); const keys = buildKeys();
const wrongKey = sodium.crypto_secretbox_keygen(); const { raw } = buildRawCollection(keys.masterKey);
const { raw } = buildRawCollection(masterKey);
expect(() => decryptCollection(raw, wrongKey, 1)).toThrow(); // buildKeys() generates fresh random key material, so this is a
// client holding the wrong master key.
expect(() => decryptCollection(raw, buildKeys(), 1)).toThrow();
});
it("throws when the keypair is wrong for a shared collection", () => {
const keys = buildKeys();
const { raw } = buildSharedRawCollection(keys.publicKey);
// A different keypair must not be able to unseal the key.
const wrongKeys = buildKeys();
expect(() => decryptCollection(raw, wrongKeys, 1)).toThrow();
}); });
}); });

192
yarn.lock
View File

@@ -223,6 +223,145 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba" resolved "https://registry.yarnpkg.com/@humanwhocodes/retry/-/retry-0.4.3.tgz#c2b9d2e374ee62c586d3adbea87199b1d7a7a6ba"
integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ== integrity sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==
"@inquirer/ansi@^2.0.7":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@inquirer/ansi/-/ansi-2.0.7.tgz#86de22810cac3ed406ec10f8d66016815b8226b4"
integrity sha512-3eTuUO1vH2cZm2ZKHeQxnOqlTi9EfZDGgIe3BL3I4u+rJHocr9Fz86M4fjYABPvFnQG/gGK551HqDiIcETwU6Q==
"@inquirer/checkbox@^5.2.1":
version "5.2.1"
resolved "https://registry.yarnpkg.com/@inquirer/checkbox/-/checkbox-5.2.1.tgz#7f148b3153a776cee202015b10f9a985068d188d"
integrity sha512-b6xmA/VlTe0ZgDQHDui+Nav470u7u49nRd8/iuhOcQPO9Ch7lGuogydhi2VOmNlZ+zXcM8IcPuNSwQcdJaF/kw==
dependencies:
"@inquirer/ansi" "^2.0.7"
"@inquirer/core" "^11.2.1"
"@inquirer/figures" "^2.0.7"
"@inquirer/type" "^4.0.7"
"@inquirer/confirm@^6.1.1":
version "6.1.1"
resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-6.1.1.tgz#9c6a7d79c6132b2af57fdb75747f056204e55356"
integrity sha512-eb8DBZcz/2qHWQda4rk2JiQk5h9QV/cVHi1yjt0f69WFZMRFn0sJTye3EAP8icut8UDMjQPsaH5KbcOogefrFQ==
dependencies:
"@inquirer/core" "^11.2.1"
"@inquirer/type" "^4.0.7"
"@inquirer/core@^11.2.1":
version "11.2.1"
resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-11.2.1.tgz#54ccd8f7d47852140b6066cbd77d63b2c2b168fd"
integrity sha512-Qd6GJT1yVyrZZCfN8W2qKF5ApmqryXRhRKCuip8h01x2w/esJQ2XIYc6f9abMIHgKQdBfFTSOdbHRLAhuM09UA==
dependencies:
"@inquirer/ansi" "^2.0.7"
"@inquirer/figures" "^2.0.7"
"@inquirer/type" "^4.0.7"
cli-width "^4.1.0"
fast-wrap-ansi "^0.2.0"
mute-stream "^3.0.0"
signal-exit "^4.1.0"
"@inquirer/editor@^5.2.2":
version "5.2.2"
resolved "https://registry.yarnpkg.com/@inquirer/editor/-/editor-5.2.2.tgz#7c73e2fc0e7bd4c40cfd38a180ae5bbd24d32b90"
integrity sha512-ZRVd/oD+sYsUd5zVm0NflqEzlqfYCyHNsqkHl2oWXEUHs12tCbcSFi+wVFEvD8+LGRaMUsVrE7qeo6lSG/S1Vg==
dependencies:
"@inquirer/core" "^11.2.1"
"@inquirer/external-editor" "^3.0.3"
"@inquirer/type" "^4.0.7"
"@inquirer/expand@^5.1.1":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@inquirer/expand/-/expand-5.1.1.tgz#e2afeac247d97dd64ee18aa81e902bdd1fe0ea70"
integrity sha512-YmQpenjbFSHAK3sOd44puHh3V1KXXr+JiNpUztoSQ4drLh2rTVzTap/YtlAVu/5xavifIlBfNEzJ/neZJ1a/1g==
dependencies:
"@inquirer/core" "^11.2.1"
"@inquirer/type" "^4.0.7"
"@inquirer/external-editor@^3.0.3":
version "3.0.3"
resolved "https://registry.yarnpkg.com/@inquirer/external-editor/-/external-editor-3.0.3.tgz#d79e772542cf8d340642e9dabd3a1ea7f5a30104"
integrity sha512-6thf5I8q7lZwzGLAxPaaGEREEkZ3nyePPDQ1oyobblxmEE8mqTLguScP7pDjUTAibiyb4hfXl+qjUEJ+di/aNA==
dependencies:
chardet "^2.1.1"
iconv-lite "^0.7.2"
"@inquirer/figures@^2.0.7":
version "2.0.7"
resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-2.0.7.tgz#f5cc5843732a81304d06a0db4b53cc7dbda15541"
integrity sha512-aJ8TBPOGB6f/2qziPfElISTCEd5XOYTFckA2SGjhNmiKzfK/u4ot3v0DUzGVdUnKjN10EqnnEPck36BkyfLnJw==
"@inquirer/input@^5.1.2":
version "5.1.2"
resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-5.1.2.tgz#9305cb170dfc3a5323e5eac885a945e7cddd5c4b"
integrity sha512-9K/DDBSQpOyZSkt6sOVP9Vo0TR7atX2kuILsUu0x3wVcVbe97lJwIJKMLdMw25tDYuXl/qp6erT0Xs1rfmcfZg==
dependencies:
"@inquirer/core" "^11.2.1"
"@inquirer/type" "^4.0.7"
"@inquirer/number@^4.1.1":
version "4.1.1"
resolved "https://registry.yarnpkg.com/@inquirer/number/-/number-4.1.1.tgz#b133668d8e0e099b4133abb915221501e0ff75d7"
integrity sha512-XF4IXAbPnGPgw0wsbC/i2tPcyfdZgDpUlhsqU0SfT4IRIGWha6Xm9VRgN5yYxJq+jnyXlfXI/nQ3ulfk0iEICA==
dependencies:
"@inquirer/core" "^11.2.1"
"@inquirer/type" "^4.0.7"
"@inquirer/password@^5.1.1":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-5.1.1.tgz#f21efb614da9c905095262f51781fd2a721fceac"
integrity sha512-3XBfF7DAsp5qeDsvN5Rd1HmbNokVvEQoUM0QLrRcybC9nX96w3Pbmu7qUsb3IT3J3jBvs2+mTXaKHOUsgHMLzg==
dependencies:
"@inquirer/ansi" "^2.0.7"
"@inquirer/core" "^11.2.1"
"@inquirer/type" "^4.0.7"
"@inquirer/prompts@^8.5.2":
version "8.5.2"
resolved "https://registry.yarnpkg.com/@inquirer/prompts/-/prompts-8.5.2.tgz#09c0132ada2bbba94c91d341115e1e41cb3f1525"
integrity sha512-IYR/3C/paEVVQYQvdDlFZVjRCJVYHHON0XXMH91KO9GSxs0TdKYWlUdvfQl2EfAHDxUaN3IBffkE/BDTh5nJ6g==
dependencies:
"@inquirer/checkbox" "^5.2.1"
"@inquirer/confirm" "^6.1.1"
"@inquirer/editor" "^5.2.2"
"@inquirer/expand" "^5.1.1"
"@inquirer/input" "^5.1.2"
"@inquirer/number" "^4.1.1"
"@inquirer/password" "^5.1.1"
"@inquirer/rawlist" "^5.3.1"
"@inquirer/search" "^4.2.1"
"@inquirer/select" "^5.2.1"
"@inquirer/rawlist@^5.3.1":
version "5.3.1"
resolved "https://registry.yarnpkg.com/@inquirer/rawlist/-/rawlist-5.3.1.tgz#66f6b8e6aa82d47399c433b8262128e7c1a4f9ce"
integrity sha512-QqdTqQddL3qPX/PPrjobpsO25NZ4dWXgTLenrR445L2ptLEYE6Z+PD5c5CNDJNx4ugRgELAIpSIJxZaO2jJ2Og==
dependencies:
"@inquirer/core" "^11.2.1"
"@inquirer/type" "^4.0.7"
"@inquirer/search@^4.2.1":
version "4.2.1"
resolved "https://registry.yarnpkg.com/@inquirer/search/-/search-4.2.1.tgz#c8f4b78ab3f866fdf0503fac0cd08c4a6661c11e"
integrity sha512-xJj8QWKRSrfKoBIITLZK61dD3zwo0Rz11fgDImku30/Oe81zMdIdGgrLY2h6RkJ+KZ/GhNYIRMKnH/62qBTA5g==
dependencies:
"@inquirer/core" "^11.2.1"
"@inquirer/figures" "^2.0.7"
"@inquirer/type" "^4.0.7"
"@inquirer/select@^5.2.1":
version "5.2.1"
resolved "https://registry.yarnpkg.com/@inquirer/select/-/select-5.2.1.tgz#3a05e76e58d9e1bb095e912c3e7093aa04cd4604"
integrity sha512-FlDndEUww8m7BfukO2nJa25vhD+H5jxxCv4oGioKqzyWz3nPHhhw4LKdYRSlXuAx7DsdWia7iyaBPKKS95Evfw==
dependencies:
"@inquirer/ansi" "^2.0.7"
"@inquirer/core" "^11.2.1"
"@inquirer/figures" "^2.0.7"
"@inquirer/type" "^4.0.7"
"@inquirer/type@^4.0.7":
version "4.0.7"
resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-4.0.7.tgz#9c6f0d857fe6ad549a3a932343b64e76acb34b10"
integrity sha512-t28inv14nMQ1PhKpsJPY+kEs/c00qzeCOS2gTNRyTjG5d6qsVA2fItxW4hkvGZ5lvanGLdtCzVIx5dwdRpN1+g==
"@jridgewell/sourcemap-codec@^1.5.5": "@jridgewell/sourcemap-codec@^1.5.5":
version "1.5.5" version "1.5.5"
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba"
@@ -663,11 +802,21 @@ chalk@^4.0.0:
ansi-styles "^4.1.0" ansi-styles "^4.1.0"
supports-color "^7.1.0" supports-color "^7.1.0"
chardet@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/chardet/-/chardet-2.1.1.tgz#5c75593704a642f71ee53717df234031e65373c8"
integrity sha512-PsezH1rqdV9VvyNhxxOW32/d75r01NY7TQCmOqomRo15ZSOKbpTFVsfjghxo6JloQUCGnH4k1LGu0R4yCLlWQQ==
check-error@^2.1.1: check-error@^2.1.1:
version "2.1.3" version "2.1.3"
resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.3.tgz#2427361117b70cca8dc89680ead32b157019caf5" resolved "https://registry.yarnpkg.com/check-error/-/check-error-2.1.3.tgz#2427361117b70cca8dc89680ead32b157019caf5"
integrity sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA== integrity sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==
cli-width@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-4.1.0.tgz#42daac41d3c254ef38ad8ac037672130173691c5"
integrity sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==
color-convert@^2.0.1: color-convert@^2.0.1:
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
@@ -901,6 +1050,25 @@ fast-srp-hap@2.0.4:
resolved "https://registry.yarnpkg.com/fast-srp-hap/-/fast-srp-hap-2.0.4.tgz#9db296e21a5143951310f99e5a74290106467811" resolved "https://registry.yarnpkg.com/fast-srp-hap/-/fast-srp-hap-2.0.4.tgz#9db296e21a5143951310f99e5a74290106467811"
integrity sha512-lHRYYaaIbMrhZtsdGTwPN82UbqD9Bv8QfOlKs+Dz6YRnByZifOh93EYmf2iEWFtkOEIqR2IK8cFD0UN5wLIWBQ== integrity sha512-lHRYYaaIbMrhZtsdGTwPN82UbqD9Bv8QfOlKs+Dz6YRnByZifOh93EYmf2iEWFtkOEIqR2IK8cFD0UN5wLIWBQ==
fast-string-truncated-width@^3.0.2:
version "3.0.3"
resolved "https://registry.yarnpkg.com/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz#23afe0da67d752ca0727538f1e6967759728ce49"
integrity sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==
fast-string-width@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/fast-string-width/-/fast-string-width-3.0.2.tgz#16dbabb491ce5585b5ecb675b65c165d71688eeb"
integrity sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==
dependencies:
fast-string-truncated-width "^3.0.2"
fast-wrap-ansi@^0.2.0:
version "0.2.2"
resolved "https://registry.yarnpkg.com/fast-wrap-ansi/-/fast-wrap-ansi-0.2.2.tgz#95e952a0145bce3f59ad56e179f84c48d4072935"
integrity sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==
dependencies:
fast-string-width "^3.0.2"
fastq@^1.6.0: fastq@^1.6.0:
version "1.20.1" version "1.20.1"
resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.20.1.tgz#ca750a10dc925bc8b18839fd203e3ef4b3ced675" resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.20.1.tgz#ca750a10dc925bc8b18839fd203e3ef4b3ced675"
@@ -977,6 +1145,13 @@ has-flag@^4.0.0:
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
iconv-lite@^0.7.2:
version "0.7.2"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.7.2.tgz#d0bdeac3f12b4835b7359c2ad89c422a4d1cc72e"
integrity sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"
ignore@^5.2.0: ignore@^5.2.0:
version "5.3.2" version "5.3.2"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5"
@@ -1027,7 +1202,7 @@ isexe@^2.0.0:
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
jpeg-js@^0.4.4: jpeg-js@0.4.4:
version "0.4.4" version "0.4.4"
resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.4.tgz#a9f1c6f1f9f0fa80cdb3484ed9635054d28936aa" resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.4.4.tgz#a9f1c6f1f9f0fa80cdb3484ed9635054d28936aa"
integrity sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg== integrity sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==
@@ -1137,6 +1312,11 @@ ms@^2.1.3:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
mute-stream@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-3.0.0.tgz#cd8014dd2acb72e1e91bb67c74f0019e620ba2d1"
integrity sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==
nanoid@^3.3.11: nanoid@^3.3.11:
version "3.3.12" version "3.3.12"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.12.tgz#ab3d912e217a6d0a514f00a72a16543a28982c05" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.12.tgz#ab3d912e217a6d0a514f00a72a16543a28982c05"
@@ -1290,6 +1470,11 @@ run-parallel@^1.1.9:
dependencies: dependencies:
queue-microtask "^1.2.2" queue-microtask "^1.2.2"
"safer-buffer@>= 2.1.2 < 3.0.0":
version "2.1.2"
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
semver@^7.6.0: semver@^7.6.0:
version "7.8.0" version "7.8.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.8.0.tgz#ed0661039fcbcda2ce71f01fa6adbefaa77040df" resolved "https://registry.yarnpkg.com/semver/-/semver-7.8.0.tgz#ed0661039fcbcda2ce71f01fa6adbefaa77040df"
@@ -1312,6 +1497,11 @@ siginfo@^2.0.0:
resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30" resolved "https://registry.yarnpkg.com/siginfo/-/siginfo-2.0.0.tgz#32e76c70b79724e3bb567cb9d543eb858ccfaf30"
integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g== integrity sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==
signal-exit@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04"
integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==
source-map-js@^1.2.1: source-map-js@^1.2.1:
version "1.2.1" version "1.2.1"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46"