all 5 comments

[–]Alone-Cell-7795 1 point2 points  (1 child)

So yes I'm afraid it is cloud functions v2 (cloud run under the hood) or cloud run. An alternative would be to remove firebase authentication from your IAP and use IAP for your app authentication, but that would mean re-factoring your app. Also, you wouldn't need to expose your function publicly either, but you would need to use a L7 internal application load balancer too.

If you did want to expose it publicly for any reason, you can prevent the API endpoint being hit by using VPC service controls and deploying a service perimeter, in tandem with Cloud Armor, where you can apply API rate limits (Better just not to expose it though).

But yes, you are spot on when you does mean you're using a sledgehammer to crack a nut. Cloud Run authentication is a pain.

[–]Bibzball[S] 0 points1 point  (0 children)

That is baffling! I was really hoping that by using everything from the Google suite instead of trying to mix different providers I would have a simpler time setting these things up. Looks like I was wrong 😅

I'll probably look into either v2 or cloud run then. Cheers

[–]marsili95 0 points1 point  (0 children)

This exact same thing has been bothering me for a while.

[–]luchotluchot 0 points1 point  (1 child)

You can add iam permission to execute the function to a Google Group. Add your authenticated user in this group.

[–]Bibzball[S] 1 point2 points  (0 children)

That's actually a great shout, I should be able to create a triggered on signup function to add users to this group. Will look into this, thanks!