Skip to content

feat: ORCID-canonical name + standardized profile (city/country required, affiliation, GitHub) — CLI + DB #835

Closed

Description

@neuromechanist

Summary

Now that ORCID SSO is live (#832), make ORCID the canonical source for a researcher's name and standardize the user profile. Users should never hand-type their name; it comes from ORCID. Add the profile fields we actually need, including export-control screening data.

Small DB change; the bulk of the work is on the CLI (signup/profile flow) plus a backend ORCID-capture tweak.

Profile fields (target shape on users)

Field Source Required
given_name, family_name ORCID (canonical, never hand-entered) yes (from ORCID)
email user yes (sign-in codes, notices)
city, country user yes — US export-control / sanctions screening
affiliation user optional (institution)
github_username user for dataset-repo collaboration (required to publish)

given_name/family_name already exist (migration 0051). This issue adds affiliation, city, country.

DB (small)

  • New migration: ALTER TABLE users ADD COLUMN affiliation TEXT; city TEXT; country TEXT; — additive, nullable (existing rows backfill later). "Required" is enforced at the app/CLI layer, not a NOT NULL constraint (avoids breaking existing rows + the SQLite rebuild).

Backend

  • ORCID OAuth: add the openid scope and read given_name / family_name from the id_token (the plain /authenticate token body only returns the full name, not the split). Persist them on the user row on find-or-create / link / finalize, so they refresh from ORCID on login.
  • Signup/onboarding finalize + any profile-update endpoint: require city + country.
  • Expose name + city/country on /auth/me (and the CLI profile endpoint) where needed.

CLI (the bulk of the work)

  • nemar auth signup: pull name from ORCID (stop prompting for it); prompt for city + country (required), affiliation (optional), confirm email, GitHub handle; submit.
  • nemar auth whoami / profile display: show the real name (given + family), not the username.
  • nemar profile (or equivalent) to view/update affiliation, city, country.
  • Validation: reject signup/update without city + country.

Why city/country are required

NEMAR is subject to US export-control / sanctions rules; collecting city + country lets us screen data access. This is a hard requirement, not optional.

Done means

  • A new user signs in with ORCID, never types their name, provides city/country (+ optional affiliation, GitHub handle), and the account stores ORCID-canonical name + the screening fields.
  • The existing handful of users are backfilled (manual, separate from this issue).
  • nemar auth whoami shows the real name.

Activity

  1. added a commit that references this issue on Jun 22, 2026
  2. added a commit that references this issue on Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions