Skip to main content

authenticated_clone_url

Function authenticated_clone_url 

Source
pub fn authenticated_clone_url(url: &str, token: Option<&str>) -> String
Expand description

Rewrite an HTTPS GitHub clone URL to embed x-access-token:<token> auth, but ONLY on an exact github.com host over https (opensrc #66: prefix/suffix- confusable hosts, subdomains, non-https schemes, and ssh remotes pass through unchanged). The result carries the secret — use it only as a git argument, never in logs.