Skip to content

Commit 6b1ba84

Browse files
#RI-3972 - fix test
1 parent aeffc00 commit 6b1ba84

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

redisinsight/api/src/modules/recommendation/providers/recommendation.provider.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -285,32 +285,6 @@ export class RecommendationProvider {
285285
}
286286
}
287287

288-
/**
289-
* Check set password recommendation
290-
* @param redisClient
291-
*/
292-
293-
async determineSetPasswordRecommendation(
294-
redisClient: Redis | Cluster,
295-
): Promise<Recommendation> {
296-
if (await this.checkAuth(redisClient)) {
297-
return { name: RECOMMENDATION_NAMES.SET_PASSWORD };
298-
}
299-
300-
try {
301-
const users = await redisClient.sendCommand(
302-
new Command('acl', ['list'], { replyEncoding: 'utf8' }),
303-
) as string[];
304-
305-
const nopassUser = users.some((user) => user.split(' ')[3] === 'nopass');
306-
307-
return nopassUser ? { name: RECOMMENDATION_NAMES.SET_PASSWORD } : null;
308-
} catch (err) {
309-
this.logger.error('Can not determine set password recommendation', err);
310-
return null;
311-
}
312-
}
313-
314288
/**
315289
* Check RTS recommendation
316290
* @param redisClient
@@ -414,6 +388,32 @@ export class RecommendationProvider {
414388
}
415389
}
416390

391+
/**
392+
* Check set password recommendation
393+
* @param redisClient
394+
*/
395+
396+
async determineSetPasswordRecommendation(
397+
redisClient: Redis | Cluster,
398+
): Promise<Recommendation> {
399+
if (await this.checkAuth(redisClient)) {
400+
return { name: RECOMMENDATION_NAMES.SET_PASSWORD };
401+
}
402+
403+
try {
404+
const users = await redisClient.sendCommand(
405+
new Command('acl', ['list'], { replyEncoding: 'utf8' }),
406+
) as string[];
407+
408+
const nopassUser = users.some((user) => user.split(' ')[3] === 'nopass');
409+
410+
return nopassUser ? { name: RECOMMENDATION_NAMES.SET_PASSWORD } : null;
411+
} catch (err) {
412+
this.logger.error('Can not determine set password recommendation', err);
413+
return null;
414+
}
415+
}
416+
417417
private async checkAuth(redisClient: Redis | Cluster): Promise<boolean> {
418418
try {
419419
await redisClient.sendCommand(

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ describe('POST /databases/:instanceId/analysis', () => {
209209
].map(mainCheckFn);
210210
});
211211

212-
213212
describe('redisVersion recommendation', () => {
214213
requirements('rte.version <= 6');
215214
[

0 commit comments

Comments
 (0)