A tool for generating OIDC identities
Project description
id
id
is a Python tool for generating OIDC identities. It can automatically
detect and produce OIDC credentials on a number of environments, including
GitHub Actions, GitLab pipelines and Google Cloud.
Installation
id
requires Python 3.8 or newer, and can be installed directly via pip
:
python -m pip install id
Usage
You can run id
as a Python module via python -m
:
python -m id --help
Top-level:
usage: id [-h] [-V] [-v] audience
a tool for generating OIDC identities
positional arguments:
audience the OIDC audience to use
optional arguments:
-h, --help show this help message and exit
-V, --version show program's version number and exit
-v, --verbose run with additional debug logging; supply multiple times to
increase verbosity (default: 0)
For Python API usage, there is a single importable function, detect_credential
:
>>> from id import detect_credential
>>> detect_credential(audience='something')
'<OIDC token>'
This function requires an audience
parameter, which is used when generating
the OIDC token. This should be set to the intended audience for the token.
If no supported environment is found, detect_credential
returns None
. If a supported
environment is found but detect_credential
fails to retrieve a token, it raises
AmbientCredentialError
.
Supported environments
id
currently supports ambient credential detection in the following environments:
- GitHub Actions
- Google Cloud
- Buildkite
- GitLab (See environment variables below)
- CircleCI
Tokens in environment variables
GitLab provides OIDC tokens through environment variables. The variable name must be
<AUD>_ID_TOKEN
where <AUD>
is the uppercased audience argument where all
characters outside of ASCII letters and digits are replaced with "_". A leading digit
must also be replaced with a "_".
Licensing
id
is licensed under the Apache 2.0 License.
Contributing
See the contributing docs for details.
SLSA Provenance
This project emits a SLSA provenance on its release! This enables you to verify the integrity of the downloaded artifacts and ensured that the binary's code really comes from this source code.
To do so, please follow the instructions here.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file id-1.2.1rc1.tar.gz
.
File metadata
- Download URL: id-1.2.1rc1.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8ffc4db80d8f920e5fac4c7c0339674915fba3f1ec1095934215c8d43cad03f |
|
MD5 | 3e4805d036011a3b726ddcf56e3fecf5 |
|
BLAKE2b-256 | c578071ec265459007b2cc11e65223a20d079f06753ce36b6ef4456e83d93e2f |
File details
Details for the file id-1.2.1rc1-py3-none-any.whl
.
File metadata
- Download URL: id-1.2.1rc1-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 930b4b068bea5eeb168b23806b856d3bcb11af0e54abe4bb0ca898ea6b91c4e3 |
|
MD5 | 67d803b6b7e488612e2eb0bacba5cb3e |
|
BLAKE2b-256 | b5a1a994dc0ba028242438d51c850cc873580e18b2965b0fdf1cf5a3ce1f2925 |