Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep sensitive values out of settings reads, startup logs and preview snapshots #20446

Mergedjuliusmarmingemerged 3 commits intomain fromrefs/pull/20446/headmerged by juliusmarminge View on GitHub

Showing 11 changed files with 63 additions and 1 deletion (loading 9).

x
0 of 11 viewed, 11 left
9 additions and 1 deletionapps/server/src/preview/ServerBrowser.test.tsModified
View file
@@ -80,7 +80,15 @@
if (method === "Page.getLayoutMetrics") return { cssVisualViewport: { pageX: 0, pageY: 0 } };
if (method === "Page.captureScreenshot") return { data: "ZnJhbWU=" };
if (method === "Page.getFrameTree") return { frameTree: { frame: { id: "main" } } };
- if (method === "Page.createIsolatedWorld") return { executionContextId: 7 };
+ // Snapshots read password fields from their own isolated world in each frame.
+ if (method === "Page.createIsolatedWorld") {
+ return {
+ executionContextId: (input as { worldName?: string }).worldName === "t3-preview" ? 1 : 7,
+ };
+ }
+ if (method === "Runtime.evaluate" && (input as { contextId?: number }).contextId === 1) {
+ return { result: { value: [] } };
+ }
if (method === "Page.addScriptToEvaluateOnNewDocument") frame?.recording.resolve();
if (method === "Input.dispatchKeyEvent" && (input as { commands?: unknown }).commands) {
if (focusedFrame) focusedFrame.copy = keyCopy || focusedFrame.copy;
54 additions and 0 deletionsapps/server/src/preview/ServerBrowserPage.test.tsModified
View file
@@ -124,6 +124,60 @@
expect(await page.getByRole("textbox", { name: "parent" }).inputValue()).toBe("");
});
​
+ it("shows dotted fields as dots wherever their value appears, keeping text values and refs", async () => {
+ await page.setContent(`
+ <table><tr><td>password:</td><td><input id="pw" type="password" aria-label="Password"></td></tr></table>
+ <input aria-label="Username" value="maria">
+ <input type="password" aria-label='saved" [ref=e2]: x' placeholder="hint" value="saved-pass">