#system #circle-ci #oidc #action #pipeline #setup

ci-id

Ambient OIDC credentials detection on CI systems

6 releases

0.3.0 Dec 3, 2024
0.2.1 Nov 5, 2024
0.1.2 Oct 29, 2024

#721 in Authentication


Used in ci-id-bin

Apache-2.0

24KB
492 lines

Ambient credentials detection for CI systems

CI badge

ci-id provides easy access to ambient OIDC credentials in CI systems.

use ci_id::{detect_credentials, CIIDError};

fn main() -> Result<(), CIIDError>  {
    let token = detect_credentials(Some("myaudience"))?;
    print!("Ambient OIDC token detected: {}", token);
    Ok(())
}

See ci-id-bin crate for a simple CLI wrapper.

ci-id is based on id, a similar Python project.

Supported environments

Currently supported environments are:

  • GitHub Actions
  • GitLab CI/CD
  • CircleCI
  • Buildkite

See documentation for details on what configuration each of these environments needs.

License

ci-id is licensed under the Apache 2.0 License.

Dependencies

~6–19MB
~252K SLoC