Google Cloud Functions and Third Party Packages

We have a bunch of Google Cloud functions that import a variety of packages and do a complex set of tasks. We’re looking to either (a) send an API call to the Google Cloud Function from Backendless API service or (b) migrate the functions to Backendless as custom code.

The problem with (a) is the API calls hit a CORS error and Google Cloud says the origin of the API service is undefined. Plus, our Google Cloud functions expect a firebase user token to verify. Is there a way for us to get the same security (CORS + user check) with Backendless?

In the alternate, we could migrate the functions into Backendless as custom code, but then I need to know how to give my developer server-side access to install packages they rely on. I found instructions on how to access server-side terminal, but it says I need to give him a secret API key?

Hello David King,

Sorry, but I didn’t quite understand which instructions you are referring to. Migrating your functions to Backendless as custom code is indeed an option. However, to guide you on how to provide server-side access for package installation, we need more clarification. Could you please share the specific instructions that mention giving a developer a “secret API key”? This way, we can offer a more precise answer and help you understand the best approach.

Regards,
Alexander

I’m not sure - the developer was sharing their screen and showing a bunch of Backendless documentation about how to get access to a back-end terminal where he can write commands and install packages. As I am not a developer, I didn’t really know how to give him access to a more technical environment where he can do that kind of thing. I’ve only used the UI builder codeless environment.

I guess the first question is whether it makes more sense to migrate the functions over to Backendless as code blocks and install the relevant packages on the back-end, or if there is a sensible way to overcome the CORS and user validation issues to secure the API calls to Google Cloud.

Hello @David_King

We will be happy to assist you. I need to ask you a few more questions so I can understand the problem better.

Here is our documentation - Backendless For Developers
Here is our documentation for the REST API - Backendless REST API Documentation
Please provide a link to the documentation you are referring to.

What packages are we talking about?

It is very difficult to answer such a question without knowing the complexity of these functions.

Maybe the solution described here - CORS issue with sendgrid - will help you.
Another topics - Cors and weird link for user services, Cors error

Regards,
Volodymyr

CORS: The issue is that an HTTPS call from a Backendless API Service to a Google Cloud Function is received by the Google Cloud functions as origin “undefined” making any CORS by the Google Cloud Function ineffective. Is there a way to make Backendless API Service send a proper origin?

Login: Is there a way to make it so the Google Cloud Functions will only accept API calls from a logged in user like we were doing with Firebase?

Technical: How do we go about giving the developer a way to login to a console terminal where they can install external packages.

Hello @David_King

Help us help you.

I can’t answer that question for you because I don’t know how you did it.

Which console terminal are you talking about? Can you provide a screenshot, link or something else?

Regards,
Volodymyr

Got it. As someone that is not a developer, I’m not really able to answer questions like how exactly the Google Cloud functions currently verify the API call is coming from an authenticated Firebase user. The developer set that up and I only know general concepts.

I’ve asked the developer to see if he can access this support chat using the Backendless invite I sent him so he can take over from here.

Great, we’ll be waiting for more detailed questions from your developer, and we’ll be happy to help.

Regards,
Volodymyr