Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow default username and fix case sensitive check in HELLO #1406

Merged
merged 2 commits into from
Apr 29, 2023

Conversation

rueian
Copy link
Contributor

@rueian rueian commented Apr 28, 2023

Hi, following the conversation #1403

This PR makes the HELLO command:

  1. accept the default username as well.
  2. use case insensitive check on the AUTH and SETNAME. Clients may send these options in lower or upper cases. For example, go-redis sends them in lower cases.

I think this PR won't break any existing Kvrocks clients but will remove barriers for other clients to adapt Kvrocks by aligning HELLO syntax with Redis.

Please let me know if these changes make sense.

PragmaTwice
PragmaTwice previously approved these changes Apr 28, 2023
Copy link
Member

@PragmaTwice PragmaTwice left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for your contribution!

torwig
torwig previously approved these changes Apr 28, 2023
tisonkun
tisonkun previously approved these changes Apr 29, 2023
Copy link
Member

@tisonkun tisonkun left a comment

Choose a reason for hiding this comment

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

Thank you! One comment to convey the background discussion into code.

@@ -657,7 +657,7 @@ class CommandTime : public Commander {
}
};

/* HELLO [<protocol-version> [AUTH <password>] [SETNAME <name>] ] */
/* HELLO [<protocol-version> [AUTH [<password>|<username> <password>]] [SETNAME <name>] ] */
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps add a comment that username should be always default otherwise it fails. And such syntax is for compatible only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure!

…check with HELLO options

Signed-off-by: Rueian <rueiancsie@gmail.com>
@rueian rueian dismissed stale reviews from tisonkun, torwig, and PragmaTwice via d1d6507 April 29, 2023 01:09
@rueian rueian force-pushed the hello-auth-with-username branch from 0399a1f to d1d6507 Compare April 29, 2023 01:09
Copy link
Member

@git-hulk git-hulk left a comment

Choose a reason for hiding this comment

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

LGTM

@PragmaTwice PragmaTwice linked an issue Apr 29, 2023 that may be closed by this pull request
2 tasks
@PragmaTwice PragmaTwice changed the title Allow default username in the AUTH part of HELLO, Fix case sensitive check with HELLO options Allow default username and fix case sensitive check in HELLO Apr 29, 2023
@PragmaTwice
Copy link
Member

Merging. Thanks for your contribution.

@PragmaTwice PragmaTwice merged commit c2c0564 into apache:unstable Apr 29, 2023
@mapleFU
Copy link
Member

mapleFU commented Apr 29, 2023

Seems that only "hello" support authenticate with user, should https://redis.io/commands/auth/ support that?

@PragmaTwice
Copy link
Member

Seems that only "hello" support authenticate with user, should https://redis.io/commands/auth/ support that?

I think it is not urgent as HELLO, since HELLO in redis just does not allow the username to be omitted, but AUTH password is valid in redis.

@mapleFU
Copy link
Member

mapleFU commented Apr 29, 2023

Ok, reasonable. LGTM!

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.

Syntax of HELLO is different from Redis
6 participants