diff --git a/docker/Dockerfile b/docker/Dockerfile index 36526c2..a2d4600 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.85 +FROM rust:1.88 RUN rustup update RUN rustup component add clippy diff --git a/lib/Cargo.toml b/lib/Cargo.toml index f41c00d..85d4841 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "rs-firebase-admin-sdk" -version = "4.1.0" -rust-version = "1.85" +version = "4.1.1" +rust-version = "1.88" edition = "2024" authors = ["Kostas Petrikas"] categories = ["authentication", "api-bindings", "asynchronous"] diff --git a/lib/src/credentials/mod.rs b/lib/src/credentials/mod.rs index f7fa1dc..50c967f 100644 --- a/lib/src/credentials/mod.rs +++ b/lib/src/credentials/mod.rs @@ -7,6 +7,7 @@ use google_cloud_auth::credentials::{CacheableResource, Credentials}; use headers::HeaderMapExt; use headers::{Header, HeaderName, HeaderValue}; use http::{Extensions, HeaderMap}; +use std::env::var; #[derive(thiserror::Error, Debug, Clone)] #[error("Failed to extract GCP credentials")] @@ -49,6 +50,10 @@ impl Header for GoogleUserProject { pub(crate) async fn get_project_id( creds: &Credentials, ) -> Result> { + if let Ok(project_id) = var("GOOGLE_CLOUD_PROJECT") { + return Ok(project_id); + } + let headers = get_headers(creds).await?; let user_project: GoogleUserProject = headers