Skip to content

Require username - #456

Merged
annehaley merged 7 commits into
masterfrom
require-usernames
Aug 21, 2026
Merged

Require username#456
annehaley merged 7 commits into
masterfrom
require-usernames

Conversation

@annehaley

Copy link
Copy Markdown
Collaborator

Resolves #446

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 18, 2026

Copy link
Copy Markdown

Deploying geodatalytics with  Cloudflare Pages  Cloudflare Pages

Latest commit: 04728cf
Status: ✅  Deploy successful!
Preview URL: https://6ed4bfa7.geodatalytics.pages.dev
Branch Preview URL: https://require-usernames.geodatalytics.pages.dev

View logs

@annehaley
annehaley requested a review from BryonLewis August 18, 2026 17:54

@BryonLewis BryonLewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some comments/questions about this PR. Mostly notes that may be require a subsequent PR.

  • Just a reminder that we either need to create some sort of migration or manually make sure that all existing users that have username based on the email have it swapped to something that isn't their email, or remove all existing users.
  • When doing a GET /projects there is information about the owner including the username and is_superuser, should we prevent that information from being sent during this request? This information leaks through for non-authenticated users. This may be a bigger lift because I think you would have a response with the owner/collaborator/follower information removed for unauthenticated users because they never open the access control.
  • I question if the serializer should be returning is_superuser for most of the requests that contain users like project owners and user lists? Is it being used in the client anywhere? I think it's only used on the /users/me request. So access control doesn't need to leak who is a super user.
  • UserFactory/SuperUserFactory in the tests still use username = email which isn't true anymore after this. Technically it doesn't matter but it would probably be a better representation if username was used.

Comment thread web/src/components/projects/UserProfile.vue Outdated
@annehaley

Copy link
Copy Markdown
Collaborator Author
  • Just a reminder that we either need to create some sort of migration or manually make sure that all existing users that have username based on the email have it swapped to something that isn't their email, or remove all existing users.

I was planning on doing a manual update on the production instance via the admin console. We only have a handful of users anyway, and they're mostly Kitware folks.

  • When doing a GET /projects there is information about the owner including the username and is_superuser, should we prevent that information from being sent during this request? This information leaks through for non-authenticated users. This may be a bigger lift because I think you would have a response with the owner/collaborator/follower information removed for unauthenticated users because they never open the access control.
  • I question if the serializer should be returning is_superuser for most of the requests that contain users like project owners and user lists? Is it being used in the client anywhere? I think it's only used on the /users/me request. So access control doesn't need to leak who is a super user.

The only place we use is_superuser on the client side is for the computed permissions, so we only need that field for the response on the me endpoint. So I made a separate MeSerializer that includes the field and removed it from the standard UserSerializer: dbf029b

  • UserFactory/SuperUserFactory in the tests still use username = email which isn't true anymore after this. Technically it doesn't matter but it would probably be a better representation if username was used.

Changed in 04728cf.

@BryonLewis

Copy link
Copy Markdown
Collaborator

I may have been unclear in the one bullet point. A Non authenticated user when getting projects will also get the usernames of the owner/collaborator/followers for that user through the GET /projects endpoint. I mixed that together with the is_superuser question. Should we be allowing non-authenticated users to see the usernames in the system?

@annehaley

Copy link
Copy Markdown
Collaborator Author

I think that our goal for usernames going forward is that they do not contain sensitive information, and they serve as display names. First and last names would probably be considered more sensitive. An unauthenticated user would have to make direct API calls to get user information anyway, since we don't expose the project management interface in unauthenticated mode.

@BryonLewis
BryonLewis self-requested a review August 21, 2026 16:29

@BryonLewis BryonLewis left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@annehaley
annehaley merged commit 8a37b20 into master Aug 21, 2026
3 checks passed
@annehaley
annehaley deleted the require-usernames branch August 21, 2026 17:39
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

Successfully merging this pull request may close these issues.

Require unique usernames on signup

2 participants