Skip to content

Commit e8a255b

Browse files
committed
Public repos no longer include the auth token
When backing up repositories using an auth token and https, the GitHub personal auth token is leaked in each backed up repository. It is included in the URL of each repository's git remote url. This is not needed as they are public and can be accessed without the token and can cause issues in the future if the token is ever changed, so I think it makes more sense not to have the token stored in each repo backup. I think the token should only be "leaked" like this out of necessity, e.g. it's a private repository and the --prefer-ssh option was not chosen so https with auth token was required to perform the clone.
1 parent 252c254 commit e8a255b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/github-backup

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def get_github_repo_url(args, repository):
394394
return repository['ssh_url']
395395

396396
auth = get_auth(args, False)
397-
if auth:
397+
if auth and repository['private'] == True:
398398
repo_url = 'https://{0}@{1}/{2}/{3}.git'.format(
399399
auth,
400400
get_github_host(args),

0 commit comments

Comments
 (0)