Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/clear_emulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2024"

[dependencies]
rs-firebase-admin-sdk = { path = "../../lib" }
tokio = { version = "1.49", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1.51", features = ["macros", "rt-multi-thread"] }
2 changes: 1 addition & 1 deletion examples/cookies/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ edition = "2024"
[dependencies]
rs-firebase-admin-sdk = { path = "../../lib" }
time = { version = "0.3" }
tokio = { version = "1.49", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1.51", features = ["macros", "rt-multi-thread"] }
2 changes: 1 addition & 1 deletion examples/cookies/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async fn main() {
.await
.unwrap();

let live_cookie_validator = live_app.cookie_token_verifier().await.unwrap();
let live_cookie_validator = live_app.cookie_token_verifier().unwrap();

live_cookie_validator.validate(&cookie).await.unwrap();
}
2 changes: 1 addition & 1 deletion examples/get_users/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2024"

[dependencies]
rs-firebase-admin-sdk = { path = "../../lib" }
tokio = { version = "1.49", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1.51", features = ["macros", "rt-multi-thread"] }
2 changes: 1 addition & 1 deletion examples/verify_token/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2024"

[dependencies]
rs-firebase-admin-sdk = { path = "../../lib", features = ["tokens"] }
tokio = { version = "1.49", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1.51", features = ["macros", "rt-multi-thread"] }
2 changes: 1 addition & 1 deletion examples/verify_token/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async fn main() {
// Live
let oidc_token = std::env::var("ID_TOKEN").unwrap();
let live_app = App::live().await.unwrap();
let live_token_validator = live_app.id_token_verifier().await.unwrap();
let live_token_validator = live_app.id_token_verifier().unwrap();
verify_token(&oidc_token, &live_token_validator).await;

// Emulator
Expand Down
21 changes: 10 additions & 11 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rs-firebase-admin-sdk"
version = "4.2.1"
version = "4.3.0"
rust-version = "1.88"
edition = "2024"
authors = ["Kostas Petrikas"]
Expand All @@ -14,27 +14,26 @@ license = "MIT"
doctest = false

[features]
default = ["tokens", "reqwest/default-tls"]
rustls-tls = ["reqwest/rustls-tls"]
default = ["tokens"]
tokens = ["dep:jsonwebtoken", "dep:jsonwebtoken-jwks-cache"]

[dependencies]
tokio = { version = "1.49", features = ["sync"], default-features = false }
error-stack = "0.6"
tokio = { version = "1.51", features = ["sync"], default-features = false }
error-stack = "0.7"
thiserror = "2.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
http = "1.4"
headers = "0.4"
reqwest = { version = "0.12", features = ["charset", "json"], default-features = false }
reqwest = { version = "0.13", features = ["charset", "json", "hickory-dns", "rustls", "brotli"], default-features = false }
urlencoding = "2.1"
bytes = "1"
google-cloud-auth = "1.4"
google-cloud-auth = "1.8"
time = { version = "0.3", features = ["serde"] }
base64 = "0.22"
jsonwebtoken = { version = "10.2", optional = true }
jsonwebtoken-jwks-cache = { version = "0.2", optional = true }
jsonwebtoken = { version = "10", optional = true }
jsonwebtoken-jwks-cache = { version = "0.3", optional = true }

[dev-dependencies]
tokio = { version = "1.49", features = ["macros", "rt-multi-thread"] }
serial_test = "3.2"
tokio = { version = "1.51", features = ["macros", "rt-multi-thread"] }
serial_test = "3.4"
8 changes: 3 additions & 5 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ impl App<EmulatorCredentials> {
impl App<AccessTokenCredentials> {
/// Create instance of Firebase app for live project with an explicit project ID,
/// bypassing environment variable and credential header resolution.
pub async fn live_with_project_id(
project_id: &str,
) -> Result<Self, Report<GCPCredentialsError>> {
pub fn live_with_project_id(project_id: &str) -> Result<Self, Report<GCPCredentialsError>> {
let credentials: Credentials = Builder::default()
.with_scopes(FIREBASE_AUTH_SCOPES)
.build_access_token_credentials()
Expand Down Expand Up @@ -98,7 +96,7 @@ impl App<AccessTokenCredentials> {

/// Create OIDC token verifier
#[cfg(feature = "tokens")]
pub async fn id_token_verifier(
pub fn id_token_verifier(
&self,
) -> Result<impl jwt::TokenValidator, Report<credentials::GCPCredentialsError>> {
jwt::LiveValidator::new_jwt_validator(self.project_id.clone())
Expand All @@ -107,7 +105,7 @@ impl App<AccessTokenCredentials> {

/// Create cookie token verifier
#[cfg(feature = "tokens")]
pub async fn cookie_token_verifier(
pub fn cookie_token_verifier(
&self,
) -> Result<impl jwt::TokenValidator, Report<credentials::GCPCredentialsError>> {
jwt::LiveValidator::new_cookie_validator(self.project_id.clone())
Expand Down
Loading