git-credential-github-app-auth

Crates.iogit-credential-github-app-auth
lib.rsgit-credential-github-app-auth
version0.2.0
sourcesrc
created_at2023-02-19 15:50:26.86198
updated_at2023-03-20 19:17:01.859847
descriptionGit credential helper using GitHub App authentication to provide Github tokens as credentials to Git.
homepagehttps://github.com/westphahl/git-credential-github-app-auth
repositoryhttps://github.com/westphahl/git-credential-github-app-auth
max_upload_size
id789120
size44,651
Simon Westphahl (westphahl)

documentation

README

git-credential-github-app-auth

Git credential helper using GitHub App authentication to provide Github tokens as credentials to Git.

The helper will cache the credentials and only request a new token when the previous one expired.

Setup

Create a Github App and install it on the repositor or account/organization.

The app needs to have at least read-only permission for the "Contents" of the repository.

You must also generate a private key for the app in order to make API requests.

Usage

Make sure the helper binary git-credential-github-app-auth is in your path. The authentication agent listens on a local Unix socket and can be started with the following command:

git-credential-github-app-auth \
    /run/user/1000/github-app-auth \
    agent \
    --app-id 1234 \
    --key-path /path/to/app/private-key.pem

Configure the Git credential helper in ~/.gitconfig:

[credential "https://github.com"]
    helper = "github-app-auth /run/user/1000/github-app-auth client"
    useHttpPath = true

To test that the authentication helper works, you can either clone a repo that has the configured Github app installed or run git credential fill directly and provide e.g. the following input (note the extra newline at the end; see also expected format):

protocol=https
host=github.com
path=westphahl/git-credential-github-app-auth.git

Commit count: 24

cargo fmt