-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[server/fga] centralize lookup of findUserById #18382
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
53b6a2e
to
d9c935c
Compare
d9c935c
to
6c8712e
Compare
|
||
if (p) { | ||
if (p.userId) { |
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.
@svenefftinge I'm not sure why is it alright to remove this case? Because the property is going to be removed?
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.
it seems it was added for #5128
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.
Sorry, I should have added a comment here. We have removed personal projects and this was a left over. I will go through the code and see if we can remove the userID from project all together in a separate PR.
I still can find calls to userDB.findUserById in gitpod-sever-impl for admin* methods intentional? |
|
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 reviewed code and did a smoke test. It generally makes sense to me. Not sure how test impact on prebuilds, on first glance should be ok.
/hold
/unhold |
Description
We want to use
UserService#findUserById
as a central point for running the FGA migrations. In that light we need to make sure that our system is not bypassing the userServices (should do that anyway) and directly use theuserDb
.This PR replaces the usages of
UserDB#findUserByID
withUserService#findUserById
Summary generated by Copilot
🤖 Generated by Copilot at 53b6a2e
This pull request refactors various classes that deal with user-related operations to use the
UserService
andUserAuthentication
services instead of theUserDB
, to improve the consistency and reliability of the user data and the authorization logic. It also reorders some imports and adds error handling and logging where needed. The affected classes includeAuthenticator
,BearerAuth
,BitbucketApp
,BitbucketServerApp
,GithubApp
,GitHubEnterpriseApp
,GitLabApp
,SessionHandler
,UserController
, andGitpodServerImpl
.Related Issue(s)
Fixes EXP-286
How to test
In addition the unit tests I spun up a preview environment to verify that these changes don't break any user flows.
Documentation
Preview status
Gitpod was successfully deployed to your preview environment.
Build Options
Build
Run the build with werft instead of GHA
Run Leeway with
--dont-test
Publish
Installer
Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
If enabled this will build
install/preview
If enabled this will create the environment on GCE infra
Valid options are
all
,workspace
,webapp
,ide
,jetbrains
,vscode
,ssh
. If enabled,with-preview
andwith-large-vm
will be enabled./hold