Skip to content

Unverified ORCID blocks the upload access request - #312

Merged
neuromechanist merged 4 commits into
stagingfrom
feature/orcid-verified-gap
Sep 6, 2026
Merged

neuromechanist merged 4 commits into
stagingfrom
feature/orcid-verified-gap

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Adds a new row to the profile-gap matrix: an unverified ORCID iD now blocks the upload-access request, blocks: ["upload_access"] only, positioned immediately after family_name and before github_username in src/lib/profile-gaps.ts.

The gap is present when the account's orcid_verified is not true and its role is neither admin nor owner (a missing role counts as a regular user, never as exempt). ProfileGapAccount.role is widened to accept both the session's collapsed "user" | "admin" and the admin surfaces' uncollapsed AdminUserRole ("owner" | "admin" | "member" | null), and gapAccountFromDetail now threads the admin detail row's raw role through.

In practice this row only ever fires for a CLI-created account: ORCID OAuth is the website's only account-creation path (ADR 0008), so every web signup already carries a verified iD. Both role and orcid_verified are already on /auth/me (AuthUser.role, AuthUser.orcid_verified in src/lib/auth.ts, parsed by parseAuthMeResponse), so the field is fully derivable client-side and needed no non-derivable fallback.

Copy keys added to src/lib/account-copy.ts, next to the other gap.field.* keys in the same order as the matrix: gap.field.orcid_verified.label ("Verified ORCID iD"), gap.field.orcid_verified.set_on.web ("Settings"), gap.field.orcid_verified.set_on.cli ("nemar auth profile orcid link").

The href is /settings#orcid-card, the existing ORCID card's id (website#128/#132) — Settings already rendered an unlinked state with a "Connect your ORCID" action, so nothing new was added there. That link's query string now explicitly carries mode=link, the documented linking entry point per nemar-cli's backend/src/routes/auth-orcid.ts; behavior was already correct for a signed-in session because the callback links to whichever account the session cookie resolves to regardless of mode, so this is a contract-matching fix rather than a bug fix. The relink flow (mode=relink, POST-only, ADR 0022) is untouched.

ADR 0015 gets an ## Update section recording the new row, the role exemption and its rationale (operator accounts predate any web-signup path of their own; exemption is interim until nemar-cli's service-account kind, epic nemar-cli#1272, lands).

Tests extend src/lib/profile-gaps.test.ts (new orcid_verified sweep member plus dedicated present/absent/role-exemption/order tests), src/lib/users-admin-api.test.ts (role passthrough and gap suppression via gapAccountFromDetail), and test/account-tiers-ui.test.ts (anchor-id coverage). bun run lint, bun run typecheck, and bun run test all pass (2033 tests, 84 files); the account-copy drift test soft-skips locally with no nemar-cli contract checkout present, as expected until the mirrored nemar-cli PR lands.

This mirrors an identical spec being implemented on nemarOrg/nemar-cli (epic #1250, Phase 9 sub-issue #1271) and must merge to staging before that side lands, since nemar-cli's parity test fails on any non-cli.-prefixed key this repo lacks.

Test plan

  • bun run lint
  • bun run typecheck
  • bun run test (2033 passed / 84 files)
  • Manual: visit /settings with a CLI-created, unverified-ORCID account and confirm the gap renders with a working link to the ORCID card

Unverified ORCID iD now blocks upload access (CLI-only in
practice; web signup always verifies via ORCID OAuth). Admin
and owner roles are exempt, interim until service accounts.
Matches the documented linking entry point; behavior was
already correct for a signed-in session via the fallback.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Deploying nemar-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: c24aec1
Status: ✅  Deploy successful!
Preview URL: https://f3666c72.nemar-website.pages.dev
Branch Preview URL: https://feature-orcid-verified-gap.nemar-website.pages.dev

View logs

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.

1 participant