Search code examples
google-apps-scriptlooker-studio

Google Apps Script - how to prevent people with view access from seeing version history?


I have a Data Studio community connector that runs as "Viewer" which requires that the script have link sharing on (documented here: https://developers.google.com/datastudio/connector/share). I didn't realize I needed link sharing on for this and initially had app secrets hard-coded into the script file. They include the following caution:

As a best practice it is recommend not to include any secrets or API keys directly in the source of your script and instead use the Properties Service.

I had begun the process of doing this, but then in my testing realized that anyone with view access can still access the script file's version history (File -> See version history) and thus view all of the hard-coded secrets I've since deleted.

Is there a way to delete all version history from the script file?

I believe that there is essentially no way anyone can somehow stumble on the script file / link unless I explicitly share it with them, but even so I'd like to lock things down thoroughly. Thank you.


Solution

  • All right, since version history is tied to specific files, it appears that I can delete the individual .gs file and then recreate it in the script and the history should be wiped.