Skip to content
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

Deprecate and remove USERS.USER_TYPE. #1064

Open
ibodrov opened this issue Jan 3, 2025 · 0 comments
Open

Deprecate and remove USERS.USER_TYPE. #1064

ibodrov opened this issue Jan 3, 2025 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ibodrov
Copy link
Collaborator

ibodrov commented Jan 3, 2025

Let's deprecate and remove USERS.USER_TYPE.

The value is currently used as a key for UserInfoProvider when retrieving UserInfo.
The original idea was to retrieve UserInfo using the provider determined on the user's first login, i.e. when the USERS record is created. Reasoning being that we needed UserInfo not only for the current user, but also for users that might not be currently logged in so we better save the original provider with the user entry.

Unfortunately, this scheme doesn't work for users that log in using multiple providers, e.g. same user logging in using LDAP today and OIDC tomorrow. There are already some situations when we swap USER_TYPES dynamically to match the current user's current realm.

I propose:

  • deprecate Java enum UserType and all its uses (drop/null the column eventually)
  • remove UserInfoProvider#create - user creation should be handled by UserManager, not by extension points
  • retrieve UserInfoProviders by using the current user's UserPrincipal#getRealm value and the only place where we should use UserInfoProviders directly are:
    • UserManager, when creating new user entries
    • when fetching UserInfo for the current user
  • all other places where we need UserInfo we should fetch it from the DB
  • provider-specific stuff like UserLdapGroupSynchronizer can still use "their own" UserInfoProviders freely whenever needed

Am I missing anything? Are there any other uses for USERS.USER_TYPE (besides being a confusing equivalent of UserPrincipal#getRealm)?

@ibodrov ibodrov added enhancement New feature or request help wanted Extra attention is needed labels Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Development

No branches or pull requests

1 participant