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 docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.85
FROM rust:1.88

RUN rustup update
RUN rustup component add clippy
Expand Down
4 changes: 2 additions & 2 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
5 changes: 5 additions & 0 deletions lib/src/credentials/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -49,6 +50,10 @@ impl Header for GoogleUserProject {
pub(crate) async fn get_project_id(
creds: &Credentials,
) -> Result<String, Report<GCPCredentialsError>> {
if let Ok(project_id) = var("GOOGLE_CLOUD_PROJECT") {
return Ok(project_id);
}

let headers = get_headers(creds).await?;

let user_project: GoogleUserProject = headers
Expand Down