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

Clean distinction between UID database column and USERNAME database column? #189

Open
rotdrop opened this issue Aug 22, 2023 · 1 comment

Comments

@rotdrop
Copy link
Contributor

rotdrop commented Aug 22, 2023

Hi there,

reading the source code I have the impression that the use of the UID column and the USERNAME column got somewhat mingled in the code. My understanding is the following (?):

  • UID column is only used internally in THIS app in order to have a fast index in the users table and a fast join column to map users to groups
  • USERNAME is actually the Nextcloud UID (i.e. User::getUID()) and thus is a string value

I now see some problems:

  • e.g. in GroupBackend::usersInGroup() the internal UID column is passed back to Nextcloud. Should not this be a list of username values, i.e. the list of Nextcloud-UID?
    $uids = $this->groupRepository->findAllUidsBySearchTerm(
  • as stated in confusion between uid and name #184 a similar problem occurs with the BELONGS_TO_ADMIN query which is used by GroupBackend::isAdmin().

This also means that perhaps the example given in README.md cannot work this way, as that one has exactly this setup?

I have also the impression that the search queries generally use the Nextcloud-UID (i.e. username) to find rows, but query the values of the user_sql::uid column.

OTOH, the password check routines in this app use the username column to verify the password, but all other parts of the code search the user_sql::uid column, but pass search terms from the Nextcloud UID (which should refer to the user_sql::username column?).

@rotdrop
Copy link
Contributor Author

rotdrop commented Aug 22, 2023

So my primary question is: what was the intended purpose of the username column?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant