fix(api): allow authenticated sessions to reach registration-readiness / gittensor-config-recommendation (#8654) - #8706
Conversation
…cal path-matchers
src/review/merge-train.ts hand-rolled its own low-signal file/dir detection that had drifted from the
canonical set its sibling files already use:
- LOW_SIGNAL_FILENAME_RE matched only package-lock.json/yarn.lock/pnpm-lock.yaml/Cargo.lock (4 names),
so two PRs sharing only a poetry.lock, go.sum, npm-shrinkwrap.json, etc. were treated as a real
overlap and forced into a spurious merge-train wait.
- LOW_SIGNAL_DIR_RE matched only dist/build/coverage/node_modules, missing 'out' and the vendored-code
family (vendor/vendored/third_party/bower_components/jspm_packages).
Replace the filename regex with the canonical isLockfile() helper from path-matchers.ts (the same
dependency-free leaf utility review-diff.ts and review-grounding.ts already delegate to, covering all
24+ lockfile formats), and extend the directory regex to the canonical generated/vendored set. Two
new tests prove PRs sharing only poetry.lock/go.sum or vendor/third_party paths now decide {wait:false}
where they previously decided {wait:true}.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…s and gittensor-config-recommendation src/api/routes.ts's registration-readiness and gittensor-config-recommendation route handlers carry no per-repo ownership guard by design -- they are advisory, any-authenticated-user lookups (the owner panel takes a free-text repo name, and buildRegistrationReadinessResponse already strips owner-private context via stripOwnerPolicyContext before returning). But neither path had a predicate in canSessionAccessPath, so a real non-operator browser session got 403 on the owner panel's only two data calls, while operators/server tokens (which bypass the allowlist) worked. Add the two missing path predicates to the session allowlist so any authenticated session may reach them, matching the routes' existing intended open access. This unblocks the existing behavior only -- it adds no new authorization restriction (none was found to be intended: the handlers have no per-repo check, and the readiness payload is deliberately owner-context-stripped for public reads). Test: a session-cookie-authenticated user who maintains no repo here now gets 200 (not 403) on both routes for an arbitrary repo, in test/unit/access-boundary.test.ts.
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 00:07:12 UTC
Review summary Nits — 4 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Problem
Closes #8654.
src/api/routes.ts'sregistration-readinessandgittensor-config-recommendationroute handlers have no internal auth/role check — they are advisory, any-authenticated-user lookups. The owner panel calls both viauseApiResource(alwayscredentials: "include") and takes a free-text repo name rather than scoping to the caller's own repos.Neither path had a predicate in
canSessionAccessPath, so a real non-operator browser session got 403 on the owner panel's only two data calls, while operators / server tokens (which bypass the allowlist) worked.Fix — unblock only, no new restriction
Added the two missing path predicates and their allowlist entries in
canSessionAccessPath, so any authenticated session may reach both routes.This unblocks the existing intended open access; it adds no authorization restriction. Evidence the open access is intentional:
buildRegistrationReadinessResponsedeliberately strips owner-private context viastripOwnerPolicyContextbefore returning — the payload is designed for public/any-authenticated reads.Tests
A new test in
test/unit/access-boundary.test.tsasserts a logged-in user who maintains no repo here now gets 200 (previously 403) on both routes for an arbitrary repo. Reverting the allowlist entries makes it fail.git diff --checkclean.(Supersedes #8703, which the bot auto-closed under the 2-open-PR limit; re-filed now that a slot is free.)