Expand description
§Google Cloud SDK for Rust
Library provides all available Google gRPC APIs generated from their proto interfaces.
The library also provides an easy-to-use client API for gRPC that supports Google Authentication natively.
§gRPC example
ⓘ
let firestore_client: GoogleApi<FirestoreClient<GoogleAuthMiddleware>> =
GoogleApi::from_function(
FirestoreClient::new,
"https://firestore.googleapis.com",
// cloud resource prefix: used only for some of the APIs (such as Firestore)
Some(cloud_resource_prefix.clone()),
)
.await?;
let response = firestore_client
.get()
.list_documents(tonic::Request::new(ListDocumentsRequest {
parent: format!("{}/documents", cloud_resource_prefix),
..Default::default()
}))
.await?;
Complete examples available on github.
Re-exports§
pub use google_cloud_auth;pub use prost;pub use prost_types;pub use tonic;
Modules§
- cloud
- error
- grafeas
- id_
token_ verify - Verification of Google-signed ID tokens, for the receiving side of a service-to-service call.
- maps
- proto_
ext
Structs§
- Google
ApiClient - Google
ApiClient Builder Function - Google
Auth Headers - The authentication headers of google-cloud-auth credentials, for every request the
tonic and reqwest middleware send:
authorizationwith an access token or an ID token, and whatever else the credentials add, such asx-goog-user-projectfor a quota project. - Google
Auth Middleware Layer - Google
Auth Reqwest Middleware - A
reqwest-middlewaremiddleware that sets the authentication headers of aGoogleAuthHeaderson every request:authorizationwith an access token or an ID token, and any other header the credentials add, such asx-goog-user-project. - Google
Environment - Header
Map - A specialized multimap for header names and values.
- IdToken
Audience - The audience an ID token is minted for and checked against: the URL of a Cloud Run service or a Cloud Run function, a custom audience configured on the service, or the OAuth client ID of a resource behind Identity-Aware Proxy.
- Secret
Value - Service
Account Email - The email of a service account, such as
invoker@my-project.iam.gserviceaccount.com. - Verify
IdToken - The service made by
VerifyIdTokenLayer. - Verify
IdToken Layer - A tower layer that lets a request through only with a valid Google ID token in its
authorization: Bearerheader, and puts the token’s claims into the request’s extensions for theVerifiedIdTokenextractor.