Skip to content

Simple script to check google access with GOOGLE_APPLICATION_CREDENTIALS

Notifications You must be signed in to change notification settings

boltops-tools/google_check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Google Check

Simple script to check google access with GOOGLE_APPLICATION_CREDENTIALS.

Usage

Export the GOOGLE_APPLICATION_CREDENTIALS.

export GOOGLE_APPLICATION_CREDENTIALS=REPLACE_ME

The GOOGLE_APPLICATION_CREDENTIALS should be a path to the JSON file with the credentials key.

Make sure you run source ~/.bashrc or open a new terminal. Then run:

bundle install
ruby google_check.rb

Example

Success looks like this:

$ bundle exec ruby google_check.rb
Listing gcs buckets as a test
my-gcs-bucket
Successfully connected to Google API with your GOOGLE_APPLICATION_CREDENTIALS
$

Failure looks like this:

$ bundle exec ruby google_check.rb
client.rb:1039:in `fetch_access_token': Authorization failed.  Server message: (Signet::AuthorizationError)
{"error":"invalid_grant","error_description":"Invalid grant: account not found"}

About

Simple script to check google access with GOOGLE_APPLICATION_CREDENTIALS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages