We have released Buf v0.5.0.
Tarballs, git repositories, and image files can be read from remote locations. For those remote locations that need authentication, v0.5.0 adds a couple mechanisms.
HTTPSBasic authentication can be specified for remote tarballs, git repositories, and image files over
https with the following environment variables:
-
BUF_INPUT_HTTPS_USERNAME - The username. For GitHub, this is your GitHub user.
-
BUF_INPUT_HTTPS_PASSWORD - The password. For GitHub, this is a personal access token for your GitHub User.
Assuming these environment variables are set up, you can call Buf as you normally would:
$ buf check lint --input https://github.com/org/private-repo.git#branch=master
$ buf check lint --input https://github.com/org/private-repo/archive/master.tar.gz#strip_components=1
$ buf check breaking --against-input https://github.com/org/private-repo.git#branch=masterSSHPublic key authentication can be used for remote git repositories over ssh. By default, Buf will
look for:
- A private key file with no passphrase at
~/.ssh/id_rsa.
- A known hosts file at either
~/.ssh/known_hosts or
/etc/ssh/ssh_known_hosts.
The following environment variables can be used to customize these locations:
-
BUF_INPUT_SSH_KEY_FILE - The path to the private key file.
-
BUF_INPUT_SSH_KEY_PASSPHRASE - The passphrase for the private key.
-
BUF_INPUT_SSH_KNOWN_HOSTS_FILES - A colon-separated list of known hosts file paths.
Assuming these default files exist or these environment variables are set up, you can call Buf as you normally would:
$ buf check lint --input ssh://g...@github.com/org/private-repo.git#branch=master
$ buf check breaking --against-input ssh://g...@github.com/org/private-repo.git#branch=masterNote that CI services such as CircleCI have a private key and known hosts file pre-installed, so
this should work out of the box.