Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): read Chromium cookies stored as text #19377

Mergeddeanhtid(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/19377/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 52 additions and 49 deletions.

x
0 of 2 viewed, 2 left
48 additions and 47 deletionsapps/desktop/src/preview/BrowserImport/ChromiumCookies.test.tsModified
View file
@@ -151,56 +151,57 @@
}).pipe(Effect.provide(NodeServices.layer), Effect.scoped),
​
- it.effect("reads plaintext, encrypted, and genuinely empty cookie values", () =>
- Effect.gen(function* () {
- const fileSystem = yield* FileSystem.FileSystem;
- const directory = yield* fileSystem.makeTempDirectoryScoped({
- prefix: "t3code-chromium-cookies-",
- });
- const filename = `${directory}/Cookies`;
- const key = Buffer.from("0123456789abcdef");
+ it.effect.each([14, 24])(
+ "imports mixed TEXT and BLOB cookie values, including empty values, in schema %i",
+ (schemaVersion) =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const directory = yield* fileSystem.makeTempDirectoryScoped({
+ prefix: "t3code-chromium-cookies-",
+ });
+ const filename = `${directory}/Cookies`;
+ const key = Buffer.from("0123456789abcdef");
+ const host = "secure.example";
+ const value = "stored encrypted";
+ const payload =
+ schemaVersion >= 24
+ ? Buffer.concat([
+ NodeCrypto.createHash("sha256").update(host).digest(),
+ Buffer.from(value),
+ ])