-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Fix service crash caused by connecting using a pre-v2.6.0 client #3942
Conversation
dd44f0d
to
d6db366
Compare
@@ -13,7 +13,16 @@ PasswordAuthenticator::PasswordAuthenticator(meta::MetaClient* client) { | |||
} | |||
|
|||
Status PasswordAuthenticator::auth(const std::string& user, const std::string& password) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't modify auth
function, do it outside.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to pass the client addr into MetaClient::authCheckFromCache()
, and auth
is the middleware
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could add clientIp
to meta client in GraphService::auth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have passed clientIp in src/graph/service/GraphService.cpp line 122
Besides, the GraphService::auth()
in the enterprise version also has clientIp
as parameter. This should be fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
1dc8b3d
to
c3cc849
Compare
* Reject clients with a version lower than 2.6.0 * Add TTL for clientAddr_ * Fix tests * Use client_idle_timeout_secs as the clientAddrTimeout * Change the param of authCheckFromCache()
depends on client behavior, i.e. client should verify the version and then auth immediately. prefer to combine these two interfaces in the future.
|
* fix fix 0 file error (#3920) * Fix crash of null path expression. (#3915) * Fix crash of null path expression. * Add test case. Co-authored-by: jakevin <30525741+jackwener@users.noreply.github.com> * Change the name of source code zip (#3999) * Fix service crash caused by connecting using a pre-v2.6.0 client (#3942) * Reject clients with a version lower than 2.6.0 * Add TTL for clientAddr_ * Fix tests * Use client_idle_timeout_secs as the clientAddrTimeout * Change the param of authCheckFromCache() Co-authored-by: panda-sheep <59197347+panda-sheep@users.noreply.github.com> Co-authored-by: shylock <33566796+Shylock-Hg@users.noreply.github.com> Co-authored-by: jakevin <30525741+jackwener@users.noreply.github.com> Co-authored-by: Yichen Wang <18348405+Aiee@users.noreply.github.com>
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number:
Fix #3935
Description:
Fix service crash caused by connecting using a pre-v2.6.0 client.
Error message when connecting the v3.0.0 Nebula service with v2.5.0 console:
How do you solve it?
Add a flag in
mataClient
to record whether the client triggeredverifyClientVersion()
. If the client calledverifyClientVersion
, the client has a version >=v2.6.0
. Otherwise the client version is lower thanv2.5.0
.When doing
auth()
, check the IP address of the client to see if the client is later thanv2.5.0
. Return an error if the client version is lower thanv2.5.0
.Special notes for your reviewer, ex. impact of this fix, design document, etc:
Checklist:
Tests:
Affects:
Release notes:
Please confirm whether to be reflected in release notes and how to describe: