Skip to content

fix(projector): validate GITHUB_APP_ID in appJwt like GITHUB_APP_INSTALL_ID - #4441

Merged
dezren39 merged 1 commit into
mainfrom
queue/6319-4139-github-app-id-validation
Nov 2, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/6319-4139-github-app-id-validation

Conversation

@dezren39

@dezren39 dezren39 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Fixes #4139 (queue task 6319).

appJwt used env.GITHUB_APP_ID verbatim as the JWT iss with no shape validation, while parseConfiguredInstallId (from #4106) rejects any GITHUB_APP_INSTALL_ID that 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.

  • Extract the shared rule into parsePositiveDecimalId(raw, envName) (digits only, safe integer, > 0; error names the env var and the expected form) and use it for both GITHUB_APP_INSTALL_ID and GITHUB_APP_ID.
  • appJwt validates the app id after the existing presence check, so missing/empty credentials still throw github_app_credentials_missing, and valid ids keep issuing identical iss claims.
  • Tests in pm-stack/projector/test/github.test.ts: rejected spellings (abc, 0, -1, 12.5, " 123 ", out-of-safe-range digits) throw naming GITHUB_APP_ID; a valid id's JWT payload keeps iss: "123"; missing/empty keeps github_app_credentials_missing.

Tests (laptop, worktree on origin/main 750bc13):

  • bun test pm-stack/projector/test/github.test.ts — 14 pass, 0 fail
  • bun test pm-stack/projector (after bun install in the worktree) — 73 pass, 0 fail

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 2, 2026 16:14
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b571256d-8d98-4591-8c29-a5ebb776626c
Commits

Reviewing files that changed from the base of the PR and between 5b04802 and 28fc2c6.

Files selected for processing: 2
  • pm-stack/projector/src/github.ts
  • pm-stack/projector/test/github.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T16:44:17.624519Z 28fc2c6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39

dezren39 commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 28fc2c6cab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@dezren39
dezren39 merged commit 9bd147e into main Nov 2, 2026
1 check passed
@dezren39
dezren39 deleted the queue/6319-4139-github-app-id-validation branch November 2, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant