Crate gcp_sa[][src]

Google Cloud Platform Service Account authentication abstraction for Rust

This crate abstracts OAuth2 workflow required when exchanging a GCP Service Account JSON formatted key to either a ID token or an access token.

Examples

let authenticator = GoogleServiceAccountAuthenticator::new_from_service_account_key_file(std::path::Path("key.json".to_string())).unwrap();
let id_token = authenticator.request_id_token("http://some.url.tld/scope-definition").await.unwrap();
println!("Authorization: Bearer {}", id_token);

Modules

error

Error struct for Google’s authentication API JWT error messages

Structs

GoogleAccessToken

Representation of Google Access Token JSON

GoogleIDToken

Representation of Google ID Token JSON

GoogleServiceAccountAuthenticator

Authenticator service that ingest a Service Account JSON key file and communicates with Google’s authentication API to exchange it into a access token or an id token.

Enums

GoogleAccessTokenType

Variants of different Google Access Token types