Skip to content

🐛 [firestore-bigquery-export] Authenticate calls to TRANSFORM_FUNCTION so it can be IAM-protected #2804

Description

@Murayu0225

This feature request is for extension: firestore-bigquery-export

What feature would you like to see?

I'd like the extension to send an OIDC ID token when it calls the TRANSFORM_FUNCTION URL, so the transform endpoint can be locked down via Cloud Run IAM.

Right now the extension calls the URL with just a Content-Type header — no Authorization. Because of this the transform function has to be granted allUsers invoker access. If you try to limit it (even to the extension's own runtime SA), Cloud Run returns 403 and syncBigQuery fails with FetchError: invalid json response body ... Unexpected token '<'. As far as I can tell this isn't mentioned in the README or PREINSTALL, so it's easy to set up a publicly invokable function without realizing it.

If the extension attached an ID token to the call (using the transform URL as the audience), users could lock the endpoint down via Cloud Run IAM and it would still work for everyone else, since public functions would just ignore the extra header.

How would you use it?

We use TRANSFORM_FUNCTION to strip sensitive fields (private message bodies) before they reach BigQuery, so it sits on the critical path for our privacy guarantees. Keeping the endpoint open to allUsers is uncomfortable — anyone who finds the URL can drive invocations and run up our bill. With ID-token auth we'd grant roles/run.invoker only to ext-<INSTANCE_ID>@<PROJECT>.iam.gserviceaccount.com and drop allUsers.

Activity

  1. cabljac commented on May 8, 2026

    @cabljac
    Contributor

    Hi thanks for raising this! It's been received, it sounds like a useful feature!

  2. self-assigned this
    on May 8, 2026
  3. Murayu0225 commented on May 8, 2026

    @Murayu0225
    Author

    @cabljac Thanks for the response!
    I actually have a rough idea of how to implement a fix for this. I noticed you've self-assigned the issue, but would you mind if I take a stab at it and submit a PR?

  4. Murayu0225 commented on May 22, 2026

    @Murayu0225
    Author

    Hi @cabljac, just checking in on this.
    I'm still interested in working on a fix for this issue. If you haven't started on it yet, I'd love to take a crack at it and submit a PR.
    Please let me know if that works for you!

  5. cabljac commented on May 26, 2026

    @cabljac
    Contributor

    Hey @Murayu0225 if you're happy to put together a PR, that would be great!

  6. Murayu0225 commented on May 27, 2026

    @Murayu0225
    Author

    Thank you! I'll work on the PR.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions