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?
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.
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.
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.
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.
Hi, I am the developer, So Previously we were using the Flutter Flow for the front end, and for the backend we were using Google Cloud Function with Firebase.
Now, as we are moving our front-end code to the backendless, so I wanted to ask, How we can make use of those Google Cloud Functions with our backendless UI, Currently We tried to call Google Cloud Functions using backendless API services, but when the backendless API service was calling the Google Cloud Function, Then the Google Cloud Function Received the origin undefined, but we want to receive our domain name or the backend API domain name in origin so that we can implement the cors.
So we wanted to ask you guys how we can implement Google Cloud Functions with Firebase on BackEndless. If it is not possible, we can implement serverless cloud functions API calls in Back Endless can you guys let us know which database we can use with BackEndless.
Basically, we are using many third-party npm packages, so we want to install third-party packages too in the cloud function, If you guys recommended us to use backendless cloud functions, If backendless has any.
We have about 20 Google Cloud Functions, with about 10 packages each, so there isn’t a single answer to broad questions like “what are your functions doing” or “what packages are they using”. Here are some excerpts from one of the functions though, showing the packages used and the types of things it’s doing (in this case creating folders through Box.com API)
We need to know:
(a) Is there a way to get Backendless to send an origin to the Google Cloud Function so it can pass a CORS check?
(b) Is there a way to migrate the functions into Backendless where we can install the packages, like the ones listed above?
For anyone coming across this, the simple answer is you can manually set the CORS origin in the HTTPS request in the headers. Also, Backendless does have similar functionality as what we were using in Firebase, where you can have the Google Cloud function check for a valid user token. My developer sorted it out.