Repository navigation
Unverified ORCID blocks the upload access request - #312
Merged
Merged
Conversation
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.
Deploying nemar-website with
|
| 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 |
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.
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 afterfamily_nameand beforegithub_usernameinsrc/lib/profile-gaps.ts.The gap is present when the account's
orcid_verifiedis nottrueand its role is neitheradminnorowner(a missing role counts as a regular user, never as exempt).ProfileGapAccount.roleis widened to accept both the session's collapsed"user" | "admin"and the admin surfaces' uncollapsedAdminUserRole("owner" | "admin" | "member" | null), andgapAccountFromDetailnow 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
roleandorcid_verifiedare already on/auth/me(AuthUser.role,AuthUser.orcid_verifiedinsrc/lib/auth.ts, parsed byparseAuthMeResponse), 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 othergap.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 carriesmode=link, the documented linking entry point per nemar-cli'sbackend/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 ofmode, 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
## Updatesection 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(neworcid_verifiedsweep member plus dedicated present/absent/role-exemption/order tests),src/lib/users-admin-api.test.ts(role passthrough and gap suppression viagapAccountFromDetail), andtest/account-tiers-ui.test.ts(anchor-id coverage).bun run lint,bun run typecheck, andbun run testall 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 tostagingbefore that side lands, since nemar-cli's parity test fails on any non-cli.-prefixed key this repo lacks.Test plan
bun run lintbun run typecheckbun run test(2033 passed / 84 files)/settingswith a CLI-created, unverified-ORCID account and confirm the gap renders with a working link to the ORCID card