Skip to main content

id

CI PyPI version OpenSSF Scorecard SLSA

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] [-d] 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)
  -d, --decode   decode the OIDC token into JSON (default: False)

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:

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.

Metadata

Release files for id 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for id 1.5.0
File Size Uploaded Provenance Actions
id-1.5.0.tar.gz 15.2 kB With provenance Details for id-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for id 1.5.0
File Interpreter ABI Platform Actions
id-1.5.0-py3-none-any.whl Python 3 none any Details for id-1.5.0-py3-none-any.whl

Total release size: 28.8 kB

Release files / id-1.5.0.tar.gz

Download URL id-1.5.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
292cb8a49eacbbdbce97244f47a97b4c62540169c976552e497fd57df0734c1d
BLAKE2b-256 checksum
How to use checksums
2211102da08f88412d875fa2f1a9a469ff7ad4c874b0ca6fed0048fe385bdb3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2024.

Transparency log

Release files / id-1.5.0-py3-none-any.whl

Download URL id-1.5.0-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f1434e1cef91f2cbb8a4ec64663d5a23b9ed43ef44c4c957d02583d61714c658
BLAKE2b-256 checksum
How to use checksums
9fcb18326d2d89ad3b0dd143da971e77afd1e6ca6674f1b1c3df4b6bec6279fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2024.

Transparency log

Security for id 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for id-1.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 4, 2024.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page