Skip to content

Email bypass: enable all boolean Remote Config flags for @mobilitydata.org users in production#99

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/enable-firebase-configs-for-mobilitydata-users
Draft

Email bypass: enable all boolean Remote Config flags for @mobilitydata.org users in production#99
Copilot wants to merge 2 commits intomainfrom
copilot/enable-firebase-configs-for-mobilitydata-users

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

In production, users authenticated with a @mobilitydata.org email should have all Firebase Remote Config boolean feature flags forced to true, regardless of configured values.

Changes

  • remote-config.server.ts — Added applyEmailBypass() (sets all boolean keys to true) and new exported getRemoteConfigValuesForUser(email?) that applies the bypass when VERCEL_ENV === 'production' and the email passes isMobilityDatabaseAdmin():

    export async function getRemoteConfigValuesForUser(
      email?: string,
    ): Promise<RemoteConfigValues> {
      const config = await getRemoteConfigValues();
      if (process.env.VERCEL_ENV === 'production' && isMobilityDatabaseAdmin(email)) {
        return applyEmailBypass(config); // all booleans → true
      }
      return config;
    }
  • [locale]/layout.tsx — Reads current user from md_session cookie (parallel with getMessages()) and passes email to getRemoteConfigValuesForUser, so the bypass is applied to the full app shell.

  • DataQualitySummary.tsx — Same pattern: resolves current user alongside translations before fetching user-aware config.

  • remote-config.server.spec.ts — New test file covering: admin in production (all booleans true), non-admin in production (unchanged), admin outside production (no bypass), undefined email, and non-boolean value preservation.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • download.cypress.io
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node index.js --exec install (dns block)
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node dist/index.js --exec install (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mobilitydatabase-web Ready Ready Preview, Comment Apr 7, 2026 2:40pm

Request Review

…ta.org users in production

Agent-Logs-Url: https://github.com/MobilityData/mobilitydatabase-web/sessions/e6a580fe-9b54-4e2a-86ce-65951372163a

Co-authored-by: Alessandro100 <18631060+Alessandro100@users.noreply.github.com>
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI changed the title [WIP] Fix email bypass for @mobilitydata.org users Email bypass: enable all boolean Remote Config flags for @mobilitydata.org users in production Apr 7, 2026
Copilot AI requested a review from Alessandro100 April 7, 2026 14:45
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.

Email Bypass for @mobilitydata.org users

3 participants