Skip to content

STUDY_ALLOW: route only the listed studies - #506

Merged
alisman merged 1 commit into
masterfrom
study-allow
Nov 29, 2026
Merged

alisman merged 1 commit into
masterfrom
study-allow

Conversation

@alisman

@alisman alisman commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

What

A new STUDY_ALLOW setting: a comma- or space-separated list of study ids. When it's set, isRestrictedStudy() treats every study not on the list as restricted. That means those studies are never routed, so no surface can reach them (the study picker, a ?doc= link, a federation call), the same way STUDY_DENY excludes studies.

  • A listed study is still subject to STUDY_DENY and the restricted-name rule.
  • STUDY_ALLOW_RESTRICTED=1 doesn't widen the list.
  • Unset or empty, behaviour is unchanged.

It's editable in /admin and validated like STUDY_DENY. Documented in docs/ENVIRONMENT.md.

Why

The MSK deployment (cbiolab.cbioportal.aws.mskcc.org) now reads the full MSK portal database, which holds ~1,700 studies, but should only serve mskimpact and msktarget. A deny list would have to name every other study and would let new ones through; an allow list doesn't.

Verified

  • test/study-allow.test.ts: a table of 11 cases (listed / not listed / prefix isn't a match / STUDY_DENY still wins / restricted names stay restricted). Removing the new check makes 3 of them fail.
  • test/settings-overrides.test.ts: STUDY_ALLOW validation (refuses a bad id, accepts a list and empty).
  • npm test on this branch matches master: the same 8 failures on both (materialized-statement and snapshot tests that depend on my local environment), plus 11 new passing tests.
  • eslint and tsc --noEmit clean.

🤖 Generated with Claude Code


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

A deployment could exclude studies (STUDY_DENY) but not limit itself to a
few. STUDY_ALLOW, when set, makes isRestrictedStudy() treat every study it
doesn't list as restricted, so those studies are never routed and no surface
can reach them, the same way STUDY_DENY excludes studies. A listed study is
still subject to STUDY_DENY and the restricted-name rule, and
STUDY_ALLOW_RESTRICTED does not widen the list. Unset or empty, nothing
changes.

It is an /admin-editable setting validated like STUDY_DENY.

Verified: test/study-allow.test.ts covers each case (11 tests); removing the
new check makes 3 of them fail. settings-overrides covers validation. npm
test otherwise matches master (the same 8 environment-dependent failures on
both), eslint and tsc are clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cbiolab-genie Ready Ready Preview Nov 29, 2026 10:23pm UTC
cbiolab-new Ready Ready Preview Nov 29, 2026 10:23pm UTC
cohort-lab Ready Ready Preview Nov 29, 2026 10:23pm UTC

Request Review

@alisman
alisman enabled auto-merge November 29, 2026 23:05
@alisman
alisman disabled auto-merge November 29, 2026 23:05
@alisman
alisman merged commit efc3dac into master Nov 29, 2026
9 of 13 checks passed
@alisman
alisman deleted the study-allow branch November 29, 2026 23:05

This branch was successfully deployed

1 active deployment
Preview – cohort-lab — ca763745 Deployed Nov 29, 2026 by vercel[bot]
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