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 - Add consumeAppCheckToken and CORS in setGlobalOptions #1443

Open
BenJackGill opened this issue Jul 13, 2023 · 1 comment
Open

Comments

@BenJackGill
Copy link

BenJackGill commented Jul 13, 2023

I am proposing an enhancement for the setGlobalOptions function in Firebase Functions Gen 2.

The setGlobalOptions function enables setting global configurations for the entire project such as enforceAppCheck. For example:

import { setGlobalOptions } from "firebase-functions/v2";

setGlobalOptions({
  enforceAppCheck: true,
});

But I think it would be beneficial to include consumeAppCheckToken and cors options as well.

Adding consumeAppCheckToken will allow developers to fully handle AppCheck at a global level, complementing enforceAppCheck which is already available. Details on consumeAppCheckToken which is currently set at the function level can be found here.

And including cors will provide developers the convenience of managing Cross-Origin Resource Sharing settings across the entire project. Details on cors which is currently set at the function level can be found here.

These enhancements will reduce repetitive individual function configurations, significantly streamlining the development process.

The end result would be something like this:

import { setGlobalOptions } from "firebase-functions/v2";

setGlobalOptions({
  enforceAppCheck: true,
  consumeAppCheckToken: true,
  cors: [/firebase\.com$/, "flutter.com"]
});

Thank you for your consideration.

@google-oss-bot
Copy link
Collaborator

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

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

3 participants