Module: FaceDetect::Adapter::Google::AuthHelper

Defined in:
lib/face_detect/adapter/google/auth_helper.rb

Class Method Summary collapse

Class Method Details

.authorizationObject



17
18
19
20
21
22
23
# File 'lib/face_detect/adapter/google/auth_helper.rb', line 17

def authorization
  key_io = StringIO.new(credentials)
  ::Google::Auth::ServiceAccountCredentials.make_creds(
    json_key_io: key_io,
    scope: scopes
  )
end

.credentialsObject



13
14
15
# File 'lib/face_detect/adapter/google/auth_helper.rb', line 13

def credentials
  ENV.fetch('GOOGLE_CREDENTIALS_JSON')
end

.scopesObject



9
10
11
# File 'lib/face_detect/adapter/google/auth_helper.rb', line 9

def scopes
  ['https://www.googleapis.com/auth/cloud-platform']
end