grahamearley / FirestoreGoogleAppsScript

A Google Apps Script library for accessing Google Cloud Firestore.
http://grahamearley.website/blog/2017/10/18/firestore-in-google-apps-script.html
MIT License
648 stars 109 forks source link

What is the best way to protect the private key in a container bound script #142

Open andyburnett opened 2 years ago

andyburnett commented 2 years ago

I have created a script that accesses Firestore (using this library), and populates a Google Doc with some of the values from the Firestore. The access key and user name are stored in the Script Properties. I want to make the container document a template, so that my colleagues can create new documents, which are populated from Firestore.

However, creating duplicates of documents, via the 'New Template' menu command, doesn't copy the script properties, and the bound script therefore fails.

My thought was to create a script library, which contains the keys, and to include the library in the bound script, but there may be much better approaches. How have other people solved this?