I'm running simple function in Google Cloud Functions to update DNS records (see code here). Currently I create service account with roles/dns.admin
privileges and assign that to the function. I'm then relying for Functions' beta support for client authentication & authorization.
Alternative approach could be NOT to provision the service account credentials (with roles/dns.admin
) for the function, but instead pass credential in each request.
How can I do this with Go runtime - How can I use the bearer token from the request with the Google API Go client?
Pros/cons in these two approaches?