google-cloud-functions

How to configure custom domain for Google Cloud Functions for rendering HTML

放肆的年华 提交于 2021-02-07 19:17:53
问题 So I have deployed a Google Cloud Function to some place like this: https://us-central1-my-project.cloudfunctions.net/my-function I can successfully render a dynamic webpage like this: https://us-central1-my-project.cloudfunctions.net/my-function?slug=foo Now, I would like to put this behind a regular URL so it works like this: https://my-domain.com/some-directory/foo I would like for it to be https instead of http. And notice that I added some-directory above the foo slug, so there is a

How to configure custom domain for Google Cloud Functions for rendering HTML

徘徊边缘 提交于 2021-02-07 19:17:04
问题 So I have deployed a Google Cloud Function to some place like this: https://us-central1-my-project.cloudfunctions.net/my-function I can successfully render a dynamic webpage like this: https://us-central1-my-project.cloudfunctions.net/my-function?slug=foo Now, I would like to put this behind a regular URL so it works like this: https://my-domain.com/some-directory/foo I would like for it to be https instead of http. And notice that I added some-directory above the foo slug, so there is a

How to configure custom domain for Google Cloud Functions for rendering HTML

泪湿孤枕 提交于 2021-02-07 19:16:14
问题 So I have deployed a Google Cloud Function to some place like this: https://us-central1-my-project.cloudfunctions.net/my-function I can successfully render a dynamic webpage like this: https://us-central1-my-project.cloudfunctions.net/my-function?slug=foo Now, I would like to put this behind a regular URL so it works like this: https://my-domain.com/some-directory/foo I would like for it to be https instead of http. And notice that I added some-directory above the foo slug, so there is a

Testing Cloud Functions for Firebase with Jasmine and Typescript

佐手、 提交于 2021-02-07 11:01:29
问题 I'm currently investigating Google Cloud Functions and have some basic test functions written in typescript. The functions work as expected and I am now attempting to create unit tests using Jasmine. (I'm not using Chai/sinon as per the docs as the rest of my project uses jasmine). I have two issues 1) the test does not run due to this error throw new Error('Firebase config variables are not available. ' + ^ Error: Firebase config variables are not available. Please use the latest version of

Cross domain state cookie issue for oAuth using firebase functions while on the same domain

Deadly 提交于 2021-02-07 07:01:23
问题 I am implementing a oAuth login for a user for the firebase platform. All works fine except if the user has disabled cross domain cookies. Here is what I did. From my domain/app the user gets redirected to a cloud function. The could function sets the state cookie and redirects the user to the oAuth provider. The user signs in to the oAuth provider and gets redirected back to another function to get the code etc. And here is the problem On step 3 above the function cannot read any cookie if

GCP Cloud Function - ERROR fetching storage source during build/deploy

南楼画角 提交于 2021-02-07 05:48:46
问题 Running into problems building deploying functions. When trying to programmatically deploy the function I get the following output in builder logs (ERRORS). 2020-10-20T02:22:12.155866856Z starting build "1fc13f51-28b6-4052-9a79-d5d0bef9ed5c" I 2020-10-20T02:22:12.156015831Z FETCHSOURCE I 2020-10-20T02:22:12.156031384Z Fetching storage object: gs://gcf-sources-629360234120-us-central1/${FUNCTIONNAME}-63f501f1-a8d2-4837-b992-1173ced83036/version-1/function-source.zip#1603160527600655 I 2020-10

Unable to validate Twilio request in Google cloud function

主宰稳场 提交于 2021-02-07 04:29:15
问题 I have a Google cloud function to which Twilio sends POST requests with SMS statuses but I am unable to verify that the requests are coming from Twilio using any of the methods outlined in https://www.twilio.com/docs/usage/security My first attempt consisted of using the validateRequest function, as shown in the code below const twilio = require('twilio'); let url = 'https://....cloudfunctions.net/...' let token = 'XXXX'; let header = request.headers['x-twilio-signature']; let sortedKeys =

Upload TLS client certificate to Firebase cloud functions

和自甴很熟 提交于 2021-02-07 03:30:36
问题 I'm trying to figure out if it is possible to upload a TLS client certificate to be used for my cloud functions in firebase. The TLS client certificate is required by a third-party payment solution called Swish. This is my first firebase project and it seems silly that a small issue like this will render the platform unusable for me.. 回答1: After some headache and trying I found a quite easy way to solve swish-payments through cloud functions: Using request-js instead of the built in libraries

Upload TLS client certificate to Firebase cloud functions

孤街醉人 提交于 2021-02-07 03:29:33
问题 I'm trying to figure out if it is possible to upload a TLS client certificate to be used for my cloud functions in firebase. The TLS client certificate is required by a third-party payment solution called Swish. This is my first firebase project and it seems silly that a small issue like this will render the platform unusable for me.. 回答1: After some headache and trying I found a quite easy way to solve swish-payments through cloud functions: Using request-js instead of the built in libraries

Calling a firebase cloud function from nodejs

余生长醉 提交于 2021-02-05 11:44:26
问题 I want to call a cloud function from firebase from another nodejs server or just a nodejs script. My firebase function is an onCall function. I am using https://www.npmjs.com/package/firebase-admin for interacting with firebase but it doesn't seem to have a way of calling cloud functions... Can I do it any other way? Like a http request? 回答1: In short: You have to trigger http event. Currently, firebase does support two invoke options. If you read through documentation here and here, there is