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§
Enums§
- Error
- Errors that can occur during detection.
- GitHub
Error - Possible errors during GitHub Actions OIDC token detection.
- GitLab
Error - Possible errors during GitLab CI OIDC token detection.