Firebase 3 database debug output when connecting from node.js SDKerv - debugging

Recently upgrading to run the firebase 3 sdk both in the client, in e2e tests and on the server.
Previously when using the firebase 2.x sdk you could connect to firebase in the same was as a client using signInWithCustomToken. This meant I could generate a token with the {debug: true} flag and use this for my mocha tests. Meaning I would get verbose output from firebase in the invent of security rejection.
Firebase 3 does not allow you to use client types of auth when running the sdk from node (i.e mocha). You must use service accounts. I have created the service account and have serviceaccount.json. I can connect and spoof the UID by using databaseAuthVariableOverride and everything is running AOK but I cannot figure out how to get firebase to send verbose database output so I can debug new firebase rules from my tests.
I have tried things like adding "Log Viewer" permission to my service account. I have also tried (in vein) to add debug: true to the serviceaccount.json
Any help appreciated.

Have you tried the following (in Node.js):
firebase.database.enableLogging(true);

Related

Checklist when moving from Heroku to AWS

I am trying to move my backend API app (node.js express server) from Heroku to AWS Elastic Beanstalk. But I did not realize the amount of features that Heroku was providing automatically and which I now have to set up manually in AWS.
So here is the list of features which I discovered were missing in AWS and the solutions I have implemented.
Could you please let me know if I am missing something in order to run smoothly my APIs in AWS and get the equivalent of what I had in Heroku?
auto-restart server when crashed : I am using PM2 to automatically restart my server in case of critical error
SSL certificate : I am using AWS ACM certificate,
logging : have inserted the datadog agent in order to receive logs in datadog
logging response time : I have added the "morgan-body" package to get each requests' duration and response code (had to manually filter the AWS healthchecks and search engine bots, because AWS gave me an IP adress which was visited constatntly by Baidu bots)
server timeout : I have implemented a 1200000ms timeout on the whole app (any better option ?)
auto deploy from Github : I have implemented a github automation to deploy code automatically (better options?)
Am I missing something? This app is already live so I do not want to put my customers at risk when I will move from Heroku to AWS...
Thanks for your help!
I believe you are covered:
Heroku Dynos restart after crashing or raising an error (Heroku Restarting Policy)
SSL certificates are provided for free
logging: Heroku supports various plugins, including Datadog
response time (in millisec) is logged automatically
HTTP timeout is 30 sec (it cannot be changed)
deploy from Github is possible (connecting the accounts), Docker deployment is also supported. Better options? Using Github Actions to deploy a new version after code push or tagging.
If you are migrating a production environment I strongly suggest first to setup a Heroku (Free) Dyno to test and verify all your needs are satisfied.

Webflow for GCP login

Is there a Go implementation of GCP Webflow similar to what gcloud SDK does (https://github.com/twistedpair/google-cloud-sdk/blob/master/google-cloud-sdk/lib/googlecloudsdk/core/credentials/flow.py)?
this repo relies on printing a url in console and letting user to copy/paste Auth Code instead of automatically launching browser and running a local server like gcloud SDK does, but it's README is worth a read as it also shows you current limitations when using Oauth/openid connect flow to authenticate to Cloud Run.
If python is okay for you, there's an official python lib that supports launching browser and running a local server, like what gcloud sdk does.

why is Bot Emulator v4 - Refresh access token failed with code 400?

I am using
Ver 4.1.0 Bot emulator
When I tried to use the production endpoint in the bot framework emulator. I have configured the endpoints in the bot file as below with information from the azure. But I am unable to the access it via the Emulator and also it does not connect in the "Test in Webchat" in Azure after deployment via Git to Azure. It works fine locally
It returns the following error
In the channels I see the following error triggered.
I analyzed the issue using Fiddler Trace. I think the tokens are being generated.
But the Emulator is not picking it. As seen in the below screenshot both of the fiddler and emulator refers to the same conversation ID.
what might be the issue that is triggering token failure?
I think the bot service is down at the moment.

What is the command to log out of Google App Engine SDK?

I completed version 1 of my Google App Engine site but when deploying it I used a different set of credentials from the ones I registered the Google App Engine app ID under. Accordingly the GAE SDK can't upload my app when I give the command:
mvn appengine:update
...because it remembers the wrong credentials and never asks me for the correct ones. How do I log out of the old credentials and log in with the new ones?
If you're on Windows : Go in your "C:/Users/whicheverUserIsYou". You should find a file called ".appcfg_oauth2_tokens_java".
If you're on Linux : the file is in fact "~/.appcfg_oauth2_tokens_java"
This is the file containing your credentials. Delete/Rename it, maven will ask for your credentials again.
if u mean google cloud sdk then the command is (gcloud auth revoke [your id])

Configure APNS on Parse Server

I'm trying to migrate from Parse.com service to a self-hosted Parse Server, and it's been a bit difficult.
Basically I set up my server like this:
Run $ npm install -g parse-server
Set env vars (PARSE_SERVER_DATABASE_URI, PARSE_SERVER_MASTER_KEY, PARSE_SERVER_APPLICATION_ID)
Run $ parse-server
Everything is up and running, and I also setup a machine running parse-dashboard in a very similar way.
I had already synced the database and had no problems with it.
The problem is that when I try to send a push notification, I get the message:
Missing push configuration
I believe that's connected to the APNS settings. In Parse.com dashboard we can add the APNS certificates, but on the self hosted dashboard there is no such option (or I couldn't find it).
What am I missing? How do I set theses things up?
I believe that running parse-server without the recommended Express wrapper does not give me full control of everything I needed to configure the application.
I created an Express app, started the serving using the guide #thailey01 suggested and now it works.

Resources