Thank you localshop for this write-up and your work on this module. I've been nibbling and lurking at these threads, all the while building out what I can do with them. I went ahead and signed up for google cloud services. Now that I've done it, I'm glad for it and have little fear that google is gonna run away with my credit card anytime soon. They do give you $300 worth of credit and a year for a trial period and promise not to upgrade to paying without your say-so.
I built the sdk for debian. 5 commands: easy-peasy. The client is offered in 6 syntaxes, but perl is not one of them. For people who say "perl is dead," that might be proof, but I wonder if perl comes at it differently. Let me ask the question, short of igniting a flame war, is perl unfit for this task?
Does this module, WebService::GoogleAPI::Client, seek to brook that gap?
I wrote a bash driver for this script so that I could set environment variables before invocation. I get a single warning or error:
$ ./2.google.sh >1.txt
Use of uninitialized value in split at /usr/local/share/perl/5.26.1/We
+bService/GoogleAPI/Client/AuthStorage/ConfigJSON.pm line 82.
$
I'll put output, perl script, and bash driver between readmore tags
It would seem that the Oauth isn't correct. What fields should the .json file have? I think one can show the fields with redacted values and not lose his shirt:
{
"type": "service_account",
"project_id": "trans1-221819",
"private_key_id": ...,
"private_key": "-----BEGIN PRIVATE KEY-----...
"client_email": "jehosophat@trans1-221819.iam.gserviceaccount.com",
"client_id": "115338096797549417908",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1
+/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadat
+a/x509/jehosophat%40trans1-221819.iam.gserviceaccount.com"
}
I don't think I made many changes from your script except to print values and I took out one of the debug => 0. Looking for a precise definition of what "scoped" project means. Thank you for your comments and scripts,
|