mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:20:43 +00:00
fix: route MiniMax usage env auth metadata
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
"autoEnableWhenConfiguredProviders": ["minimax", "minimax-portal"],
|
||||
"nonSecretAuthMarkers": ["minimax-oauth"],
|
||||
"providerAuthEnvVars": {
|
||||
"minimax": ["MINIMAX_API_KEY"],
|
||||
"minimax": ["MINIMAX_CODE_PLAN_KEY", "MINIMAX_CODING_API_KEY", "MINIMAX_API_KEY"],
|
||||
"minimax-portal": ["MINIMAX_OAUTH_TOKEN", "MINIMAX_API_KEY"]
|
||||
},
|
||||
"providerAuthChoices": [
|
||||
|
||||
@@ -263,6 +263,37 @@ describe("resolveProviderAuths plugin boundary", () => {
|
||||
expect(ensureAuthProfileStoreMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("keeps plugin usage auth when provider-owned usage env credentials exist", async () => {
|
||||
resolveProviderUsageAuthWithPluginMock.mockResolvedValueOnce({
|
||||
token: "plugin-minimax-token",
|
||||
});
|
||||
|
||||
await withTempHome(async (homeDir) => {
|
||||
await expect(
|
||||
resolveProviderAuths({
|
||||
providers: ["minimax"],
|
||||
skipPluginAuthWithoutCredentialSource: true,
|
||||
env: {
|
||||
HOME: homeDir,
|
||||
MINIMAX_CODE_PLAN_KEY: "code-plan-key",
|
||||
},
|
||||
}),
|
||||
).resolves.toEqual([
|
||||
{
|
||||
provider: "minimax",
|
||||
token: "plugin-minimax-token",
|
||||
},
|
||||
]);
|
||||
});
|
||||
|
||||
expect(resolveProviderUsageAuthWithPluginMock).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
provider: "minimax",
|
||||
}),
|
||||
);
|
||||
expect(ensureAuthProfileStoreMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("does not overlay external auth profiles while checking the skip gate", async () => {
|
||||
hasAnyAuthProfileStoreSourceMock.mockReturnValue(true);
|
||||
|
||||
|
||||
@@ -210,8 +210,6 @@ export function getProviderEnvVars(
|
||||
return Array.isArray(envVars) ? [...envVars] : [];
|
||||
}
|
||||
|
||||
const EXTRA_PROVIDER_AUTH_ENV_VARS = ["MINIMAX_CODE_PLAN_KEY", "MINIMAX_CODING_API_KEY"] as const;
|
||||
|
||||
// OPENCLAW_API_KEY authenticates the local OpenClaw bridge itself and must
|
||||
// remain available to child bridge/runtime processes.
|
||||
export function listKnownProviderAuthEnvVarNames(params?: ProviderEnvVarLookupParams): string[] {
|
||||
@@ -219,7 +217,6 @@ export function listKnownProviderAuthEnvVarNames(params?: ProviderEnvVarLookupPa
|
||||
...new Set([
|
||||
...Object.values(resolveProviderAuthEnvVarCandidates(params)).flatMap((keys) => keys),
|
||||
...Object.values(resolveProviderEnvVars(params)).flatMap((keys) => keys),
|
||||
...EXTRA_PROVIDER_AUTH_ENV_VARS,
|
||||
]),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user