feat(auth): add PAT scope presets - #42
Conversation
|
Warning Review limit reached
Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR replaces pre-scoped PAT links with classic PAT presets, adds client-side GitHub token creation, and documents token storage, required scopes, optional package tokens, and SSO authorization. ChangesClassic PAT setup
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/usr/local/emhttp/plugins/ci-runner-farm/RunnerFarmSettings.page`:
- Around line 59-66: Clarify the classic PAT’s resource scope in the preset
guidance near the select with id crf-pat-preset: state that it is account-wide
across the token owner’s accessible repositories and recommend using a dedicated
service account/token. Also update the README authentication guidance at the
specified section to define “least privilege” as minimum classic PAT scopes, not
per-repository or per-organization credentials.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a235f081-d872-48b9-9e13-7490a63952fc
📒 Files selected for processing (3)
README.mdsrc/usr/local/emhttp/plugins/ci-runner-farm/RunnerFarmSettings.pagesrc/usr/local/emhttp/plugins/ci-runner-farm/include/runner-farm.sh
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/usr/local/emhttp/plugins/ci-runner-farm/RunnerFarmSettings.page`:
- Line 69: Update the .crfs-pat-note styling in the token controls layout to use
flex: 0 0 100%, ensuring the PAT guidance occupies its own full-width row
beneath the controls at all screen widths. Apply the same change to the
corresponding second occurrence.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 0b3534c4-bea4-42a2-8fb7-e2027ad95bd1
📒 Files selected for processing (2)
README.mdsrc/usr/local/emhttp/plugins/ci-runner-farm/RunnerFarmSettings.page
🚧 Files skipped from review as they are similar to previous changes (1)
- README.md
Summary
Adds classic-PAT presets for repository runners, organization runners, and private GHCR image pulls. Also adds a separate
read:packages-only GHCR pull-token shortcut.Why
The prior pre-scoped PAT link omitted
read:packages, so a token could mint organization runner registration tokens but still be denied when Docker pulled a privateghcr.iorunner image.User impact
Operators can choose a least-privilege preset matching their runner scope and image source. The saved configuration preselects the matching repository/org and GHCR combination; users can also save a separate package-only registry token.
Validation
php -l src/usr/local/emhttp/plugins/ci-runner-farm/RunnerFarmSettings.pagebash -n src/usr/local/emhttp/plugins/ci-runner-farm/include/runner-farm.sh./tests/config-parity.sh./tests/safe-paths.sh(skipped: GNUrealpath -mis unavailable on this host)git diff --checkSummary by CodeRabbit