fix(backend): inject provider credentials from file
This commit is contained in:
@@ -46,3 +46,12 @@ test("loadConfig accepts an authenticated upstream trust boundary", () => {
|
||||
AUTH_MODE: "upstream",
|
||||
}).authMode).toBe("upstream");
|
||||
});
|
||||
|
||||
test("loadConfig accepts only an absolute generic model key file", () => {
|
||||
expect(loadConfig({ THT_MODEL_API_KEY_FILE: "/run/secrets/model_api_key" }).modelApiKeyFile)
|
||||
.toBe("/run/secrets/model_api_key");
|
||||
expect(() => loadConfig({ THT_MODEL_API_KEY_FILE: "relative/key" }))
|
||||
.toThrow(/model credential configuration is invalid/);
|
||||
expect(() => loadConfig({ THT_MODEL_API_KEY_FILE: " /run/secrets/key" }))
|
||||
.toThrow(/model credential configuration is invalid/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user