load secrets from local config

This commit is contained in:
Nate 2025-03-23 13:06:19 -07:00
parent d0da825534
commit fd7f3dc93b
7 changed files with 23 additions and 17 deletions

View file

@ -199,8 +199,8 @@ export class ConfigHandler {
this.ide,
this.ideSettingsPromise,
this.writeLog,
this.reloadConfig.bind(this),
assistant.rawYaml,
selectedOrgId,
);
return new ProfileLifecycleManager(profileLoader, this.ide);

View file

@ -71,6 +71,7 @@ export default class ControlPlaneProfileLoader implements IProfileLoader {
undefined,
this.workspaceId,
undefined,
null,
);
}

View file

@ -65,6 +65,7 @@ export default class LocalProfileLoader implements IProfileLoader {
undefined,
this.description.id,
this.overrideAssistantFile?.path,
null,
);
this.description.errors = result.errors;

View file

@ -31,8 +31,8 @@ export default class PlatformProfileLoader implements IProfileLoader {
private readonly ide: IDE,
private ideSettingsPromise: Promise<IdeSettings>,
private writeLog: (message: string) => Promise<void>,
private readonly onReload: () => void,
readonly description: ProfileDescription,
private readonly orgScopeId: string | null,
) {}
static async create(
@ -45,8 +45,8 @@ export default class PlatformProfileLoader implements IProfileLoader {
ide: IDE,
ideSettingsPromise: Promise<IdeSettings>,
writeLog: (message: string) => Promise<void>,
onReload: () => void,
rawYaml: string,
orgScopeId: string | null,
): Promise<PlatformProfileLoader> {
const controlPlaneEnv = await getControlPlaneEnv(ideSettingsPromise);
@ -75,8 +75,8 @@ export default class PlatformProfileLoader implements IProfileLoader {
ide,
ideSettingsPromise,
writeLog,
onReload,
description,
orgScopeId,
);
}
@ -102,6 +102,7 @@ export default class PlatformProfileLoader implements IProfileLoader {
},
this.description.id,
undefined,
this.orgScopeId,
);
return {

View file

@ -45,6 +45,7 @@ export default async function doLoadConfig(
platformConfigMetadata: PlatformConfigMetadata | undefined,
profileId: string,
overrideConfigYamlByPath: string | undefined,
orgScopeId: string | null,
): Promise<ConfigResult<ContinueConfig>> {
const workspaceConfigs = await getWorkspaceConfigs(ide);
const ideInfo = await ide.getIdeInfo();
@ -70,7 +71,6 @@ export default async function doLoadConfig(
if (overrideConfigYaml || fs.existsSync(configYamlPath)) {
const result = await loadContinueConfigFromYaml(
ide,
workspaceConfigs.map((c) => JSON.stringify(c)),
ideSettings,
ideInfo,
uniqueId,
@ -80,6 +80,7 @@ export default async function doLoadConfig(
platformConfigMetadata,
controlPlaneClient,
configYamlPath,
orgScopeId,
);
newConfig = result.config;
errors = result.errors;

View file

@ -44,19 +44,22 @@ import { modifyAnyConfigWithSharedConfig } from "../sharedConfig";
import { llmsFromModelConfig } from "./models";
export class LocalPlatformClient implements PlatformClient {
constructor(
private orgScopeId: string | null,
private readonly client: ControlPlaneClient,
) {}
async resolveFQSNs(fqsns: FQSN[]): Promise<(SecretResult | undefined)[]> {
return fqsns.map((fqsn) => {
return undefined;
});
const response = await this.client.resolveFQSNs(fqsns, this.orgScopeId);
return response;
}
}
async function loadConfigYaml(
workspaceConfigs: string[],
rawYaml: string,
overrideConfigYaml: AssistantUnrolled | undefined,
ide: IDE,
controlPlaneClient: ControlPlaneClient,
orgScopeId: string | null,
): Promise<ConfigResult<AssistantUnrolled>> {
let config =
overrideConfigYaml ??
@ -72,8 +75,8 @@ async function loadConfigYaml(
{
currentUserSlug: "",
onPremProxyUrl: null,
orgScopeId: null,
platformClient: new LocalPlatformClient(),
orgScopeId,
platformClient: new LocalPlatformClient(orgScopeId, controlPlaneClient),
renderSecrets: true,
},
));
@ -387,7 +390,6 @@ async function configYamlToContinueConfig(
export async function loadContinueConfigFromYaml(
ide: IDE,
workspaceConfigs: string[],
ideSettings: IdeSettings,
ideInfo: IdeInfo,
uniqueId: string,
@ -397,6 +399,7 @@ export async function loadContinueConfigFromYaml(
platformConfigMetadata: PlatformConfigMetadata | undefined,
controlPlaneClient: ControlPlaneClient,
configYamlPath: string | undefined,
orgScopeId: string | null,
): Promise<ConfigResult<ContinueConfig>> {
const rawYaml =
overrideConfigYaml === undefined
@ -407,11 +410,10 @@ export async function loadContinueConfigFromYaml(
: "";
const configYamlResult = await loadConfigYaml(
workspaceConfigs,
rawYaml,
overrideConfigYaml,
ide,
controlPlaneClient,
orgScopeId,
);
if (!configYamlResult.config || configYamlResult.configLoadInterrupted) {

View file

@ -1,12 +1,12 @@
{
"name": "continue",
"version": "1.1.13",
"version": "1.1.14",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "continue",
"version": "1.1.13",
"version": "1.1.14",
"license": "Apache-2.0",
"dependencies": {
"@continuedev/fetch": "^1.0.3",