chore(platform-infra): commit parallel proxy updates
This commit is contained in:
@@ -285,6 +285,7 @@ export function readManualBindingSources(value: unknown, key: string): CodexPool
|
||||
kind: readManualBindingKind(rawSource.kind, `${path}.kind`),
|
||||
provider: readManualBindingProvider(rawSource.provider, `${path}.provider`),
|
||||
description: readManualAccountReason(rawSource.description, `${path}.description`),
|
||||
hostProxyRef: readManualBindingHostProxyRef(rawSource.hostProxyRef, `${path}.hostProxyRef`),
|
||||
fixedProxy: null,
|
||||
};
|
||||
if (source.kind === "proxy" && source.provider === "fixed-http-proxy") {
|
||||
@@ -359,6 +360,16 @@ export function readManualBindingProvider(value: unknown, key: string): CodexPoo
|
||||
return text;
|
||||
}
|
||||
|
||||
export function readManualBindingHostProxyRef(value: unknown, key: string): string | null {
|
||||
if (value === undefined || value === null) return null;
|
||||
const text = stringValue(value)?.trim() ?? "";
|
||||
if (text.length === 0) return null;
|
||||
if (!/^config\/platform-infra\/host-proxy\.yaml#targets\.[A-Za-z0-9_-]+$/u.test(text)) {
|
||||
throw new Error(`${codexPoolConfigPath}.${key} must point at config/platform-infra/host-proxy.yaml#targets.<id>`);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
export function validateManualBindingSourceId(value: string, key: string): void {
|
||||
if (!/^[A-Za-z0-9]([A-Za-z0-9._-]*[A-Za-z0-9])?$/u.test(value)) throw new Error(`${codexPoolConfigPath}.${key} has an unsupported source id format`);
|
||||
}
|
||||
|
||||
@@ -169,6 +169,7 @@ export function manualBindingSourcePlan(source: CodexPoolManualBindingSource): R
|
||||
kind: source.kind,
|
||||
provider: source.provider,
|
||||
description: source.description,
|
||||
hostProxyRef: source.hostProxyRef,
|
||||
fixedProxy: source.fixedProxy,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -209,6 +209,7 @@ export interface CodexPoolManualBindingSource {
|
||||
kind: CodexPoolManualBindingKind;
|
||||
provider: CodexPoolManualBindingProvider;
|
||||
description: string | null;
|
||||
hostProxyRef: string | null;
|
||||
fixedProxy: CodexPoolManualFixedProxyConfig | null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user