Skip to content

Commit fb01904

Browse files
authored
chore(atlas-service): update atlas service endpoint to mms qa COMPASS-7187 (#4876)
1 parent 7c0d46a commit fb01904

File tree

6 files changed

+14
-3
lines changed

6 files changed

+14
-3
lines changed

packages/atlas-service/src/main.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ describe('AtlasServiceMain', function () {
5959

6060
const defaultConfig = {
6161
atlasApiBaseUrl: 'http://example.com',
62+
atlasApiUnauthBaseUrl: 'http://example.com/unauth',
6263
atlasLogin: {
6364
issuer: 'http://example.com',
6465
clientId: '1234abcd',

packages/atlas-service/src/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ export function getTrackingUserInfo(userInfo: AtlasUserInfo) {
128128

129129
export type AtlasServiceConfig = {
130130
atlasApiBaseUrl: string;
131+
atlasApiUnauthBaseUrl: string;
131132
atlasLogin: {
132133
clientId: string;
133134
issuer: string;
@@ -545,7 +546,7 @@ export class AtlasService {
545546
const userId = (await this.getActiveCompassUser()).id;
546547

547548
const res = await this.fetch(
548-
`${this.config.atlasApiBaseUrl}/unauth/ai/api/v1/hello/${userId}`
549+
`${this.config.atlasApiUnauthBaseUrl}/ai/api/v1/hello/${userId}`
549550
);
550551

551552
await throwIfNotOk(res);

packages/compass-e2e-tests/tests/collection-ai-query.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe('Collection ai query', function () {
4040
setMockAtlasServerResponse = _setMockAtlasServerResponse;
4141

4242
process.env.COMPASS_ATLAS_SERVICE_BASE_URL_OVERRIDE = endpoint;
43+
process.env.COMPASS_ATLAS_SERVICE_UNAUTH_BASE_URL_OVERRIDE = endpoint;
4344

4445
telemetry = await startTelemetryServer();
4546
compass = await beforeTests({

packages/compass-preferences-model/src/preferences.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ export const storedUserPreferencesProps: Required<{
632632
},
633633
/**
634634
* Chooses atlas service backend configuration from preset
635-
* - compas-dev: locally running compass kanopy backend (localhost)
635+
* - compass-dev: locally running compass kanopy backend (localhost)
636636
* - compass: compass kanopy backend (compass.mongodb.com)
637637
* - atlas-dev: dev mms backend (cloud-dev.mongodb.com)
638638
* - atlas: mms backend (cloud.mongodb.com)
@@ -646,7 +646,7 @@ export const storedUserPreferencesProps: Required<{
646646
},
647647
validator: z
648648
.enum(['compass-dev', 'compass', 'atlas-dev', 'atlas'])
649-
.default('compass'),
649+
.default('atlas-dev'),
650650
type: 'string',
651651
},
652652

packages/compass/src/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ declare module 'process' {
3333
HADRON_METRICS_SEGMENT_HOST?: string;
3434
HADRON_AUTO_UPDATE_ENDPOINT: string;
3535
COMPASS_ATLAS_SERVICE_BASE_URL_OVERRIDE?: string;
36+
COMPASS_ATLAS_SERVICE_UNAUTH_BASE_URL_OVERRIDE?: string;
3637
COMPASS_CLIENT_ID_OVERRIDE?: string;
3738
COMPASS_OIDC_ISSUER_OVERRIDE?: string;
3839
COMPASS_ATLAS_AUTH_PORTAL_URL_OVERRIDE?: string;

packages/compass/src/main/application.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ class CompassApplication {
112112
const config = {
113113
'compass-dev': {
114114
atlasApiBaseUrl: 'http://localhost:8080',
115+
atlasApiUnauthBaseUrl: 'http://localhost:8080',
115116
atlasLogin: {
116117
clientId: '0oajzdcznmE8GEyio297',
117118
issuer: 'https://auth.mongodb.com/oauth2/default',
@@ -120,6 +121,7 @@ class CompassApplication {
120121
},
121122
compass: {
122123
atlasApiBaseUrl: 'https://compass.mongodb.com',
124+
atlasApiUnauthBaseUrl: 'https://compass.mongodb.com',
123125
atlasLogin: {
124126
clientId: '0oajzdcznmE8GEyio297',
125127
issuer: 'https://auth.mongodb.com/oauth2/default',
@@ -128,6 +130,8 @@ class CompassApplication {
128130
},
129131
'atlas-dev': {
130132
atlasApiBaseUrl: 'https://cloud-dev.mongodb.com/api/private',
133+
atlasApiUnauthBaseUrl:
134+
'https://cloud-dev.mongodb.com/api/private/unauth',
131135
atlasLogin: {
132136
clientId: '0oaq1le5jlzxCuTbu357',
133137
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
@@ -136,6 +140,7 @@ class CompassApplication {
136140
},
137141
atlas: {
138142
atlasApiBaseUrl: 'https://cloud.mongodb.com/api/private',
143+
atlasApiUnauthBaseUrl: 'https://cloud.mongodb.com/api/private/unauth',
139144
atlasLogin: {
140145
clientId: '0oajzdcznmE8GEyio297',
141146
issuer: 'https://auth.mongodb.com/oauth2/default',
@@ -149,6 +154,8 @@ class CompassApplication {
149154
const atlasServiceConfig = defaultsDeep(
150155
{
151156
atlasApiBaseUrl: process.env.COMPASS_ATLAS_SERVICE_BASE_URL_OVERRIDE,
157+
atlasApiUnauthBaseUrl:
158+
process.env.COMPASS_ATLAS_SERVICE_UNAUTH_BASE_URL_OVERRIDE,
152159
atlasLogin: {
153160
clientId: process.env.COMPASS_CLIENT_ID_OVERRIDE,
154161
issuer: process.env.COMPASS_OIDC_ISSUER_OVERRIDE,

0 commit comments

Comments
 (0)