Skip to content

.env-based secret param binding for Functions#10714

Open
Berlioz wants to merge 2 commits into
mainfrom
vsfan_env_params_use
Open

.env-based secret param binding for Functions#10714
Berlioz wants to merge 2 commits into
mainfrom
vsfan_env_params_use

Conversation

@Berlioz

@Berlioz Berlioz commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Pulls secrets from the Functions .env files and propagates them into the Functions Build's SecretEnvVars (and from there, into the resolved Backend, and from there, into the JSON uploaded to Cloud Functions/Cloud Run).

Params support not included in this PR, to reduce the size of the review. This is obviously going to be a terrible user experience before params are supported (hence the experiment flag) but this should be enough to test the actual binding behavior.

Quick guide to file change intent:

environments.ts - Adds an experiment flag which by default prevents any changes from being made to the Build. FIREBASE_SECRET_REF_ envs will still be accepted by the parser, but they'll do nothing (and will not appear in process.env)

env.ts - Modifies the key validation logic to allow keys that begin with FIREBASE_SECRET_REF_ even though FIREBASE_ is reserved. Otherwise knows nothing about this feature.

prepare.ts - Partitions the key-value pairs passed from env.ts into the normal entries and the secrets, which have FIREBASE_SECRET_REF_ stripped from the key at this point. If feature flag enabled, calls build.applyEnvSecretOverrides()

build.ts - Implements applyEnvSecretOverrides, which mutates a Build's state to upsert .env-defined secrets into SecretEnvVars before the Build is compiled into a Functions Backend.

gemini-code-assist[bot]

This comment was marked as outdated.

@firebase firebase deleted a comment from gemini-code-assist Bot Jun 26, 2026
@wiz-9635d3485b

wiz-9635d3485b Bot commented Jun 26, 2026

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings 1 Medium
Software Management Finding Software Management Findings -
Total 1 Medium

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

@firebase firebase deleted a comment from gemini-code-assist Bot Jun 26, 2026
@firebase firebase deleted a comment from gemini-code-assist Bot Jun 26, 2026
@Berlioz Berlioz force-pushed the vsfan_env_params_use branch from 14c6bec to d479b2d Compare June 26, 2026 22:26
@Berlioz Berlioz requested review from ajperel and inlined June 26, 2026 22:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants