Git credential helpers for Infrahub. These tools allow git processes to authenticate against repositories managed by Infrahub by fetching credentials from the Infrahub GraphQL API.
A git credential helper that implements the get, store, and erase subcommands. When git needs credentials for a remote, this helper queries Infrahub for the repository's stored credentials. store and erase are no-ops: the helper never writes to or deletes from Infrahub.
Requires credential.useHttpPath to be enabled:
git config --global credential.useHttpPath trueA GIT_ASKPASS helper. When git needs a username or password, it calls this program with a prompt string and reads the response from stdout.
Configuration is resolved in the following order:
| Setting | Environment Variable | TOML Config | Default |
|---|---|---|---|
| Server address | INFRAHUB_INTERNAL_ADDRESS |
[main].internal_address |
- |
| API token | INFRAHUB_API_TOKEN |
- | None |
| Config file path | INFRAHUB_CONFIG |
- | infrahub.toml |
| Username | INFRAHUB_USERNAME |
- | None |
| Password | INFRAHUB_PASSWORD |
- | None |
| Timeout (seconds) | INFRAHUB_TIMEOUT |
- | 30 |
| Proxy | INFRAHUB_PROXY |
- | None |
| Default branch | INFRAHUB_DEFAULT_BRANCH |
- | main |
| Skip TLS verification | INFRAHUB_HTTP_TLS_INSECURE |
[http].tls_insecure |
false |
| CA bundle (file path or PEM text) | INFRAHUB_HTTP_TLS_CA_BUNDLE |
[http].tls_ca_bundle |
None |
| Global CA bundle (file path or PEM text) | INFRAHUB_TLS_CA_BUNDLE |
[tls].ca_bundle |
None |
| Skip TLS verification (SDK, fallback) | INFRAHUB_TLS_INSECURE |
- | false |
| Custom CA certificate (SDK, fallback) | INFRAHUB_TLS_CA_FILE |
- | None |
TLS verification uses the first rule that applies:
- If
http.tls_insecureis true, the helper does not verify certificates. http.tls_ca_bundle.tls.ca_bundle.- The SDK variables
INFRAHUB_TLS_INSECUREandINFRAHUB_TLS_CA_FILE. Infrahub does not use them. The helper keeps them for existing setups. - The system trust store. On Linux,
SSL_CERT_FILEandSSL_CERT_DIRreplace the default locations. If the store is empty, TLS requests fail.
These are the settings that Infrahub uses for its own HTTP clients. A CA bundle replaces the system trust store. A value that contains -----BEGIN is PEM text, else it is a file path. Booleans accept true/false, 1/0, yes/no and on/off, in any case.
INFRAHUB_PROXY applies to every request. Without it, the helper selects the proxy by the scheme of the Infrahub address, like httpx:
- For an
https://address:HTTPS_PROXY, elseALL_PROXY. - For an
http://address:HTTP_PROXY, elseALL_PROXY.
The lowercase names also work and win over the uppercase names. NO_PROXY applies to these variables, but not to INFRAHUB_PROXY.
With an http:// Infrahub address and a proxy, the helper sends CONNECT to the proxy. Some proxies refuse CONNECT to ports other than 443, for example Squid with its default configuration. See dev/COMPATIBILITY.md.
Authentication supports two methods:
- Token auth: set
INFRAHUB_API_TOKEN— sent asX-INFRAHUB-KEYheader - Password auth: set
INFRAHUB_USERNAMEandINFRAHUB_PASSWORD— logs in via/api/auth/loginto obtain a bearer token
Both binaries also accept --config-file <path> to override the config file path.
Environment variables take precedence over TOML values.
The binaries are published to PyPI as a maturin-built
wheel (the same distribution model as ruff and ty). Installing the package
places both infrahub-git-credential and infrahub-git-askpass on your PATH,
so any Python project manager works:
uv add infrahub-git-credential-helper
# or
pip install infrahub-git-credential-helper
# or
poetry add infrahub-git-credential-helperThis is the recommended way to bundle the helpers into a Python application
(such as the Infrahub server): add it as a dependency and the binaries are
installed into the environment's bin/ directory alongside any console
scripts. Wheels are provided for Linux and macOS on both amd64 and arm64;
they are independent of the Python version. See dev/PACKAGING.md for how this
is built and published.
cargo build --releaseBinaries are output to target/release/infrahub-git-credential and target/release/infrahub-git-askpass.
The project includes a multi-stage Dockerfile that produces statically linked binaries (musl) in a scratch-based image. Supports both amd64 and arm64 architectures.
docker build -t registry.opsmill.io/opsmill/infrahub-git-credential-helper .Use in a downstream Dockerfile:
COPY --from=registry.opsmill.io/opsmill/infrahub-git-credential-helper:latest /usr/bin/infrahub-git-credential /usr/bin/infrahub-git-credential
COPY --from=registry.opsmill.io/opsmill/infrahub-git-credential-helper:latest /usr/bin/infrahub-git-askpass /usr/bin/infrahub-git-askpassThis project is licensed under the Apache License, Version 2.0. See LICENSE.txt for details.