Skip to content

Signup fixes, Lakehouse sidebar link, and CI login fix - #258

Merged
dauglyon merged 6 commits into
mainfrom
fix/signup-validation-and-cdm-gate
Sep 10, 2026
Merged

dauglyon merged 6 commits into
mainfrom
fix/signup-validation-and-cdm-gate

Conversation

@dauglyon

@dauglyon dauglyon commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three small fixes around signup, the Lakehouse sidebar link, and a CI fix.

  • Signup username validation: Mirror the kbase/auth2 NewUserName rules on the signup form: must start with a lowercase letter, only [a-z0-9_], no repeating or trailing underscores, ≤100 chars. The availability check previously compared availablename to username.toLowerCase(), so inputs like John passed the frontend check and were then 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 submit stays blocked until the input matches the backend rules.
  • Skip user<N> pre-fill on ORCID signup: ORCID's provider-supplied username is the numeric ORCID iD (e.g. 0000-0002-1825-0097). auth2's NewUserName.sanitizeName strips all of that to empty and getAvailableUserName falls back to the literal user<N> (see Authentication.java:1185-1196 and DEFAULT_SUGGESTED_USER_NAME). The signup form was pre-populating the username field with user1/user2/etc. for every ORCID signup. Leave the field blank when the provider is OrcID so the user picks their own. Display name and email pre-fill from ORCID are unchanged.
  • Lakehouse sidebar link role gate: The nav item was gated on CDM_JUPYTERHUB_ADMIN (admin only). The hub gates login on its APPROVED_ROLES list, which every BERDL repo and the spark_notebook user guide set to BERDL_USER; CDM_JUPYTERHUB_ADMIN remains the separate approver role. Switch the gate so users with BERDL_USER see the link. The KIND*AI routing roles (KBASE_STAFF, BERDL_KIND_USER) only pick the post-login landing page and are not used here.
  • Rename CDM → Lakehouse: The link goes to hub.berdl.kbase.us. Rename the nav label, route (/lakehouse/redirect), component (LakehouseRedirect), deploy config key (lakehouse_domain), and build env var (REACT_APP_KBASE_LAKEHOUSE_DOMAIN). The CI hub's login page (kbase/cdm-jupyterhub templates/login.html) still links to /cdm/redirect, so that path redirects to the new route.
  • CI: log in to GHCR with the workflow token: kbase/.github#70 (2026-04-10) removed the kbase-bot GHCR_TOKEN from the org and moved the shared build-push workflow to github.token. This repo's local copy of that workflow still used the secret, so every PR build since then failed at "Login to GHCR" before lint, tests, or the image build ran. Switch to github.actor/github.token with packages: write, matching the org workflow.

Test plan

Signup username validation

  • Signup with a username containing an uppercase letter (e.g. John) — submit stays blocked, format error shown.
  • Signup with bad-user, bad__user, baduser_, 1baduser — submit stays blocked with format error.
  • Signup with a valid lowercased username (e.g. testuser) — submit proceeds to step 3.
  • Username > 100 chars shows the "must be at most 100 characters" error.

ORCID signup pre-fill

  • Start signup via ORCID — username field is empty (not user1).
  • Start signup via Google/Globus/another provider — username field is still pre-filled from availablename.
  • Display name and email are still pre-filled from the ORCID identity.

Lakehouse sidebar link

  • Log in as a user with BERDL_USER but no admin role — Lakehouse link visible in sidebar.
  • Log in as a user without BERDL_USER — Lakehouse link not visible.
  • Clicking the link lands on /lakehouse/redirect and then the hub.
  • Visiting /cdm/redirect lands on /lakehouse/redirect.

CI

  • "Build and Push Images" passes end to end on this branch (login, lint, tests, multi-environment build, image push).

Unit tests

  • npm run lint:strict, CI=true npm test . (302 tests), npm run build — all exit 0 under Node 20.11.1.

dauglyon added 3 commits May 29, 2026 15:32
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.
ORCID's provider-supplied username is the numeric ORCID iD (e.g.
0000-0002-1825-0097). auth2's NewUserName.sanitizeName strips all of
that to empty and getAvailableUserName falls back to user<N>, so every
ORCID signup landed on the form with user1 (or user2, ...) already in
the username field.

Leave the username blank when the provider is OrcID so the user picks
their own. Display name and email pre-fill are unchanged.
@dauglyon dauglyon changed the title Fix signup username validation and CDM sidebar role gate Signup fixes: username validation, ORCID pre-fill, and CDM sidebar role gate Jun 1, 2026
The link goes to hub.berdl.kbase.us, the BERDL JupyterHub. Rename the nav
label, route, component, deploy config key, and build env var to match.
The CI hub's login page (kbase/cdm-jupyterhub) still links to
/cdm/redirect, so that path redirects to the new route.
@dauglyon dauglyon changed the title Signup fixes: username validation, ORCID pre-fill, and CDM sidebar role gate Signup fixes: username validation, ORCID pre-fill, and BERDL sidebar link Sep 10, 2026
kbase/.github#70 (2026-04-10) removed the kbase-bot GHCR_TOKEN from the org
and moved the shared build-push workflow to github.token. This repo's local
copy of that workflow still used the secret, so every build since has failed
at the login step before lint, tests, or the image build ran.
Lakehouse is the user-facing name for hub.berdl.kbase.us. Rename the nav
label, route, component, deploy config key, and build env var to match;
/cdm/redirect still redirects to the new route.
@dauglyon dauglyon changed the title Signup fixes: username validation, ORCID pre-fill, and BERDL sidebar link Signup fixes, Lakehouse sidebar link, and CI login fix Sep 10, 2026

@briehl briehl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@dauglyon
dauglyon merged commit 50e2e5f into main Sep 10, 2026
4 checks passed
@dauglyon
dauglyon deleted the fix/signup-validation-and-cdm-gate branch September 10, 2026 21:08
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.

2 participants