Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: To be able to set custom audience in V2 functions #1399

Open
SayYoungMan opened this issue May 19, 2023 · 1 comment
Open

Comments

@SayYoungMan
Copy link

Related issues

Couldn't find any.

[REQUIRED] Version info

node: v18.16.0

firebase-functions: 4.4.0

firebase-tools: 12.0.0

firebase-admin: 11.8.0

Feature request

I am using a load balancer on top of firebase functions to direct traffics to necessary API endpoints on a single domain. However, Cloud Run's custom authentication returns 401 if I set the aud field in the token as my custom domain because the custom audience needs to be set as per the documentation here: https://cloud.google.com/run/docs/configuring/custom-audiences

Since there is no option to set custom audience in HttpsOptions, I have to manually run
gcloud beta run services update <service-name> --add-custom-audiences=https://custom.endpoint.com to add custom audiences.

It would be nicer to be able to set this when we are making firebase function itself, like:

functionsV2.https.onRequest(
    {
      memory: "1GiB",
      ingressSettings: "ALLOW_INTERNAL_AND_GCLB",
      invoker: "private",
      customAudiences: ["https://custom.endpoint.com"]
    },
    connectApp,
  )

It seems like it's supported on terraform (https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/cloud_run_service#annotations) in the form of annotations so it might be nicer to support annotations when making firebase functions V2.

@taeold
Copy link
Contributor

taeold commented May 20, 2023

@SayYoungMan Great feature request. There is a small amount of internal process I need to follow in order to bring new API to the SDK, so I'll get the process going.

Thank you for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants