https://github.com/boltops-tools/google_check
Simple script to check google access with GOOGLE_APPLICATION_CREDENTIALS
https://github.com/boltops-tools/google_check
Last synced: about 2 months ago
JSON representation
Simple script to check google access with GOOGLE_APPLICATION_CREDENTIALS
- Host: GitHub
- URL: https://github.com/boltops-tools/google_check
- Owner: boltops-tools
- Created: 2020-07-04T05:07:09.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-11T02:23:09.000Z (over 4 years ago)
- Last Synced: 2026-01-31T15:28:25.645Z (4 months ago)
- Language: Ruby
- Size: 2.93 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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"}