chore(security): scrub subscription bridge placeholders
This commit is contained in:
parent
421926768a
commit
a6547eda2f
@ -324,7 +324,7 @@ export function spawnBridge(desc: SubscriptionDescriptor): Promise<RunningBridge
|
|||||||
{ subscription: desc.id, port: desc.bridgePort },
|
{ subscription: desc.id, port: desc.bridgePort },
|
||||||
'Port already in use — assuming external bridge is healthy'
|
'Port already in use — assuming external bridge is healthy'
|
||||||
);
|
);
|
||||||
const url = `http://127.0.0.1:${desc.bridgePort}`;
|
const url = `http://localhost:${desc.bridgePort}`;
|
||||||
const fakeBridge: RunningBridge = {
|
const fakeBridge: RunningBridge = {
|
||||||
descriptor: desc,
|
descriptor: desc,
|
||||||
server, // server failed to bind; OK to keep handle
|
server, // server failed to bind; OK to keep handle
|
||||||
@ -339,8 +339,8 @@ export function spawnBridge(desc: SubscriptionDescriptor): Promise<RunningBridge
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
server.listen(desc.bridgePort, '127.0.0.1', () => {
|
server.listen(desc.bridgePort, 'localhost', () => {
|
||||||
const url = `http://127.0.0.1:${desc.bridgePort}`;
|
const url = `http://localhost:${desc.bridgePort}`;
|
||||||
const bridge: RunningBridge = {
|
const bridge: RunningBridge = {
|
||||||
descriptor: desc,
|
descriptor: desc,
|
||||||
server,
|
server,
|
||||||
|
|||||||
@ -238,7 +238,7 @@ async function probeBridge(url: string | undefined): Promise<boolean> {
|
|||||||
/**
|
/**
|
||||||
* Resolve the bridge URL for a subscription:
|
* Resolve the bridge URL for a subscription:
|
||||||
* 1. Explicit env var (CLAUDE_BRIDGE_URL etc.) — set by Settings or PM2 ecosystem
|
* 1. Explicit env var (CLAUDE_BRIDGE_URL etc.) — set by Settings or PM2 ecosystem
|
||||||
* 2. Auto-detect: probe http://127.0.0.1:{bridgePort} for a /health endpoint
|
* 2. Auto-detect: probe http://localhost:{bridgePort} for a /health endpoint
|
||||||
*
|
*
|
||||||
* This means a bridge running locally on its default port is picked up
|
* This means a bridge running locally on its default port is picked up
|
||||||
* automatically without any configuration.
|
* automatically without any configuration.
|
||||||
@ -250,7 +250,7 @@ async function resolveBridgeUrl(desc: SubscriptionDescriptor): Promise<{ url?: s
|
|||||||
return { url: explicit, running };
|
return { url: explicit, running };
|
||||||
}
|
}
|
||||||
// Auto-detect on the default port
|
// Auto-detect on the default port
|
||||||
const localUrl = `http://127.0.0.1:${desc.bridgePort}`;
|
const localUrl = `http://localhost:${desc.bridgePort}`;
|
||||||
const running = await probeBridge(localUrl);
|
const running = await probeBridge(localUrl);
|
||||||
return running ? { url: localUrl, running: true } : { running: false };
|
return running ? { url: localUrl, running: true } : { running: false };
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ function configuredBridgeUrl(status: SubscriptionStatus, runningById: Map<string
|
|||||||
}
|
}
|
||||||
|
|
||||||
function defaultBridgeUrl(status: SubscriptionStatus): string {
|
function defaultBridgeUrl(status: SubscriptionStatus): string {
|
||||||
return `http://127.0.0.1:${status.descriptor.bridgePort}`;
|
return `http://localhost:${status.descriptor.bridgePort}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function bridgeBaseUrl(url: string): string {
|
function bridgeBaseUrl(url: string): string {
|
||||||
@ -78,12 +78,12 @@ function buildAccessCard(
|
|||||||
subscriptionStatusUrl: `${baseUrl}/api/subscriptions?search=${encodeURIComponent(status.descriptor.id)}`,
|
subscriptionStatusUrl: `${baseUrl}/api/subscriptions?search=${encodeURIComponent(status.descriptor.id)}`,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
Authorization: 'Bearer ${LLM_GATEWAY_API_KEY}',
|
Authorization: 'Bearer <key>',
|
||||||
'X-Caller-ID': 'your-service-name',
|
'X-Caller-ID': 'your-service-name',
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
LLM_GATEWAY_URL: baseUrl,
|
LLM_GATEWAY_URL: baseUrl,
|
||||||
LLM_GATEWAY_API_KEY: '${LLM_GATEWAY_API_KEY}',
|
LLM_GATEWAY_API_KEY: '<key>',
|
||||||
LLM_GATEWAY_MODEL: defaultModel,
|
LLM_GATEWAY_MODEL: defaultModel,
|
||||||
LLM_GATEWAY_SUBSCRIPTION: status.descriptor.id,
|
LLM_GATEWAY_SUBSCRIPTION: status.descriptor.id,
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user