mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 14:30:22 +00:00
feat(plugins): support provider auth aliases
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
|
||||
import plugin from "./index.js";
|
||||
@@ -32,4 +34,14 @@ describe("byteplus plugin", () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("declares its coding provider auth alias in the manifest", () => {
|
||||
const pluginJson = JSON.parse(
|
||||
readFileSync(resolve(import.meta.dirname, "openclaw.plugin.json"), "utf-8"),
|
||||
);
|
||||
|
||||
expect(pluginJson.providerAuthAliases).toEqual({
|
||||
"byteplus-plan": "byteplus",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
"providerAuthEnvVars": {
|
||||
"byteplus": ["BYTEPLUS_API_KEY"]
|
||||
},
|
||||
"providerAuthAliases": {
|
||||
"byteplus-plan": "byteplus"
|
||||
},
|
||||
"providerAuthChoices": [
|
||||
{
|
||||
"provider": "byteplus",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { readFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { registerSingleProviderPlugin } from "../../test/helpers/plugins/plugin-registration.js";
|
||||
import plugin from "./index.js";
|
||||
@@ -32,4 +34,14 @@ describe("volcengine plugin", () => {
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("declares its coding provider auth alias in the manifest", () => {
|
||||
const pluginJson = JSON.parse(
|
||||
readFileSync(resolve(import.meta.dirname, "openclaw.plugin.json"), "utf-8"),
|
||||
);
|
||||
|
||||
expect(pluginJson.providerAuthAliases).toEqual({
|
||||
"volcengine-plan": "volcengine",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
"providerAuthEnvVars": {
|
||||
"volcengine": ["VOLCANO_ENGINE_API_KEY"]
|
||||
},
|
||||
"providerAuthAliases": {
|
||||
"volcengine-plan": "volcengine"
|
||||
},
|
||||
"providerAuthChoices": [
|
||||
{
|
||||
"provider": "volcengine",
|
||||
|
||||
Reference in New Issue
Block a user