Skip to content

Commit d0a5156

Browse files
committed
Merge remote-tracking branch 'origin/be/feature/RI-4454_Restrict_loopback' into be/feature/RI-4454_Restrict_loopback
2 parents 1c5b599 + efc5e72 commit d0a5156

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

redisinsight/api/src/modules/server/server.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class ServerService implements OnApplicationBootstrap {
5151
this.eventEmitter.emit(AppAnalyticsEvents.Initialize, {
5252
anonymousId: server.id,
5353
sessionId: this.sessionId,
54-
appType: this.getAppType(SERVER_CONFIG.buildType),
54+
appType: ServerService.getAppType(SERVER_CONFIG.buildType),
5555
...(await this.featuresConfigService.getControlInfo()),
5656
});
5757

@@ -86,7 +86,7 @@ export class ServerService implements OnApplicationBootstrap {
8686
appVersion: SERVER_CONFIG.appVersion,
8787
osPlatform: process.platform,
8888
buildType: SERVER_CONFIG.buildType,
89-
appType: this.getAppType(SERVER_CONFIG.buildType),
89+
appType: ServerService.getAppType(SERVER_CONFIG.buildType),
9090
encryptionStrategies: await this.encryptionService.getAvailableEncryptionStrategies(),
9191
fixedDatabaseId: REDIS_STACK_CONFIG?.id,
9292
...(await this.featuresConfigService.getControlInfo()),
@@ -99,7 +99,7 @@ export class ServerService implements OnApplicationBootstrap {
9999
}
100100
}
101101

102-
getAppType(buildType: string): AppType {
102+
static getAppType(buildType: string): AppType {
103103
switch (buildType) {
104104
case BuildType.DockerOnPremise:
105105
return AppType.Docker;

redisinsight/api/test/api/analytics/analytics.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
} from '../deps';
99
const { analytics } = deps;
1010

11-
1211
describe('Analytics', () => {
1312
requirements('rte.serverType=local');
1413

@@ -28,7 +27,7 @@ describe('Analytics', () => {
2827
const found = appStarted || appFirstStarted;
2928

3029
if (!found) {
31-
fail('APPLICATION_STARTED or APPLICATION_FIRST_START events were not found');
30+
expect.fail('APPLICATION_STARTED or APPLICATION_FIRST_START events were not found');
3231
}
3332

3433
expect(found?.properties).to.have.all.keys('appVersion', 'osPlatform', 'buildType', 'controlNumber', 'controlGroup', 'port');

redisinsight/api/test/api/cli/POST-databases-id-cli-uuid-send_command.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
validateApiCall,
1212
requirements, serverConfig
1313
} from '../deps';
14+
import { ServerService } from 'src/modules/server/server.service';
1415
const { server, request, constants, rte, analytics } = deps;
1516

1617
// endpoint to test
@@ -98,7 +99,7 @@ describe('POST /databases/:instanceId/cli/:uuid/send-command', () => {
9899
capability: 'string',
99100
command: 'SET',
100101
outputFormat: 'TEXT',
101-
buildType: serverConfig.get('server').buildType,
102+
buildType: ServerService.getAppType(serverConfig.get('server').buildType),
102103
},
103104
});
104105
}

redisinsight/api/test/api/database/POST-databases.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
generateInvalidDataTestCases, validateInvalidDataTestCase, getMainCheckFn, serverConfig,
1111
} from '../deps';
1212
import { databaseSchema } from './constants';
13+
import { ServerService } from 'src/modules/server/server.service';
1314
const { rte, request, server, localDb, constants, analytics } = deps;
1415

1516
const endpoint = () => request(server).post(`/${constants.API.DATABASES}`);
@@ -167,7 +168,7 @@ describe('POST /databases', () => {
167168
// RedisJSON: { loaded: false },
168169
// RedisTimeSeries: { loaded: false },
169170
// customModules: [],
170-
buildType: serverConfig.get('server').buildType,
171+
buildType: ServerService.getAppType(serverConfig.get('server').buildType),
171172
},
172173
});
173174
},

0 commit comments

Comments
 (0)