Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep auth-like Codex files private to each home #23428

Openjuliusmarmingewants to merge 9 commits intomain fromrefs/pull/23428/headopened View on GitHub

Showing 2 changed files with 106 additions and 16 deletions.

x
0 of 2 viewed, 2 left
66 additions and 0 deletionsapps/server/src/provider/Drivers/CodexHomeLayout.test.tsModified
View file
@@ -165,6 +165,72 @@
}),
​
+ it.effect.skipIf(!symlinksSupported)(
+ "keeps auth-like entries private to each home without touching shared copies",
+ () =>
+ Effect.gen(function* () {
+ const fileSystem = yield* FileSystem.FileSystem;
+ const path = yield* Path.Path;
+ const sharedHome = yield* makeTempDir("t3code-codex-shared-");
+ const shadowRoot = yield* makeTempDir("t3code-codex-shadow-root-");
+ const shadowHome = path.join(shadowRoot, "shadow");
+ const authLikeNames = [
+ "auth-fixture-a.json",
+ "auth_fixture_b.json",
+ "auth.json.bak",
+ "AUTH.Backup",
+ "auth.lock",
+ ];
+​
+ for (const name of authLikeNames) {
+ yield* writeTextFile(path.join(sharedHome, name), `{"shared":"${name}"}\n`);
+ }
+ yield* writeTextFile(path.join(sharedHome, "author.json"), '{"author":true}\n');
+ yield* writeTextFile(path.join(shadowHome, "auth.json"), '{"shadow":true}\n');
+ yield* fileSystem.symlink(
+ path.join(sharedHome, "auth.lock"),
+ path.join(shadowHome, "auth.lock"),
+ );