Skip to content

Feature Request - Add consumeAppCheckToken and CORS in setGlobalOptions #1443

Open
@BenJackGill

Description

@BenJackGill

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions