feat: expand repo ref parser (URLs, SSH, query params, destination dir) - #674
Draft
cursor[bot] wants to merge 3 commits into
Draft
feat: expand repo ref parser (URLs, SSH, query params, destination dir)#674cursor[bot] wants to merge 3 commits into
cursor[bot] wants to merge 3 commits into
Conversation
Co-authored-by: cooper <czxtm@users.noreply.github.com>
Co-authored-by: cooper <czxtm@users.noreply.github.com>
Co-authored-by: cooper <czxtm@users.noreply.github.com>
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.
Security-focused review of commit bb8464c / PR #453.
Scope
Traced onboarding import flow:
FlakeRefSource→client.path.normalize→config_import_github→parse_repo_ref/prepare_import_target/materialize_repo.Findings
Significant user-facing breakage (not security-critical)
1. Frontend/backend mismatch on 3-segment shorthand refs (High confidence)
parseFlakeRef/ownerAndRepoFromLocator(flake-ref.ts) accepts refs likeowner/group/repoand marks them importable.parse_repo_ref(bootstrap/import.rs) requires exactly two path segments for shorthand /github.com/forms and rejectsa/b/c.myorg/nix-config/darwin) → UI shows valid → import fails at backend parse.2. Destination dir plain names resolved against process CWD (Medium confidence)
FlakeRefSourcealways runsclient.path.normalizebeforeimportGithub, turning plain names likedarwininto{cwd}/darwininstead of letting backendresolve_import_targetmap them to~/darwin.validate_new_dir_locationor only works when CWD happens to be$HOME; confusing errors vs old behavior.No critical security issues found
?dir=validated in both TS and Rust; zip extraction usessafe_join..DS_Storeonly); non-empty dirs rejected.Notes
LocalSource.refreshHostsSnapshot({ force: true })in setup step is a UX fix, not a security issue.