fix(hwlab): route d601 v03 postgres through gateway (#957)
Co-authored-by: Codex <codex@noreply.local>
This commit is contained in:
@@ -69,12 +69,19 @@ export interface HwlabRuntimeExternalPostgresComponentSpec {
|
||||
readonly schema?: string;
|
||||
}
|
||||
|
||||
export interface HwlabRuntimeExternalPostgresRuntimeAccessSpec {
|
||||
readonly routeName?: string;
|
||||
readonly endpointAddress: string;
|
||||
readonly port: number;
|
||||
}
|
||||
|
||||
export interface HwlabRuntimeExternalPostgresSpec {
|
||||
readonly provider: string;
|
||||
readonly configRef: string;
|
||||
readonly serviceName: string;
|
||||
readonly endpointAddress: string;
|
||||
readonly port: number;
|
||||
readonly runtimeAccess?: HwlabRuntimeExternalPostgresRuntimeAccessSpec;
|
||||
readonly sslmode: "require";
|
||||
readonly database: string;
|
||||
readonly cloudApi: HwlabRuntimeExternalPostgresComponentSpec;
|
||||
@@ -657,6 +664,16 @@ function externalPostgresComponentConfig(value: unknown, path: string): HwlabRun
|
||||
};
|
||||
}
|
||||
|
||||
function externalPostgresRuntimeAccessConfig(value: unknown, path: string): HwlabRuntimeExternalPostgresRuntimeAccessSpec | undefined {
|
||||
if (value === undefined) return undefined;
|
||||
const raw = asRecord(value, path);
|
||||
return {
|
||||
routeName: optionalStringField(raw, "routeName", path),
|
||||
endpointAddress: stringField(raw, "endpointAddress", path),
|
||||
port: numberField(raw, "port", path),
|
||||
};
|
||||
}
|
||||
|
||||
function externalPostgresConfig(value: unknown, path: string): HwlabRuntimeExternalPostgresSpec | undefined {
|
||||
if (value === undefined) return undefined;
|
||||
const raw = asRecord(value, path);
|
||||
@@ -668,6 +685,7 @@ function externalPostgresConfig(value: unknown, path: string): HwlabRuntimeExter
|
||||
serviceName: stringField(raw, "serviceName", path),
|
||||
endpointAddress: stringField(raw, "endpointAddress", path),
|
||||
port: numberField(raw, "port", path),
|
||||
...(raw.runtimeAccess === undefined ? {} : { runtimeAccess: externalPostgresRuntimeAccessConfig(raw.runtimeAccess, `${path}.runtimeAccess`) }),
|
||||
sslmode,
|
||||
database: stringField(raw, "database", path),
|
||||
cloudApi: externalPostgresComponentConfig(raw.cloudApi, `${path}.cloudApi`),
|
||||
|
||||
Reference in New Issue
Block a user