Repository navigation
fix(projector): validate GITHUB_APP_ID in appJwt like GITHUB_APP_INSTALL_ID - #4441
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 53 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #4139 (queue task 6319).
appJwtusedenv.GITHUB_APP_IDverbatim as the JWTisswith no shape validation, whileparseConfiguredInstallId(from #4106) rejects anyGITHUB_APP_INSTALL_IDthat is not a positive decimal integer. A mistyped app id produced a correctly signed JWT that GitHub rejects downstream, surfacing as a misleading credentials problem.parsePositiveDecimalId(raw, envName)(digits only, safe integer, > 0; error names the env var and the expected form) and use it for bothGITHUB_APP_INSTALL_IDandGITHUB_APP_ID.appJwtvalidates the app id after the existing presence check, so missing/empty credentials still throwgithub_app_credentials_missing, and valid ids keep issuing identicalissclaims.pm-stack/projector/test/github.test.ts: rejected spellings (abc,0,-1,12.5," 123 ", out-of-safe-range digits) throw namingGITHUB_APP_ID; a valid id's JWT payload keepsiss: "123"; missing/empty keepsgithub_app_credentials_missing.Tests (laptop, worktree on origin/main 750bc13):
bun test pm-stack/projector/test/github.test.ts— 14 pass, 0 failbun test pm-stack/projector(afterbun installin the worktree) — 73 pass, 0 failNeed help on this PR? Tag
@codesmith-botwith what you need.