git credential helper to allow you to do http auth git actions
Files
readme.md

git-credential-tangled #

A git credential helper for pushing to a Tangled knot over HTTPS. For each push it has your PDS mint a short-lived service-auth token from an OAuth session saved in your OS keyring.

Install #

go install tangled.org/pds.dad/git-credential-tangled@latest

Use #

Scope it to your knot. The empty helper keeps other helpers from answering for that host:

git config --global credential.https://knot.example.com.helper ""
git config --global --add credential.https://knot.example.com.helper "tangled --handle alice.example.com"

So for example for my knot knot.pds.dad it would be

git config --global credential.https://knot.pds.dad.helper ""
git config --global --add credential.https://knot.pds.dad.helper "tangled --handle pds.dad"

When adding remotes you will need to replace tangled.org with your knot address. So https://tangled.org/pds.dad/git-credential-tangled would become https://knot.pds.dad/git-credential-tangled

Will then open your browser to log in with OAuth on the first push, and save the session (refresh token and DPoP key) in your OS keyring. Later pushes refresh it silently.

Headless and CI use #

If no browser login is possible the helper falls back to an app password:

  • TANGLED_APP_PASSWORD set in the environment always wins and skips OAuth entirely.
  • Otherwise, when there is no terminal (or TANGLED_NO_BROWSER=1 is set), it asks git for an app password stored under the PDS URL, prompting once and remembering it.