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//! **WARNING:** this crate is under active development. We expect multiple
18//! breaking changes in the upcoming releases. Testing is also incomplete, we do
19//! **not** recommend that you use this crate in production. We welcome feedback
20//! about the APIs, documentation, missing features, bugs, etc.
21//!
22//! This crate contains types and functions used to authenticate applications
23//! on Google Cloud.  The SDK clients consume an implementation of
24//! [credentials::Credentials] and use these credentials to authenticate RPCs
25//! issued by the application.
26//!
27//! [Authentication methods at Google] is a good introduction on the topic of
28//! authentication for Google Cloud services and other Google products. The
29//! guide also describes the common terminology used with authentication, such
30//! as [Principals], [Tokens], and [Credentials].
31//!
32//! [Authentication methods at Google]: https://cloud.google.com/docs/authentication
33//! [Principals]: https://cloud.google.com/docs/authentication#principal
34//! [Tokens]: https://cloud.google.com/docs/authentication#token
35//! [Credentials]: https://cloud.google.com/docs/authentication#credentials
36
37pub mod build_errors;
38pub mod errors;
39
40/// A `Result` alias where the `Err` case is [BuildCredentialsError].
41pub(crate) type BuildResult<T> = std::result::Result<T, build_errors::Error>;
42
43/// Types and functions to work with Google Cloud authentication [Credentials].
44///
45/// [Credentials]: https://cloud.google.com/docs/authentication#credentials
46pub mod credentials;
47
48pub(crate) mod constants;
49
50pub(crate) mod token;
51
52/// The token cache
53pub(crate) mod token_cache;
54
55/// A `Result` alias where the `Err` case is [CredentialsError][errors::CredentialsError].
56pub(crate) type Result<T> = std::result::Result<T, errors::CredentialsError>;
57
58/// Headers utility functions to work with Google Cloud authentication [Credentials].
59///
60/// [Credentials]: https://cloud.google.com/docs/authentication#credentials
61pub(crate) mod headers_util;