Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -515,17 +515,6 @@ describe('RecommendationProvider', () => {
.determineSetPasswordRecommendation(client);
expect(setPasswordRecommendation).toEqual(null);
});

it('should return setPassword recommendation when acl command executed with no password error',
async () => {
when(client.sendCommand)
.calledWith(jasmine.arrayContaining(['auth']))
.mockRejectedValue(mockRedisNoPasswordError);

const setPasswordRecommendation = await service
.determineSetPasswordRecommendation(client);
expect(setPasswordRecommendation).toEqual({ name: RECOMMENDATION_NAMES.SET_PASSWORD });
});
});

describe('determineRedisVersionRecommendation', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,10 +367,6 @@ export class RecommendationProvider {
async determineSetPasswordRecommendation(
redisClient: RedisClient,
): Promise<Recommendation> {
if (await this.checkAuth(redisClient)) {
return { name: RECOMMENDATION_NAMES.SET_PASSWORD };
}

try {
const users = await redisClient.sendCommand(
['acl', 'list'],
Expand Down Expand Up @@ -438,17 +434,6 @@ export class RecommendationProvider {
}
}

private async checkAuth(redisClient: RedisClient): Promise<boolean> {
try {
await redisClient.sendCommand(['auth', 'pass']);
} catch (err) {
if (err.message.includes('Client sent AUTH, but no password is set')) {
return true;
}
}
return false;
}

private async determineSearchIndexesForCluster(keys: Key[], client: RedisClient): Promise<RedisString> {
let processedKeysNumber = 0;
let keyName;
Expand Down