mirror of
				https://github.com/astral-sh/uv.git
				synced 2025-10-30 19:48:11 +00:00 
			
		
		
		
	Redact Git credentials in lockfile (#6070)
## Summary Closes https://github.com/astral-sh/uv/issues/6055.
This commit is contained in:
		
							parent
							
								
									1bbb05dca7
								
							
						
					
					
						commit
						92263108cc
					
				
					 2 changed files with 6 additions and 2 deletions
				
			
		|  | @ -2011,6 +2011,10 @@ impl From<GitSourceKind> for GitReference { | |||
| fn locked_git_url(git_dist: &GitSourceDist) -> Url { | ||||
|     let mut url = git_dist.git.repository().clone(); | ||||
| 
 | ||||
|     // Redact the credentials.
 | ||||
|     let _ = url.set_username(""); | ||||
|     let _ = url.set_password(None); | ||||
| 
 | ||||
|     // Clear out any existing state.
 | ||||
|     url.set_fragment(None); | ||||
|     url.set_query(None); | ||||
|  |  | |||
|  | @ -5312,7 +5312,7 @@ fn lock_redact_git() -> Result<()> { | |||
|         [[package]] | ||||
|         name = "uv-private-pypackage" | ||||
|         version = "0.1.0" | ||||
|         source = { git = "https://***@github.com/astral-test/uv-private-pypackage#d780faf0ac91257d4d5a4f0c5a0e4509608c0071" } | ||||
|         source = { git = "https://github.com/astral-test/uv-private-pypackage#d780faf0ac91257d4d5a4f0c5a0e4509608c0071" } | ||||
|         "###
 | ||||
|         ); | ||||
|     }); | ||||
|  | @ -5339,7 +5339,7 @@ fn lock_redact_git() -> Result<()> { | |||
|     Prepared 2 packages in [TIME] | ||||
|     Installed 2 packages in [TIME] | ||||
|      + foo==0.1.0 (from file://[TEMP_DIR]/)
 | ||||
|      + uv-private-pypackage==0.1.0 (from git+https://***@github.com/astral-test/uv-private-pypackage@d780faf0ac91257d4d5a4f0c5a0e4509608c0071)
 | ||||
|      + uv-private-pypackage==0.1.0 (from git+https://github.com/astral-test/uv-private-pypackage@d780faf0ac91257d4d5a4f0c5a0e4509608c0071)
 | ||||
|     "###);
 | ||||
| 
 | ||||
|     Ok(()) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Charlie Marsh
						Charlie Marsh