-
Notifications
You must be signed in to change notification settings - Fork 528
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
refact(auth): cache login role in auth client to avoid sending rpc repeatedly #1507
Conversation
baef87f
to
e6452b5
Compare
hugegraph-api/src/main/java/com/baidu/hugegraph/auth/StandardAuthenticator.java
Show resolved
Hide resolved
Id usrname = IdGenerator.of(username); | ||
UserRoleCache userRole = this.usersRoleCache.getOrFetch(usrname, r -> { | ||
RolePermission rolePermission = this.graph().authManager() | ||
.loginUser(username, password); | ||
return new UserRoleCache(rolePermission, 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.
prefer to move to hugegraph auth proxy
e6452b5
to
bdb9ca4
Compare
Codecov Report
@@ Coverage Diff @@
## master #1507 +/- ##
============================================
+ Coverage 59.63% 59.67% +0.04%
- Complexity 6147 6151 +4
============================================
Files 410 410
Lines 33222 33255 +33
Branches 4588 4591 +3
============================================
+ Hits 19812 19846 +34
+ Misses 11343 11335 -8
- Partials 2067 2074 +7
Continue to review full report at Codecov.
|
bdb9ca4
to
4b816b6
Compare
Also enhance: - add time strategy to avoid old logs overwriting by current logs - auto create log folder if it does not exist - add some comment for auth config * use strict mode for config property & separate rest configs * reduce log format length * Update rest-server.properties * update all configs (TODO: push to other modules)
…peatedly TODO: also need be compatible with token way (consider put 'usrname + passwd' together into caches's key)
92625e9
to
87979ac
Compare
hugegraph-core/src/main/java/com/baidu/hugegraph/config/CoreOptions.java
Outdated
Show resolved
Hide resolved
ee060d0
to
9b93511
Compare
hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeAuthenticator.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeGraphAuthProxy.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeGraphAuthProxy.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/com/baidu/hugegraph/auth/HugeGraphAuthProxy.java
Outdated
Show resolved
Hide resolved
hugegraph-api/src/main/java/com/baidu/hugegraph/auth/StandardAuthenticator.java
Show resolved
Hide resolved
…peatedly fix: don't create Id every time perf: remove useless toLowerCase add config for expire time in auth client
…graph into cache-auth-client
before cache:
after cache in auth client: