Skip to content

Fix bug where shorthand notation and parameterized service account didn't work for functions#8366

Merged
taeold merged 2 commits intomasterfrom
dl-sa-bugs
Mar 26, 2025
Merged

Fix bug where shorthand notation and parameterized service account didn't work for functions#8366
taeold merged 2 commits intomasterfrom
dl-sa-bugs

Conversation

@taeold
Copy link
Copy Markdown
Contributor

@taeold taeold commented Mar 25, 2025

The change allows developers to set service account configuration using short notation (e.g. my-sa@) and using string parameters:

import { onRequest } from "firebase-functions/https";
import { defineString } from "firebase-functions/params";
import * as logger from "firebase-functions/logger";

const sa = defineString("SERVICE_ACCOUNT")

export const helloSAParams = onRequest(
  { serviceAccount: sa },
  (request, response) => {
    logger.info("Hello logs!", { structuredData: true });
    response.send("Hello from Firebase!");
  });

export const helloShorthand = onRequest(
  { serviceAccount: "firebase-app-hosting-compute@" },
  (request, response) => {
    logger.info("Hello logs!", { structuredData: true });
    response.send("Hello from Firebase!");
  });

fixes #5224, #8227

@taeold taeold requested review from Berlioz and inlined March 25, 2025 22:14
@taeold taeold merged commit 96d00aa into master Mar 26, 2025
49 checks passed
@taeold taeold deleted the dl-sa-bugs branch March 26, 2025 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants