@@ -17,7 +17,6 @@ import type { AbortSignal as NodeFetchAbortSignal } from 'node-fetch/externals';
1717import type { RequestInfo , RequestInit , Response } from 'node-fetch' ;
1818import nodeFetch from 'node-fetch' ;
1919import type { IntrospectInfo , AtlasUserInfo , AtlasServiceConfig } from './util' ;
20- import type { AtlasUserConfig } from './user-config-store' ;
2120import { throwIfAborted } from '@mongodb-js/compass-utils' ;
2221import type { HadronIpcMain } from 'hadron-ipc' ;
2322import { ipcMain } from 'hadron-ipc' ;
@@ -27,7 +26,6 @@ import {
2726} from '@mongodb-js/compass-logging' ;
2827import type { PreferencesAccess } from 'compass-preferences-model' ;
2928import { SecretStore } from './secret-store' ;
30- import { AtlasUserConfigStore } from './user-config-store' ;
3129import { OidcPluginLogger } from './oidc-plugin-logger' ;
3230import { spawn } from 'child_process' ;
3331import { getAtlasConfig } from './util' ;
@@ -93,8 +91,6 @@ export class CompassAuthService {
9391
9492 private static secretStore = new SecretStore ( ) ;
9593
96- private static atlasUserConfigStore = new AtlasUserConfigStore ( ) ;
97-
9894 private static ipcMain :
9995 | Pick < HadronIpcMain , 'createHandle' | 'handle' | 'broadcast' >
10096 | undefined = ipcMain ;
@@ -173,7 +169,6 @@ export class CompassAuthService {
173169 'isAuthenticated' ,
174170 'signIn' ,
175171 'signOut' ,
176- 'updateAtlasUserConfig' ,
177172 'maybeGetToken' ,
178173 ] ) ;
179174 }
@@ -233,12 +228,6 @@ export class CompassAuthService {
233228 this . oidcPluginLogger . on ( 'atlas-service-signed-out' , ( ) => {
234229 this . ipcMain ?. broadcast ( 'atlas-service-signed-out' ) ;
235230 } ) ;
236- this . oidcPluginLogger . on (
237- 'atlas-service-user-config-changed' ,
238- ( newConfig ) => {
239- this . ipcMain ?. broadcast ( 'atlas-service-user-config-changed' , newConfig ) ;
240- }
241- ) ;
242231 }
243232
244233 static async isAuthenticated ( {
@@ -381,34 +370,12 @@ export class CompassAuthService {
381370
382371 const userInfo = ( await res . json ( ) ) as AtlasUserInfo ;
383372
384- const userConfig = await this . atlasUserConfigStore . getUserConfig (
385- userInfo . sub
386- ) ;
387-
388- return { ...userInfo , ...userConfig } ;
373+ // TODO: Remove hadcoded `enabledAIFeature: true` when Atlas returns the actual value.
374+ return { ...userInfo , enabledAIFeature : true } ;
389375 } ) ( ) ;
390376 return this . currentUser ;
391377 }
392378
393- static async updateAtlasUserConfig ( {
394- config,
395- } : {
396- config : Partial < AtlasUserConfig > ;
397- } ) {
398- if ( ! this . currentUser ) {
399- throw new Error ( "Can't update user config when not logged in" ) ;
400- }
401- const newConfig = await this . atlasUserConfigStore . updateUserConfig (
402- this . currentUser . sub ,
403- config
404- ) ;
405- this . currentUser = {
406- ...this . currentUser ,
407- ...newConfig ,
408- } ;
409- this . oidcPluginLogger . emit ( 'atlas-service-user-config-changed' , newConfig ) ;
410- }
411-
412379 static async introspect ( {
413380 signal,
414381 tokenType,
0 commit comments