Skip to content

Commit b71c25f

Browse files
remove auth command logic from recommendation
1 parent 6e4f50d commit b71c25f

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -515,17 +515,6 @@ describe('RecommendationProvider', () => {
515515
.determineSetPasswordRecommendation(client);
516516
expect(setPasswordRecommendation).toEqual(null);
517517
});
518-
519-
it('should return setPassword recommendation when acl command executed with no password error',
520-
async () => {
521-
when(client.sendCommand)
522-
.calledWith(jasmine.arrayContaining(['auth']))
523-
.mockRejectedValue(mockRedisNoPasswordError);
524-
525-
const setPasswordRecommendation = await service
526-
.determineSetPasswordRecommendation(client);
527-
expect(setPasswordRecommendation).toEqual({ name: RECOMMENDATION_NAMES.SET_PASSWORD });
528-
});
529518
});
530519

531520
describe('determineRedisVersionRecommendation', () => {

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,6 @@ export class RecommendationProvider {
367367
async determineSetPasswordRecommendation(
368368
redisClient: RedisClient,
369369
): Promise<Recommendation> {
370-
if (await this.checkAuth(redisClient)) {
371-
return { name: RECOMMENDATION_NAMES.SET_PASSWORD };
372-
}
373-
374370
try {
375371
const users = await redisClient.sendCommand(
376372
['acl', 'list'],
@@ -438,17 +434,6 @@ export class RecommendationProvider {
438434
}
439435
}
440436

441-
private async checkAuth(redisClient: RedisClient): Promise<boolean> {
442-
try {
443-
await redisClient.sendCommand(['auth', 'pass']);
444-
} catch (err) {
445-
if (err.message.includes('Client sent AUTH, but no password is set')) {
446-
return true;
447-
}
448-
}
449-
return false;
450-
}
451-
452437
private async determineSearchIndexesForCluster(keys: Key[], client: RedisClient): Promise<RedisString> {
453438
let processedKeysNumber = 0;
454439
let keyName;

0 commit comments

Comments
 (0)