-
Notifications
You must be signed in to change notification settings - Fork 1.3k
read user.uuid from DB #12632
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
base: 4.20
Are you sure you want to change the base?
read user.uuid from DB #12632
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #12632 +/- ##
=========================================
Coverage 16.25% 16.25%
- Complexity 13421 13423 +2
=========================================
Files 5662 5662
Lines 500141 500141
Branches 60728 60728
=========================================
+ Hits 81299 81310 +11
+ Misses 409759 409747 -12
- Partials 9083 9084 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ 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 addresses issue #12612 where API-key authentication could yield a different (random) user UUID per request, by ensuring the user’s UUID is read from the database and propagated into the User object used in auth/context.
Changes:
- Update the
FIND_USER_ACCOUNT_BY_API_KEYquery and result mapping to include and setu.uuid. - Adjust
UserVO(long id)initialization to delegate to the no-arg constructor. - Extend the
com.cloud.user.Userinterface to includesetUuid(String).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| engine/schema/src/main/java/com/cloud/user/dao/AccountDaoImpl.java | Adds UUID to the API-key lookup query and maps it into the User instance. |
| engine/schema/src/main/java/com/cloud/user/UserVO.java | Changes the UserVO(long id) constructor to call this() before setting id. |
| api/src/main/java/com/cloud/user/User.java | Adds setUuid(String uuid) to the User interface. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
engine/schema/src/main/java/com/cloud/user/dao/AccountDaoImpl.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
abh1sar
left a comment
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.
code LGTM
sureshanaparti
left a comment
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.
clgtm
|
@DaanHoogland |
no doubt, but can you be more specific? Do you mean, bypass Note |
@DaanHoogland |


Description
This PR implements the reporters suggestion as requested...
Fixes: #12612
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?