fix: complete diagnostic extension remediation
This commit is contained in:
@@ -45,11 +45,12 @@ function legacyDirectConnection(
|
||||
function legacyRestEndpoint(
|
||||
binding: ResolvedBinding,
|
||||
names: { baseUrl: string; apiKeyFile: string; tlsCaFile: string },
|
||||
requiresCredential: boolean,
|
||||
): Record<string, unknown> {
|
||||
const endpoint: Record<string, unknown> = {
|
||||
base_url: requireBinding(binding, names.baseUrl),
|
||||
api_key_file: requireBinding(binding, names.apiKeyFile),
|
||||
};
|
||||
if (requiresCredential) endpoint.api_key_file = requireBinding(binding, names.apiKeyFile);
|
||||
const tlsCaFile = bindingValue(binding, names.tlsCaFile);
|
||||
if (tlsCaFile !== undefined) endpoint.ssl_ca_file = tlsCaFile;
|
||||
return endpoint;
|
||||
@@ -124,7 +125,7 @@ export function renderRuntimeConfig(
|
||||
const rest = legacyRestEndpoint(bindings.dwh, {
|
||||
baseUrl: name("DWH", "BASE_URL"), apiKeyFile: name("DWH", "API_KEY_FILE"),
|
||||
tlsCaFile: name("DWH", "TLS_CA_FILE"),
|
||||
});
|
||||
}, canonical.diagnostics?.dwh_rest?.auth !== "none");
|
||||
rendered.rest = rest;
|
||||
rendered.dwh = { type: "thoth_rest", database: dwhIdentity, endpoint: rest };
|
||||
} else {
|
||||
@@ -136,7 +137,7 @@ export function renderRuntimeConfig(
|
||||
const vectorRest = legacyRestEndpoint(bindings.vector, {
|
||||
baseUrl: name("VECTOR", "BASE_URL"), apiKeyFile: name("VECTOR", "API_KEY_FILE"),
|
||||
tlsCaFile: name("VECTOR", "TLS_CA_FILE"),
|
||||
});
|
||||
}, canonical.diagnostics?.vector_rest?.metadata.auth !== "none");
|
||||
rendered.vector_rest = vectorRest;
|
||||
rendered.vectors = { type: "thoth_vector_http", reader: vectorRest };
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user