From 1cb607bc32fdfcff1c1dcf33b21af2648a5b3c0b Mon Sep 17 00:00:00 2001 From: Evan Sosenko Date: Tue, 11 Aug 2026 20:55:52 -0700 Subject: [PATCH 1/2] feat: Remove support for fakeseamconnect.seam.vc --- src/lib/auth/operations.ts | 25 ------------------- src/lib/interactions/endpoint-selection.ts | 29 +++------------------- src/lib/prompt.test.ts | 3 +-- test/auth/operations.test.ts | 23 ----------------- 4 files changed, 5 insertions(+), 75 deletions(-) diff --git a/src/lib/auth/operations.ts b/src/lib/auth/operations.ts index 9670c32c..795dd6ba 100644 --- a/src/lib/auth/operations.ts +++ b/src/lib/auth/operations.ts @@ -1,5 +1,3 @@ -import { randomBytes } from 'node:crypto' - import { type ConfigStore, getConfigStore } from 'lib/config/index.js' import { type AuthContext, resolveAuth } from 'lib/context.js' import { @@ -134,29 +132,6 @@ export const selectWorkspace = ( config.set('current_workspace_id', workspaceId) } -/** - * Point the CLI at a fake Seam Connect endpoint and store the well-known - * token it accepts. Returns the generated endpoint URL for reporting. - */ -export const selectFakeEndpoint = ({ - urlSeed = randomBytes(5).toString('hex'), - config = getConfigStore(), -}: { - urlSeed?: string - config?: ConfigStore -} = {}): { endpoint: string; token: string } => { - const auth = resolveAuth(config) - assertMutable(auth, 'endpoint', 'select an endpoint') - assertMutable(auth, 'token', 'log in') - - const endpoint = `https://${urlSeed}.fakeseamconnect.seam.vc` - const token = 'seam_apikey1_token' - storeEndpoint(endpoint, config) - config.set(`${endpoint}.pat`, token) - - return { endpoint, token } -} - /** Store whether API definitions come from the endpoint instead of npm. */ export const setUseRemoteApiDefs = ( useRemoteApiDefs: boolean, diff --git a/src/lib/interactions/endpoint-selection.ts b/src/lib/interactions/endpoint-selection.ts index c17595c3..c7730396 100644 --- a/src/lib/interactions/endpoint-selection.ts +++ b/src/lib/interactions/endpoint-selection.ts @@ -1,14 +1,8 @@ -import { randomBytes } from 'node:crypto' - -import { - assertMutable, - selectEndpoint, - selectFakeEndpoint, -} from 'lib/auth/operations.js' +import { assertMutable, selectEndpoint } from 'lib/auth/operations.js' import { getConfigStore } from 'lib/config/index.js' import { resolveAuth } from 'lib/context.js' import { getOutput } from 'lib/output/get-output.js' -import { promptAutocomplete, promptText } from 'lib/prompt.js' +import { promptAutocomplete } from 'lib/prompt.js' export async function interactForEndpointSelection() { const config = getConfigStore() @@ -17,7 +11,6 @@ export async function interactForEndpointSelection() { const endpoints = [ 'http://localhost:3020', 'https://connect.getseam.com', - 'https://fakeseamconnect.seam.vc', ] // Searchable, as selecting a device or a command is. @@ -29,20 +22,6 @@ export async function interactForEndpointSelection() { })), }) - const output = getOutput() - if (endpoint === endpoints[2]) { - let userUrlSeed = await promptText({ - message: - 'You can input a custom endpoint URL or leave this field empty to use a new fakeserver.', - }) - - if (userUrlSeed.trim().length === 0) { - userUrlSeed = randomBytes(5).toString('hex') - } - selectFakeEndpoint({ urlSeed: userUrlSeed, config }) - output.info(`PAT set to use fakeseamconnect with "seam_apikey1_token"`) - } else { - selectEndpoint(endpoint, config) - } - output.info(`Endpoint set to ${endpoint}`) + selectEndpoint(endpoint, config) + getOutput().info(`Endpoint set to ${endpoint}`) } diff --git a/src/lib/prompt.test.ts b/src/lib/prompt.test.ts index 1349c6d0..4fb49813 100644 --- a/src/lib/prompt.test.ts +++ b/src/lib/prompt.test.ts @@ -31,10 +31,9 @@ test('searchChoices: matches any part of a name, not only its start', () => { const endpoints = [ { label: 'http://localhost:3020' }, { label: 'https://connect.getseam.com' }, - { label: 'https://fakeseamconnect.seam.vc' }, ] - expect(search('fake', endpoints)).toEqual([endpoints[2]]) + expect(search('seam', endpoints)).toEqual([endpoints[1]]) }) test('searchChoices: offers every choice until something is typed', () => { diff --git a/test/auth/operations.test.ts b/test/auth/operations.test.ts index 80f88bb0..4c824c93 100644 --- a/test/auth/operations.test.ts +++ b/test/auth/operations.test.ts @@ -4,7 +4,6 @@ import { login, logout, selectEndpoint, - selectFakeEndpoint, selectWorkspace, storeToken, } from 'lib/auth/operations.js' @@ -213,25 +212,3 @@ test(`selectWorkspace: refuses while ${workspaceIdEnvVar} is set`, () => { }).toThrow(`Cannot select a workspace while ${workspaceIdEnvVar} is set`) }) -test('selectFakeEndpoint: stores the endpoint and its well-known token', () => { - const store = createMemoryConfigStore({ current_workspace_id: 'workspace1' }) - - const { endpoint: fakeEndpoint } = selectFakeEndpoint({ - urlSeed: 'abc123', - config: store, - }) - - expect(fakeEndpoint).toBe('https://abc123.fakeseamconnect.seam.vc') - expect(store.get('endpoint')).toBe(fakeEndpoint) - expect(store.get(`${fakeEndpoint}.pat`)).toBe('seam_apikey1_token') - expect(store.has('current_workspace_id')).toBe(false) -}) - -test(`selectFakeEndpoint: refuses while ${endpointEnvVar} is set`, () => { - process.env[endpointEnvVar] = endpoint - const store = createMemoryConfigStore() - - expect(() => - selectFakeEndpoint({ urlSeed: 'abc123', config: store }), - ).toThrow(`Cannot select an endpoint while ${endpointEnvVar} is set`) -}) From 0123642799caebf691cc8eabc7df2e9d9106b4a9 Mon Sep 17 00:00:00 2001 From: Seam Bot Date: Wed, 12 Aug 2026 03:56:50 +0000 Subject: [PATCH 2/2] ci: Format code --- src/lib/interactions/endpoint-selection.ts | 5 +---- test/auth/operations.test.ts | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/lib/interactions/endpoint-selection.ts b/src/lib/interactions/endpoint-selection.ts index c7730396..3c77ba31 100644 --- a/src/lib/interactions/endpoint-selection.ts +++ b/src/lib/interactions/endpoint-selection.ts @@ -8,10 +8,7 @@ export async function interactForEndpointSelection() { const config = getConfigStore() assertMutable(resolveAuth(config), 'endpoint', 'select an endpoint') - const endpoints = [ - 'http://localhost:3020', - 'https://connect.getseam.com', - ] + const endpoints = ['http://localhost:3020', 'https://connect.getseam.com'] // Searchable, as selecting a device or a command is. const endpoint = await promptAutocomplete({ diff --git a/test/auth/operations.test.ts b/test/auth/operations.test.ts index 4c824c93..adebde84 100644 --- a/test/auth/operations.test.ts +++ b/test/auth/operations.test.ts @@ -211,4 +211,3 @@ test(`selectWorkspace: refuses while ${workspaceIdEnvVar} is set`, () => { selectWorkspace('workspace1', store) }).toThrow(`Cannot select a workspace while ${workspaceIdEnvVar} is set`) }) -