google_cloud_auth/
lib.rs

1// Copyright 2024 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! Google Cloud Client Libraries for Rust - Authentication Components
16//!
17//! This crate contains types and functions used to authenticate applications
18//! on Google Cloud.  The SDK clients consume an implementation of
19//! [credentials::Credentials] and use these credentials to authenticate RPCs
20//! issued by the application.
21//!
22//! [Authentication methods at Google] is a good introduction on the topic of
23//! authentication for Google Cloud services and other Google products. The
24//! guide also describes the common terminology used with authentication, such
25//! as [Principals], [Tokens], and [Credentials].
26//!
27//! [Authentication methods at Google]: https://cloud.google.com/docs/authentication
28//! [Principals]: https://cloud.google.com/docs/authentication#principal
29//! [Tokens]: https://cloud.google.com/docs/authentication#token
30//! [Credentials]: https://cloud.google.com/docs/authentication#credentials
31
32pub mod build_errors;
33pub mod errors;
34
35/// A `Result` alias where the `Err` case is [BuildCredentialsError].
36pub(crate) type BuildResult<T> = std::result::Result<T, build_errors::Error>;
37
38/// Types and functions to work with Google Cloud authentication [Credentials].
39///
40/// [Credentials]: https://cloud.google.com/docs/authentication#credentials
41pub mod credentials;
42
43pub(crate) mod constants;
44
45pub(crate) mod token;
46
47/// The token cache
48pub(crate) mod token_cache;
49
50/// A `Result` alias where the `Err` case is [CredentialsError][errors::CredentialsError].
51pub(crate) type Result<T> = std::result::Result<T, errors::CredentialsError>;
52
53/// The retry module
54pub(crate) mod retry;
55
56/// Headers utility functions to work with Google Cloud authentication [Credentials].
57///
58/// [Credentials]: https://cloud.google.com/docs/authentication#credentials
59pub(crate) mod headers_util;