Repository navigation
fix(id): warn when .iroh-allowed is present but unreadable (#6677) - #6691
Merged
Merged
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 9 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 Summary: ✅ CompletedThis 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. |
4 tasks
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.
Fixes #6677.
Problem
load_allowed_nodescollapsed everyread_to_stringerror into a silent empty list, so a present-but-unreadable.iroh-allowed(UTF-16 save, directory in its place, permission denied) looked exactly like a missing file: allowed peers were denied writes with no diagnostic naming the file.Change (
pkgs/id/crates/id-core/src/access.rsonly)load_allowed_nodesnow matches on the read result:NotFoundstays silent and empty (by design); any other error emitswarn!("ignoring unreadable allow list {path}: {err}; no nodes from it will be allowed to write")and returns an empty list — fail-closed is preserved, the failure is now visible. This is the helperbuild_access_policyinid servecalls, so the diagnostic fires on the serve policy-build path through the sametracingchannel as the existing per-line invalid-ID warnings inparse_allowed_nodes(unchanged).tracing-subscriber assert the behavior, not just the return value: directory-in-place-of-file and non-UTF-8 (UTF-16LE+BOM bytes) both stay empty AND produce a diagnostic naming.iroh-allowed; a missing file stays empty AND silent; the existing valid-file and parse tests stay green.Tests
3a437f133f:cargo test --lib load_allowed_nodesinpkgs/id/crates/id-core— 7 passed, 0 failed (incl. the three new tests); the full--librun in that crate also passed its other suites in the same invocation (121 filtered out were non-matching names in other binaries).🤖 Filed by repo-queue-worker Lane T in fallback mode (queue backend down 2026-11-06/07); the issue was the task.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.