Class: Google::Cloud::Vision::Credentials

Inherits:
Auth::Credentials
  • Object
show all
Defined in:
lib/google/cloud/vision/credentials.rb

Overview

Credentials

Represents the authentication and authorization used to connect to the Vision API.

Examples:

require "google/cloud/vision"

keyfile = "/path/to/keyfile.json"
creds = Google::Cloud::Vision::Credentials.new keyfile

vision = Google::Cloud::Vision.new(
  project_id: "my-project",
  credentials: creds
)

vision.project_id #=> "my-project"

Constant Summary collapse

SCOPE =
["https://www.googleapis.com/auth/cloud-platform"]
PATH_ENV_VARS =
%w(VISION_CREDENTIALS
VISION_KEYFILE
GOOGLE_CLOUD_CREDENTIALS
GOOGLE_CLOUD_KEYFILE
GCLOUD_KEYFILE)
JSON_ENV_VARS =
%w(VISION_CREDENTIALS_JSON
VISION_KEYFILE_JSON
GOOGLE_CLOUD_CREDENTIALS_JSON
GOOGLE_CLOUD_KEYFILE_JSON
GCLOUD_KEYFILE_JSON)
DEFAULT_PATHS =
["~/.config/gcloud/application_default_credentials.json"]