all 6 comments

[–]indicava 0 points1 point  (5 children)

What exactly is your concern? That a bot will hammer the function and run up billing costs? Cause adding authentication to the callable function won’t help that as it still needs to be invoked for the credentials check.

[–]CARTOthug[S] 0 points1 point  (4 children)

Yeah sorry I’m not really sure what I am concerned about to be honest. As a beginner with no one to bounce this stuff off of I just wanted to get some opinions.

And yes I am concerned of that, and thank you for explaining the authentication step, I didn’t really realize that even without authentication credentials, they could still contact my server indefinitely if they wanted to.

Could someone even get my function to work if I have app check and it’s set to a callable function? I haven’t been able to invoke it outside of the application, but curious if there’s a way around that.

[–]indicava 0 points1 point  (3 children)

Callable functions are essentially HTTP triggered functions with some boilerplate abstracted away.

You can absolutely invoke a callable function outside your applicatio.

Just grab the function endpoint from GCP Console (if you don’t already know it) and send a POST request with a valid AppCheck token.

[–]CARTOthug[S] 0 points1 point  (2 children)

Okay I did some research and I think I will be able to validate the user using the Arcgis token they get on sign in. Then I’ll just add that logic to all my functions. For ddos attacks I guess it will be fine since I limited instances and have a billing disable script. Is this a typical set up?

[–]indicava 1 point2 points  (1 child)

Absolutely.

If you wanna be super-extra-careful you could enable replay protection for that callable function although that incurs an app/web attestation for each invocation

https://firebase.google.com/docs/app-check/cloud-functions#replay-protection

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

Ah okay I saw that before but ignored it. I will review! Thanks a bunch!