Crate ambient_id

Crate ambient_id 

Source
Expand description

Detects ambient OIDC credentials in a variety of environments.

§Supported Environments

  • GitHub Actions (with id-token: write)
  • GitLab CI

§Usage

let audience = "my-service";
let detector = ambient_id::Detector::new();
match detector.detect(audience).await? {
    Some(token) => println!("Detected ID token: {}", token.reveal()),
    None => println!("No ambient ID token detected"),
}

Structs§

Detector
Detector for ambient OIDC credentials.
IdToken
A detected ID token.

Enums§

Error
Errors that can occur during detection.
GitHubError
Possible errors during GitHub Actions OIDC token detection.
GitLabError
Possible errors during GitLab CI OIDC token detection.