Skip to content

fix(data): disable public data worker exposure#4845

Open
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-public-exposure-of-data-api-worker
Open

fix(data): disable public data worker exposure#4845
JSONbored wants to merge 1 commit into
mainfrom
codex/fix-public-exposure-of-data-api-worker

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • The dedicated data API Worker now owns an internal write route and uncached Postgres read routes but its Wrangler config left workers.dev/preview URLs enabled, which makes internal routes directly reachable instead of reachable only via the main Worker's DATA_API service binding.

Description

  • Harden wrangler.data.jsonc by setting "workers_dev": false and "preview_urls": false and adding a short comment explaining the rationale so the data Worker remains service-binding-only.

Testing

  • Ran npx prettier --check wrangler.data.jsonc and it passed.
  • Ran npx wrangler deploy -c wrangler.data.jsonc --dry-run and the dry-run completed without errors.

Codex Task

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 11, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
metagraphed-data-api 8cdc5bf Commit Preview URL

Branch Preview URL
Jul 11 2026, 06:40 AM

@superagent-security

Copy link
Copy Markdown

Superagent didn't find any vulnerabilities or security issues in this PR.

@gittensory-orb gittensory-orb Bot added the gittensor:bug Gittensor-scored bug fix or unsolicited PR — scores a 0.05x multiplier. label Jul 11, 2026
@gittensory-orb

gittensory-orb Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-11 17:10:12 UTC

1 file · 1 AI reviewer · 2 blockers · readiness 93/100 · CI green · unstable

⏸️ Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.

Review summary
This PR adds "workers_dev": false and "preview_urls": false to wrangler.data.jsonc so the dedicated data-API Worker is reachable only via the main Worker's DATA_API service binding, closing a real exposure gap since Wrangler defaults workers_dev to true when unset. The change exactly mirrors the identical, already-established pattern in the sibling wrangler.registry.jsonc (same two keys, same rationale), is a minimal single-file 4-line diff with no unrelated churn, and all CI checks passed. It is correct and consistent with existing repo convention.

Nits — 3 non-blocking
  • The PR description doesn't include an explicit issue link (e.g. "Fixes #NNNN"); worth confirming this hardening was tracked/requested rather than opportunistic, though the fix itself is narrowly scoped and legitimate.
  • The write route (POST /api/v1/internal/neurons-sync) already required NEURONS_SYNC_SECRET, so this change is defense-in-depth rather than closing a fully unauthenticated write path — worth noting in the PR description for reviewer clarity.
  • Consider a one-line ops note recording that the data Worker's public dev/preview URLs are now disabled, since anyone with the old workers.dev URL bookmarked will lose direct access.

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 2 blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 45 registered-repo PR(s), 37 merged, 414 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 45 PR(s), 414 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 45 PR(s), 414 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Explain no-issue PR.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@gittensory-orb gittensory-orb Bot added the manual-review Gittensor contributor context label Jul 11, 2026
@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.72%. Comparing base (eee5817) to head (8cdc5bf).
⚠️ Report is 18 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4845   +/-   ##
=======================================
  Coverage   97.72%   97.72%           
=======================================
  Files         162      162           
  Lines       18722    18722           
  Branches     6987     6987           
=======================================
  Hits        18297    18297           
  Misses         59       59           
  Partials      366      366           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark codex gittensor:bug Gittensor-scored bug fix or unsolicited PR — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant