I want to create a Firebase Cloud Function that is not triggered by anything automatic, and is callable only for administrative purposes. I know I can generate some random key and store it in the config:
exports.someFunction = functions.https.onRequest((req, res) => {
if (req.query.key !== functions.config().access.key) {
res.status('401').send('Unauthorized');
return;
}
// actual body here
});
But this seems brittle not least because I have to maintain all the keys myself. I'd rather not expose the function over HTTPS at all and let it only be called through the Admin Console or the Firebase CLI or something of that sort.
Is there a way to do that?