fix(miner): add optional token verification to init - #5419
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5419 +/- ##
=======================================
Coverage 94.45% 94.45%
=======================================
Files 553 553
Lines 44357 44400 +43
Branches 14659 14659
=======================================
+ Hits 41898 41940 +42
- Misses 1784 1785 +1
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-12 18:14:18 UTC
🛑 Suggested Action - Reject/Close
Review summary Blockers
Nits — 5 non-blocking
Why this is blocked
CI checks failing
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk 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.
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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch); AI reviewers agree on a likely critical defect: packages/gittensory-miner/lib/laptop-init.js:196 treats an explicitly empty `x-oauth-scopes` header as equivalent to an omitted header, so a reachable classic token with no scopes passes `verifyGithubToken`; preserve whether the header was present and reject present-but-empty or present-without `repo`/`public_repo`, while only allowing the omitted-header path for tokens where GitHub truly does not report classic scopes.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Summary
Add an opt-in
--verify-tokenflag togittensory-miner initthat makes one authenticated GitHub API call, reports the returned scopes on success, and fails fast on invalid or under-scoped tokens. Defaultinitbehavior is unchanged when the flag is omitted.Closes #5171.
Supersedes #5417.
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #5171).Validation
git diff --checknpm run build --workspace @jsonbored/gittensory-enginenpm run typechecknpm run test -- test/unit/miner-init-verify-token.test.ts test/unit/miner-laptop-init.test.tsnpm run actionlintnpm run test:coveragenpm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
Safety
Notes
doctorremains untouched and still makes no network calls.initonly performs a GitHub request when--verify-tokenis passed.