Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(server): add reusable auth token for dev worktrees #8606

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 7 commits intomain fromrefs/pull/8606/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 20 changed files with 217 additions and 1 deletion (loading 19).

x
0 of 20 viewed, 20 left
217 additions and 1 deletionapps/server/src/auth/EnvironmentAuth.test.tsModified
View file
@@ -3,9 +3,13 @@
import { expect, it } from "@effect/vitest";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
+import * as Redacted from "effect/Redacted";
+import * as Schema from "effect/Schema";
+import * as SqlClient from "effect/unstable/sql/SqlClient";
​
import * as ServerConfig from "../config.ts";
import * as ServerEnvironment from "../environment/ServerEnvironment.ts";
+import * as PersistenceErrors from "../persistence/Errors.ts";
import { SqlitePersistenceMemory } from "../persistence/Layers/Sqlite.ts";
import * as PairingGrantStore from "./PairingGrantStore.ts";
import * as EnvironmentAuth from "./EnvironmentAuth.ts";
@@ -15,6 +19,8 @@
​
/** Pinned so dev-mode cookie tests can assert the port-scoped name. */
const TEST_SERVER_PORT = 13_773;
+const isPairingCredentialIssueError = Schema.is(PairingGrantStore.PairingCredentialIssueError);
+const isPersistenceSqlError = Schema.is(PersistenceErrors.PersistenceSqlError);
​
const makeServerConfigLayer = (overrides?: Partial<ServerConfig.ServerConfig["Service"]>) =>
Layer.effect(
@@ -33,7 +39,7 @@
​
const makeEnvironmentAuthLayer = (overrides?: Partial<ServerConfig.ServerConfig["Service"]>) =>
EnvironmentAuth.layer.pipe(
- Layer.provide(SqlitePersistenceMemory),