actix_firebase_auth/
lib.rs

1//! # actix-firebase-auth
2//!
3//! This crate provides Firebase JWT verification for the `actix-web` framework,
4//! using Google's public JWKs to validate ID tokens issued by Firebase Authentication.
5//!
6//! ## Example
7//!
8//! ```no_run
9//! use actix_web::{web, App, HttpServer, HttpResponse, Responder};
10//! use actix_firebase_auth::{FirebaseAuth, FirebaseUser, Result};
11//!
12//! #[actix_web::main]
13//! async fn main() -> std::io::Result<()> {
14//!     let auth = FirebaseAuth::new("your-project-id").await.unwrap(); // Don't forget to handle this error
15//!
16//!     HttpServer::new(move || {
17//!         App::new()
18//!             .app_data(web::Data::new(auth.clone()))
19//!             .route("/profile", web::get().to(get_profile))
20//!     })
21//!     .bind(("127.0.0.1", 8080))?
22//!     .run()
23//!     .await
24//! }
25//!
26//! async fn get_profile(
27//!     auth: web::Data<FirebaseAuth>,
28//!     user: FirebaseUser,
29//! ) -> HttpResponse {
30//!     HttpResponse::Ok().json(user)
31//! }
32//! ```
33
34mod client;
35mod error;
36mod impls;
37mod jwk;
38mod user;
39
40pub use client::*;
41pub use error::*;
42pub use user::*;