Repository navigation
fix(github-backup): drainer owner allowlist (#3326) - #3328
Merged
Merged
Conversation
…ents at the door (#3326) The backup App is public (org installs require it), so anyone can install it; their deliveries verify against the App secret and queue. The drainer now checks each event's owner against config.json owners (repository.owner.login, then the repo full_name owner segment, then installation.account.login; case-insensitive) before any fetch work. Foreign or owner-less events are dropped: acked as handled-by-policy (never retried, never counted toward the #3219 DRAIN-CHRONIC streak), logged as one DRAIN-DROP line per event, counted in the run summary. Fails closed when config carries no owners. Allowed-owner behavior, including #3219/#3229 ack semantics, is unchanged. Tests: 54/54 in test_drain_queue.py (22 new: foreign dropped even when planned, malformed dropped, repository-over-installation precedence, installation fallback, drop never feeds the chronic streak). The new foreign case was run against the pre-fix drainer first: it reached fetch — the hole — and is closed by this change.
|
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 11 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the foreign-install hole opened by making the backup App public: anyone can install
developing-today-backupon their own repos, and their deliveries verify and queue.Change (
infra/github-backup/bin/drain_queue.py): before any fetch work, each queued event's owner is checked againstconfig.jsonowners— the same set reconcile plans from — case-insensitively. Owner determination:repository.owner.login→ repo full_name owner segment →installation.account.loginfallback. Foreign or owner-less (malformed) events are dropped: acked as handled-by-policy (never retried, never counted toward the #3219 DRAIN-CHRONIC streak), one loud log line each (DRAIN-DROP foreign owner=<login> repo=<full_name> delivery=<id>), counted asdropped_foreignin the run summary. Fails closed if config has no owners. Allowed-owner behavior and #3219/#3229 ack semantics unchanged.Tests:
tests/test_drain_queue.py54/54 (22 new). Repro first: the new foreign-owner case run against the pre-fix drainer reached fetch (the hole); with this change it is dropped before any fetch. Sibling suites still green (18/18, 9/9).Deploy: merge → pull on laptop primary →
just github-backup-units→ drain run + hand-injected foreign-event proof (results on #3326).Closes #3326. Refs #3215.
Need help on this PR? Tag
@codesmith-botwith what you need.