I want to be able to read and write to the firebase realtime database only from my server, using only REST calls and no modules.
I tried looking into https://firebase.google.com/docs/database/rest/auth but a crucial step is using the googleapis module to generate the key needed, which requires installing a module. I tried looking at https://firebase.google.com/docs/reference/rest/auth/ to see how to do that itself using unit REST calls, but that are using the web api key in the settings, which is not the same as the secret key file, so I have no idea how to use service keys.
As an alternative I thought that in the rules I can somehow limit read and write access only to a certain url, such as "mysite.com/?secretKey", but even just entering the "request" variable gives an error.
So:
How can I limit read and write access of a firebase realtime database to only my server, using unit REST requests and no modules at all?
Edit
this is not a duplicate. There's a difference between a url and a domain. Anyone can fake requests from a specific domain if they simply navigate to it. If one uses a unique url with a secret code in the search parameter then not anyone can do so. Second "duplicate" is marked as duplicate with answer that deals with domain, not url. Last answer doesn't address ONLY REST api.