update
This commit is contained in:
1 parent
aba2dac3c5
commit
dffeccf3e2
17 files changed
+1296
-120
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { getEnvApiKey } from "@mariozechner/pi-ai";
|
||||
import type { AppDatabase } from "./database";
|
||||
import { getConnectorDefinition } from "./connectors";
|
||||
import { getConnectorDefinition, parseEnvBindingText } from "./connectors";
|
||||
import type { ConnectorId } from "@shared/types";
|
||||
import type { CredentialStore } from "./credentials";
|
||||
|
||||
@@ -54,6 +54,16 @@ export function createConnectorHealthService({
|
||||
if (definition.provider && getEnvApiKey(definition.provider as never)) {
|
||||
return { status: "ready", authState: "ok", lastError: null };
|
||||
}
|
||||
// Re-parse envBindingText on every probe: it is user-editable and must
|
||||
// not be cached into credentialStore. An explicit binding for the
|
||||
// connector's declared envKey (non-empty value) counts as ready.
|
||||
const connector = db.connectorsCrud.findConnector(id);
|
||||
const boundValue = connector
|
||||
? parseEnvBindingText(connector.envBindingText)[definition.auth.envKey]
|
||||
: undefined;
|
||||
if (boundValue && boundValue.length > 0) {
|
||||
return { status: "ready", authState: "ok", lastError: null };
|
||||
}
|
||||
return {
|
||||
status: "auth_required",
|
||||
authState: "required",
|
||||
|
||||
Reference in new issue
Block a user