A library for accessing ambient OpenID Connect tokens
https://github.com/astral-sh/ambient-id.git
A library for accessing ambient OIDC credentials in a variety of environments.
This crate serves the same purpose as Python's [id] library.
ambient-id currently supports ambient OIDC credential detection in the
following environments:
id-token: write permission to be setFor additional information on OpenID Connect in GitHub Actions, see the [GitHub documentation].
<AUD>_ID_TOKEN environment variable,<AUD> is the audience string with non-alphanumeric characters
replaced by underscores and converted to uppercase. For example, if the
audience is sigstore, the crate will look for a SIGSTORE_ID_TOKEN
environment variable.
For additional information on OpenID Connect and <AUD>_ID_TOKEN
environment variables, see the [GitLab documentation].
buildkite-agent oidc request-token --audience <AUD> to obtain the token.
If you're using BuildKite's [Docker plugin], you'll need to propagate the environment and mount the BuildKite agent binary into the container for this to work correctly.
Specifically, you'll need propagate-environment: true and
mount-buildkite-agent: true set in your plugin configuration.
For additional information on OpenID Connect in BuildKite, see the [BuildKite documentation].
To run tests:
RUST_TEST_THREADS=1 cargo test
You must pass RUST_TEST_THREADS=1 to ensure tests are run in a single
thread, as this crate's tests manipulate environment variables and are not
thread-safe.
ambient-id is licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in ambient-id by you, as defined in the Apache-2.0 license, shall be dually licensed as above, without any additional terms or conditions.