Add LocalFileProvider for custom domains#78
Merged
shilingwang merged 2 commits intomainfrom Feb 3, 2026
Merged
Conversation
Introduces a new LocalFileProvider that reads custom domain-to-canister mappings from a local file. The provider supports a simple colon-separated format (domain:principal) and includes proper error handling for invalid formats, malformed FQDNs, and invalid principals. Key features: - Reads domain:principal mappings from local files - Skips empty lines and trims whitespace - Validates domains as FQDNs and principals - Comprehensive test coverage (9 unit tests) - Clear documentation with file format examples
frankdavid
approved these changes
Feb 3, 2026
frankdavid
reviewed
Feb 3, 2026
- Replace String with PathBuf for file_path field (more idiomatic)
- Add fmt::{self, Debug} imports and use shorter references
- Update Debug implementations to use fmt:: prefix instead of std::fmt::
- Fix test to use sort_by instead of sorted_by_key for better performance
- Update test constructors to use PathBuf-friendly methods
- Clean up whitespace and formatting
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.
#Node-1842
Summary
Adds a new
LocalFileProviderthat enables reading custom domain-to-canister mappings from local files, providing a simpler alternative to URL-based providers for development and testing scenarios.Changes
LocalFileProviderreads domain mappings from local filesdomain:principal)Example File Format
Test Coverage
All tests pass (9/9):