Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Google Vertex Chat Model Node): Clean service account private key #10770

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,13 @@ export class LmChatGoogleVertex implements INodeType {
const results: Array<{ name: string; value: string }> = [];

const credentials = await this.getCredentials('googleApi');
const privateKey = (credentials.privateKey as string).replace(/\\n/g, '\n').trim();
burivuhster marked this conversation as resolved.
Show resolved Hide resolved
const email = (credentials.email as string).trim();

const client = new ProjectsClient({
credentials: {
client_email: credentials.email as string,
private_key: credentials.privateKey as string,
client_email: email,
private_key: privateKey,
},
});

Expand All @@ -123,6 +125,8 @@ export class LmChatGoogleVertex implements INodeType {

async supplyData(this: IExecuteFunctions, itemIndex: number): Promise<SupplyData> {
const credentials = await this.getCredentials('googleApi');
const privateKey = (credentials.privateKey as string).replace(/\\n/g, '\n').trim();
const email = (credentials.email as string).trim();

const modelName = this.getNodeParameter('modelName', itemIndex) as string;

Expand Down Expand Up @@ -153,8 +157,8 @@ export class LmChatGoogleVertex implements INodeType {
authOptions: {
projectId,
credentials: {
client_email: credentials.email as string,
private_key: credentials.privateKey as string,
client_email: email,
private_key: privateKey,
},
},
model: modelName,
Expand Down