Fix signup username validation and CDM sidebar role gate#258
Open
dauglyon wants to merge 2 commits into
Open
Conversation
The frontend availability check compared availablename to username.toLowerCase(), so a username like "John" passed validation but was then rejected by auth2 for the uppercase letter. Inputs with characters auth2 strips (dots, hyphens, etc.) failed with a misleading "Username is not available" message. Mirror the kbase/auth2 NewUserName rules on the form: must start with a lowercase letter, only [a-z0-9_], no repeating or trailing underscores, at most 100 chars. Show a specific error for format violations and only treat availability mismatches as collisions.
The CDM nav item was gated on CDM_JUPYTERHUB_ADMIN, so only admins saw the link. Per the BERDL platform docs, BERDL_USER is the role that gates access to the lakehouse; CDM_JUPYTERHUB_ADMIN is a separate admin role for approving access requests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small fixes to authenticated-user UX.
kbase/auth2NewUserNamerules on the signup form: must start with a lowercase letter, only[a-z0-9_], no repeating or trailing underscores, ≤100 chars. Previously the availability check lowercased the input before comparing toavailablename, so e.g.Johnpassed the frontend check and then got rejected by the backend. Special-character inputs (John.Doe,bad-user, …) reported "Username is not available — Suggested: X" which was actually a format problem, not a collision. Now the form shows a specific format error and the submit stays blocked until the input matches the backend rules.CDM_JUPYTERHUB_ADMIN(admin only). Per the BERDL platform docs,BERDL_USERis the access role;CDM_JUPYTERHUB_ADMINis a separate admin role for approving access requests. Switch the gate so users withBERDL_USERsee the link.Test plan
John) — submit stays blocked, format error shown.bad-user,bad__user,baduser_,1baduser— submit stays blocked with format error.testuser) — submit proceeds to step 3.>100 chars shows the "must be at most 100 characters" error.BERDL_USERbut no admin role — CDM link visible in sidebar.BERDL_USER— CDM link not visible.npm test -- --testPathPattern='src/features/signup/'(9 pass, including 6 new parameterized cases).