-
Notifications
You must be signed in to change notification settings - Fork 578
feat(server): LoginAPI support token_expire field #2754
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2754 +/- ##
============================================
- Coverage 41.18% 34.10% -7.09%
+ Complexity 333 264 -69
============================================
Files 747 747
Lines 60119 60123 +4
Branches 7676 7676
============================================
- Hits 24760 20504 -4256
- Misses 32772 37316 +4544
+ Partials 2587 2303 -284 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR adds support for a token_expire field to the LoginAPI by updating the loginUser method signatures and their usage across the API, core, and test modules. Key changes include:
- Updating the AuthManager and StandardAuthManager loginUser methods to accept an expiration value.
- Modifying the LoginAPI endpoint to extract and pass the token_expire parameter.
- Updating test cases in AuthTest to use the new loginUser method and replacing less idiomatic assertions.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/AuthTest.java | Updated tests to call loginUser with an expire parameter and improved assertions (e.g., using Assert.assertNull). |
| hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/auth/StandardAuthManager.java | Modified loginUser signature and repositioned the isLocal method with additional comments. |
| hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/auth/AuthManager.java | Updated the loginUser method signature to include the expire parameter. |
| hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/auth/HugeGraphAuthProxy.java | Adjusted loginUser invocations and refactored context handling. |
| hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/auth/LoginAPI.java | Updated the API to support the token_expire field during login. |
Comments suppressed due to low confidence (1)
hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/core/AuthTest.java:1381
- [nitpick] Consider extracting the literal 10080L into a named constant (e.g., TOKEN_EXPIRE) to improve clarity and maintainability in test cases.
authManager.loginUser("test", "pass", 10080L);
|
|
||
| @Override | ||
| public String loginUser(String username, String password) | ||
| public String loginUser(String username, String password, long expire) |
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.
Not used? At least we need add a TODO/comment for it
Purpose of the PR
Main Changes
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need