Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
test(1password): pin that a Login's fallback username and password stay out of its extra fields
AdityaUmale40be6b6ba39e
diff --git a/server/onepassword.test.ts b/server/onepassword.test.tsindex 9ede0d8478..025c3cf239 100644--- a/server/onepassword.test.ts+++ b/server/onepassword.test.ts@@ -2,7 +2,7 @@ import { afterEach, describe, expect, it } from "vitest";import type { LoginBots } from "../shared/logins.ts";import { fillLogin, type FillCandidate } from "./login-fill.ts";-import { loginFields, ONE_PASSWORD_MALFORMED, ONE_PASSWORD_REFUSED, OnePasswordLogins, onePasswordProblem, onePasswordUnavailable, OnePasswordUnavailableError, sdkOnePasswordClient, secretFields } from "./onepassword.ts";+import { loginExtraFields, loginFields, ONE_PASSWORD_MALFORMED, ONE_PASSWORD_REFUSED, OnePasswordLogins, onePasswordProblem, onePasswordUnavailable, OnePasswordUnavailableError, sdkOnePasswordClient, secretFields } from "./onepassword.ts";import { FakeLoginPage, LOGIN_FORM } from "./testing/fake-login-page.ts";import { fakeOnePasswordSdk } from "./testing/fake-onepassword.ts";import { parseTotpKey, totpCode } from "./totp.ts";@@ -274,6 +274,14 @@ describe("1Password secrets", () => {expect(source.list().map((row) => row.site)).not.toContain("");});+ it("leaves out a Login's fallback username and password (found by type and title) from its extra fields", () => {+ const field = (id: string, title: string, fieldType: string, value: string) => ({ id, title, fieldType, value });+ const fields = [field("f1", "E-mail", "Email", "[email protected]"), field("f2", "Site password", "Concealed", "fake-fallback-pass"),+ field("f3", "API key", "Concealed", "fake-api-key"), field("f4", "Region", "Text", "eu")];+ expect(loginFields(fields)).toMatchObject({ username: "[email protected]", password: "fake-fallback-pass" });+ expect([...loginExtraFields({ fields })]).toEqual([["", "fake-api-key"], ["API key", "fake-api-key"], ["Region", "eu"]]);+ });+it("never lets Logins without a website push a website login out of the item limit", async () => {const noSite = Array.from({ length: 500 }, (_, n) => ({ id: `n${n}`, title: `No site ${n}`, urls: [], username: "x", password: "fake-x-pass" }));const { sdk } = fakeOnePasswordSdk({ token: TOKEN, vaults: { v1: { title: "Big", items: [