Skip to content

fix(remote): validate credential fields before use - #223

Open
poketopa wants to merge 2 commits into
toss:mainfrom
poketopa:fix/remote-credential-validation
Open

fix(remote): validate credential fields before use#223
poketopa wants to merge 2 commits into
toss:mainfrom
poketopa:fix/remote-credential-validation

Conversation

@poketopa

Copy link
Copy Markdown

Summary

  • validate required credential fields before constructing remote options
  • return field-specific InvalidArg JavaScript errors for malformed plain JavaScript inputs
  • keep credential callback conversion panic-free while preserving valid credential behavior

Problem

Credential fields are optional in the Rust N-API input object so plain JavaScript or TypeScript casts can omit fields that are required by a credential variant. The conversion previously unwrapped privateKeyPath, privateKey, and password, which could panic when libgit2 requested the credential.

Changes

  • validate each variant before fetch, push, prune, clone, and submodule operations reach transport setup
  • replace unwrap calls with controlled git2 errors as a callback-level safeguard
  • preserve the git username fallback and existing libgit2 error conversion
  • add local file-transport N-API regression tests and focused Rust unit tests

Validation

  • just format
  • just lint
  • just typecheck
  • just test
  • git diff --check

All new credential regression cases use local synthetic repositories and values.

@vercel

vercel Bot commented Aug 23, 2026

Copy link
Copy Markdown

@poketopa is attempting to deploy a commit to the Toss Team on Vercel.

A member of the Team first needs to authorize it.

@poketopa
poketopa marked this pull request as ready for review August 23, 2026 13:30
@poketopa
poketopa requested a review from seokju-na as a code owner August 23, 2026 13:30
@marshallku
marshallku self-requested a review as a code owner September 9, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants