Skip to content

env reserved prefix handling - #11081

Merged
Berlioz merged 4 commits into
mainfrom
vsfan_selected_events_allowlist
Sep 12, 2026
Merged

env reserved prefix handling#11081
Berlioz merged 4 commits into
mainfrom
vsfan_selected_events_allowlist

Conversation

@Berlioz

@Berlioz Berlioz commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

The EXT_SELECTED_EVENTS allowed prefix wasn't working because it's semantically different than FIREBASE_SECRET_REF_ and FIREBASE_MIGRATED_SYSTEM_ prefixes that need something after the underscore.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors environment variable key validation for Firebase Functions. It introduces a helper function keyPermittedByKnownPrefix to validate allowlisted reserved prefixes, throwing errors if they are malformed (e.g., missing a required suffix or having an unexpected suffix). It also updates the corresponding unit tests and adds explanatory comments. The reviewer suggested refactoring keyConflictsWithReservedPrefixes to avoid nested .some() calls with a throwing predicate, recommending a flatter loop structure to improve readability and align with the repository's style guide on reducing nesting.

Comment thread src/functions/env.ts

@ajperel ajperel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have some message/comment suggestions but code looks good.

Comment thread src/functions/env.ts Outdated
Comment thread src/functions/env.ts Outdated
@Berlioz
Berlioz enabled auto-merge (squash) September 12, 2026 00:19
@Berlioz
Berlioz merged commit 63074f2 into main Sep 12, 2026
49 of 51 checks passed
@Berlioz
Berlioz deleted the vsfan_selected_events_allowlist branch September 12, 2026 00:28
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.

3 participants