Repository navigation
Use user GitHub OAuth token for repochecker API calls - #203
Conversation
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The installed repochecker version ignores the forwarded header, leaving GitHub requests unauthenticated.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Attempts to authenticate repochecker GitHub API calls with the logged-in user’s OAuth token.
Changes:
- Passes the token from both frontend check flows.
- Adds the token as an authorization header.
- Forwards and types the header in the backend.
File summaries
| File | Description |
|---|---|
express/frontend/src/tools/AdapterCheck.tsx |
Passes the user token. |
express/frontend/src/tools/adapter/releases/UpdateRepositoriesDialog.tsx |
Passes the token during releases. |
express/frontend/src/lib/ioBroker.ts |
Adds the authorization header. |
express/backend/src/api/repochecker.ts |
Forwards the header to repochecker. |
express/backend/src/@types/iobroker__repochecker/index.d.ts |
Extends request typing. |
Review details
- Files reviewed: 4/5 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
IPC results can be dropped and unbounded worker creation creates a resource-exhaustion risk.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 3
- Review effort level: Balanced
|
Ok, STOP here, we go to draft ... the env variable will not work here ... I do not like to fork that many processes ... We should adjust the repo checker library that we get this as a lib parameter |
|
on hold: waiting for changes to repochecker according to @Apollon77 |
|
Repochecker 5.21.0 accepts a new paramater githubToken. If request.queryStringParameters.githubToken is set this string will be used as github token to authenticate for axios calls. The token will NOT be loaded into the environment but only store within code. Feel free to test. |
|
@copilot Update the PR and use the new parameter in the Repochecker 5.21.0 accepts a new paramater githubToken. If request.queryStringParameters.githubToken is set this string will be used as github token to authenticate for axios calls. The token will NOT be loaded into the environment but only store within code. |
Co-authored-by: Apollon77 <11976694+Apollon77@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The authenticated token flow is correctly wired and tested; the only finding is a non-blocking stale version reference.
1 open finding
3 resolved since last review
Files not reviewed (1)
- express/backend/package-lock.json: Generated file
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
UncleSamSwiss
left a comment
There was a problem hiding this comment.
Thanks a lot for the PR!
The I would change to simply use the cookie that is already in every request (see attached screenshot in the second comment).
See also my first comment about the (IMHO) overly restrictive access check (i.e. single repo check at any time).
|
Any reason to wait? |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…checks - Use the existing gh-token cookie instead of a separate Authorization header; revert the frontend changes that sent the token explicitly. - Replace the global single-check lock (503) with a small queue that runs up to 3 checks in parallel, plus one in-flight check per user (429). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BSR3invYVCrhJk7Swpp9qn
There was a problem hiding this comment.
🟡 Changes recommended
Parallel execution can mix user credentials upstream, and the public queue is unbounded.
1 open finding
1 resolved since last review
Files not reviewed (1)
- express/backend/package-lock.json: Generated file
🧠 Review effort: Balanced
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BSR3invYVCrhJk7Swpp9qn
Requests without the gh-token cookie now get 401. Both frontend flows already require a logged-in user, so the UI is unaffected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BSR3invYVCrhJk7Swpp9qn
There was a problem hiding this comment.
🟡 Changes recommended
Client-controlled cookies bypass authentication, and parallel checks can use another user's OAuth token through repochecker's shared Axios state.
1 open finding
1 resolved since last review
Files not reviewed (1)
- express/backend/package-lock.json: Generated file
🧠 Review effort: Balanced
repochecker still shares a module-level Axios instance and redaction state between checks, so parallel checks could use or log another user's token. Checks are queued instead of rejected; raise the limit once ioBroker/ioBroker.repochecker#1193 is fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BSR3invYVCrhJk7Swpp9qn
There was a problem hiding this comment.
🟡 Changes recommended
A stalled repochecker request can permanently occupy the sole execution slot and disable subsequent checks.
1 open finding
1 resolved since last review
Files not reviewed (1)
- express/backend/package-lock.json: Generated file
🧠 Review effort: Balanced
| function runRepochecker(request: CheckRequest): Promise<CheckResult> { | ||
| return new Promise((resolve, reject) => { | ||
| handler(request, null, (error, result) => { |


SET AS STABLEcould fail with a GitHub API403. The repochecker made unauthenticated requests and ran into the shared limit of 60 requests per hour. With this change, checks run with the logged-in user's GitHub token, so they get authenticated rate limits./api/repochecker/gh-tokensession cookie, the same way/api/user/does, and passes it asqueryStringParameters.githubToken. That parameter is supported by@iobroker/repochecker≥ 5.21.0; the backend uses 5.22.4.401.429. Each user can have only one check running or queued at a time; a second one also gets429.500without the error details or the token.npm testinexpress/backend(node:test) covers passing the token, the login requirement, the per-user limit, the queue and its cap, and error redaction.Why only one check at a time: repochecker still keeps a module-level Axios instance and log redaction state in
lib/common.js. Parallel checks could therefore use another user's token or log it unredacted. This is tracked upstream in ioBroker/ioBroker.repochecker#1193. ATODOatMAX_PARALLEL_CHECKSsays to raise the limit to 3 once that is fixed.🤖 Generated with Claude Code
https://claude.ai/code/session_01BSR3invYVCrhJk7Swpp9qn