Remove vertexai_service_account_json from oai_settings. And google.js.

a9d4988fc000c0c7cb37d337b056d9b29225cfd4

InterestingDarkness <computeridiot999@gmail.com>

2 files changed, +2 -19Showing whitespace changes
public/scripts/openai.js+0 -12
@@ -237,7 +237,6 @@ const sensitiveFields = [
237237 'custom_include_headers',
238238 'vertexai_project_id',
239239 'vertexai_region',
240- 'vertexai_service_account_json',
241240];
242241
243242/**
@@ -312,7 +311,6 @@ export const settingsToUpdate = {
312311 vertexai_auth_mode: ['#vertexai_auth_mode', 'vertexai_auth_mode', false, true],
313312 vertexai_project_id: ['#vertexai_project_id', 'vertexai_project_id', false, true],
314313 vertexai_region: ['#vertexai_region', 'vertexai_region', false, true],
315- vertexai_service_account_json: ['#vertexai_service_account_json', 'vertexai_service_account_json', false, true],
316314 use_alt_scale: ['#use_alt_scale', 'use_alt_scale', true, true],
317315 squash_system_messages: ['#squash_system_messages', 'squash_system_messages', true, false],
318316 image_inlining: ['#openai_image_inlining', 'image_inlining', true, false],
@@ -397,7 +395,6 @@ const default_settings = {
397395 vertexai_auth_mode: 'express',
398396 vertexai_project_id: '',
399397 vertexai_region: 'us-central1',
400- vertexai_service_account_json: '',
401398 use_alt_scale: false,
402399 squash_system_messages: false,
403400 image_inlining: false,
@@ -485,7 +482,6 @@ const oai_settings = {
485482 vertexai_auth_mode: 'express',
486483 vertexai_project_id: '',
487484 vertexai_region: 'us-central1',
488- vertexai_service_account_json: '',
489485 use_alt_scale: false,
490486 squash_system_messages: false,
491487 image_inlining: false,
@@ -3836,7 +3832,6 @@ async function saveOpenAIPreset(name, settings, triggerUi = true) {
38363832 vertexai_auth_mode: settings.vertexai_auth_mode,
38373833 vertexai_project_id: settings.vertexai_project_id,
38383834 vertexai_region: settings.vertexai_region,
3839- vertexai_service_account_json: settings.vertexai_service_account_json,
38403835 use_alt_scale: settings.use_alt_scale,
38413836 squash_system_messages: settings.squash_system_messages,
38423837 image_inlining: settings.image_inlining,
@@ -5586,10 +5581,6 @@ async function onVertexAIValidateServiceAccount() {
55865581 // Save to backend secret storage
55875582 await writeSecret(SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT, jsonContent);
55885583
5589- // Clear the textarea and update settings
5590- $('#vertexai_service_account_json').val('');
5591- oai_settings.vertexai_service_account_json = '';
5592-
55935584 // Show success status
55945585 updateVertexAIServiceAccountStatus(true, `Project: ${serviceAccount.project_id}, Email: ${serviceAccount.client_email}`);
55955586
@@ -5607,7 +5598,6 @@ async function onVertexAIValidateServiceAccount() {
56075598 */
56085599async function onVertexAIClearServiceAccount() {
56095600 $('#vertexai_service_account_json').val('');
5610- oai_settings.vertexai_service_account_json = '';
56115601
56125602 // Clear from backend secret storage
56135603 await writeSecret(SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT, '');
@@ -5622,8 +5612,6 @@ async function onVertexAIClearServiceAccount() {
56225612 */
56235613function onVertexAIServiceAccountJsonChange() {
56245614 const jsonContent = String($(this).val()).trim();
5625- // Don't save to settings automatically - only save when validated
5626- // oai_settings.vertexai_service_account_json = jsonContent;
56275615
56285616 if (jsonContent) {
56295617 // Auto-validate when content is pasted
src/endpoints/google.js+2 -7
@@ -31,13 +31,8 @@ export async function getVertexAIAuth(request) {
3131 }
3232 throw new Error('API key is required for Vertex AI Express mode');
3333 } else if (authMode === 'full') {
3434 // Try to getGet service account JSON from backend storage first
3535 letconst serviceAccountJson = readSecret(request.user.directories, SECRET_KEYS.VERTEXAI_SERVICE_ACCOUNT);
36-
37- // If not found in backend storage, try from request body (for backward compatibility)
38- if (!serviceAccountJson) {
39- serviceAccountJson = request.body.vertexai_service_account_json;
40- }
4136
4237 if (serviceAccountJson) {
4338 try {