Skip to main content

A tool for generating OIDC identities

Reason this release was yanked:

https://github.com/di/id/issues/441

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

id-1.6.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

id-1.6.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file id-1.6.0.tar.gz.

File metadata

  • Download URL: id-1.6.0.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for id-1.6.0.tar.gz
Algorithm Hash digest
SHA256 4ca6e16f99e34d87ff2d9044fdf3bf278fcff33de56745a3734af9101fff6269
MD5 583c666f123735fec337e73a6dd1133a
BLAKE2b-256 e33f0acc37f843ce113c3fdd20550eaf8fd0eca3d6a6cc36ea80df1359ff82bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for id-1.6.0.tar.gz:

Publisher: release.yml on di/id

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file id-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: id-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for id-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c18a2a7c71f9ef5ae203b0f2d0ce0e47eeb9f80de5d803a5197ceb5d2a47f20
MD5 f7264a796d197282318daf82549962b7
BLAKE2b-256 e3d4f65897221f0a9737775ce57c185e6dfe1d366a16408be8841c40ec8d49fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for id-1.6.0-py3-none-any.whl:

Publisher: release.yml on di/id

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page