Skip to content

Conversation

@KrumTy
Copy link
Collaborator

@KrumTy KrumTy commented Feb 21, 2025

No description provided.

clientMetadata.databaseId,
{
databaseId: clientMetadata.databaseId,
...(infoCommandIsDisabled ? { info_command_is_disabled: true } : {}),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we will add isInfoCommandDisabled flag into RedisClient we can then avoid adding custom logic here and slightly simplify this. It become { isInfoComaandDisabled: client.isInfoCommandDisabled } or something similar

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, however I pass no key/value in case of false

if (error.message.includes(ERROR_MESSAGES.NO_INFO_COMMAND_PERMISSION)) {
try {
// Fallback to getting basic information from `hello` command
this.isInfoCommandDisabled = true;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you forgot to add this.isInfoCommandDisabled = true; into try black when info command wasn't fail.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.isInfoCommandDisabled = false I mean

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated default value and made it boolean; currently there's no need of a 3rd value

Copy link
Collaborator

@ArtemHoruzhenko ArtemHoruzhenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@KrumTy KrumTy merged commit cc96937 into feature/RI-6658/no-perm-info-command Feb 25, 2025
26 checks passed
@KrumTy KrumTy deleted the feature/RI-6848/no-info-analytics branch February 25, 2025 11:32
KrumTy added a commit that referenced this pull request Feb 26, 2025
* RI-6849: fallback to hello command when connecting to db

* RI-6849: refactor and test convertArrayOfKeyValuePairsToObject

* RI-6849: expose getRedisInfo method

* RI-6849: refactor getInfo method, expose from client

* remove convertArrayOfKeyValuePairsToObject

* fix failing unit test

* update test

* add default redis info

* update static value

* update default info

* update default info

* refactor getInfo

* fix failing test

* RI-6844: hide db overview metrics when data is not available (#4383)

* RI-6848: add info_command_is_disabled to analytics when INFO is disabled via ACL (#4390)

* RI-6848: add info_command_is_disabled to analytics when INFO is disabled via ACL

* add isInfoCommandDisabled prop to RedisClient

* preserve function signature

* set default value for isInfoCommandDisabled

* refactor getInfo

* update: always call HELLO if INFO fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants